Skip to content

fix(app): stop keyboard events at native level in inline editors#20

Open
devin-ai-integration[bot] wants to merge 1 commit into
devfrom
devin/1781251088-fix-space-rename
Open

fix(app): stop keyboard events at native level in inline editors#20
devin-ai-integration[bot] wants to merge 1 commit into
devfrom
devin/1781251088-fix-space-rename

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Issue for this PR

Closes anomalyco#2559

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Pressing Space while renaming (workspace, project, session title, terminal tab) triggers parent interactive elements instead of typing a space character.

Root cause: SolidJS delegates onKeyDown/onKeyUp to the document level via document.addEventListener. By the time event.stopPropagation() runs inside the delegated handler, the native DOM event has already bubbled through parent buttons, Collapsible.Triggers, and Tabs.List — so the browser's built-in Space→click activation fires on those parents.

Fix: Switch all three inline-editing inputs from SolidJS-delegated onKeyDown to native addEventListener via the ref callback. The native listener fires during the element's own event phase, so stopPropagation() prevents the event from ever reaching parent nodes. keyup is also stopped to block the second half of the browser's Space-to-click mechanism on buttons.

Files changed:

  • packages/app/src/pages/layout/inline-editor.tsx — shared InlineEditor used by workspace/project rename
  • packages/app/src/pages/session/message-timeline.tsx — session title rename
  • packages/app/src/components/session/session-sortable-terminal-tab.tsx — terminal tab rename (was also missing stopPropagation entirely)

How did you verify your code works?

  • Lint (bun lint) passes — no warnings in changed files
  • Typecheck (bun typecheck via tsgo) passes across all 23 packages

Screenshots / recordings

N/A — keyboard event handling change, no visual diff.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Link to Devin session: https://ogp.devinenterprise.com/sessions/b057240acb4f4ca981b2e5027e173121

SolidJS event delegation attaches handlers at the document level, so
calling stopPropagation inside a delegated onKeyDown fires too late —
the native event has already bubbled through parent interactive elements
(buttons, Collapsible triggers, Tabs list).  This allows the browser to
treat Space as a button activation key, toggling collapsibles or
switching tabs instead of typing a space character.

Switch all inline-editing inputs to native addEventListener via the ref
callback.  The native handler fires during the element's own event phase
so stopPropagation prevents the event from ever reaching parent nodes.
Also stop keyup propagation to block the second half of the browser's
Space-to-click mechanism on buttons.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

TypeError: undefined is not an object (evaluating 'toSummarize.at(-1).info')

1 participant