Skip to content

fix: NEXTのEnter操作によるセリフの巻き戻りを防ぐ - #28

Open
eai04191 wants to merge 1 commit into
mainfrom
fix/typecheck-ci
Open

eai04191 wants to merge 1 commit into
mainfrom
fix/typecheck-ci

Conversation

@eai04191

@eai04191 eai04191 commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

NEXTにフォーカスしてEnterを押すと、独自ショートカットとブラウザ標準の操作が二重に実行され、セリフが進んですぐ戻る問題を修正します。操作要素・編集可能領域では標準操作を優先し、処理済みイベントとIME変換中のイベントも独自ショートカットの対象外にします。

検証

  • 実ブラウザで修正前の症状を再現し、修正後のNEXT・BACK・選択肢のEnter操作、NEXTのSpace・クリック、操作要素外のEnter/Backspace、入力欄の編集を確認
  • pnpm typecheck、pnpm lint、pnpm test(10件)、pnpm build成功
  • pnpm format:check '!**/.playwright-cli/**'成功(ブラウザ生成ログを除外)

Closes #17

byCodex

Summary by CodeRabbit

  • Bug Fixes
    • Keyboard navigation shortcuts no longer trigger while users are typing, composing text, or interacting with buttons, links, form controls, and other focusable elements. Enter and Backspace navigation continue to work elsewhere.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e6f79879-05f7-4f37-a294-af60830ea170

📥 Commits

Reviewing files that changed from the base of the PR and between b4c8338 and fc3da36.

📒 Files selected for processing (1)
  • components/SceneViewer.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The global keyboard handler now ignores prevented or composing events and events targeted at editable or interactive elements. Enter and Backspace navigation remain unchanged for other events.

Changes

Keyboard navigation

Layer / File(s) Summary
Filter keyboard shortcut events
components/SceneViewer.tsx
The handler returns early for prevented or composing events and events targeted at editable elements or within interactive elements. Enter and Backspace handling remains unchanged for other events.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to fc3da

The reported duplicate navigation is addressed by letting native controls handle their own Enter activation. No concrete merge-blocking risk is established.

Architecture Summary

Architecture risk: 🔵 Low · up to fc3da

The change affects 1 system.

Changed systems: components

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — components (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in components/SceneViewer.tsx: keyboardHandler now returns before handling Enter or Backspace when the event is prevented, is composing, or targets an editable element or a target within a button, link, form control, summary, or [tabindex] element.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: preventing dialogue rewind caused by pressing Enter on NEXT. It is concise and directly related to the pull request objective.
Linked Issues check ✅ Passed #17 requires prevention of duplicate keyboard activation on focused NEXT, BACK, and choice controls, while retaining shortcuts outside controls. At the reviewed head, keyboardHandler returns for `ev…
Out of Scope Changes check ✅ Passed The reviewed change is limited to components/SceneViewer.tsx keyboard-event filtering. The change directly supports #17 by removing duplicate activation and preserving non-control shortcuts. No unre…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NEXTにフォーカスしてEnterを押すとセリフが進んですぐ戻る

1 participant