Skip to content

fix(channel): focus input when pressing enter with no message selected#3874

Open
peterchinman wants to merge 1 commit into
mainfrom
peter/macro-1735-regression-pressing-enter-used-to-focus-channel
Open

fix(channel): focus input when pressing enter with no message selected#3874
peterchinman wants to merge 1 commit into
mainfrom
peter/macro-1735-regression-pressing-enter-used-to-focus-channel

Conversation

@peterchinman

Copy link
Copy Markdown
Contributor

Problem

Regression: when a channel message list was focused but the input was not, pressing enter no longer focused the input. The focus-input-on-enter hotkey was dropped in a refactor, leaving TOKENS.channel.focusInput orphaned (defined but never registered).

Fix

Re-register an enter hotkey on the message list scope (via registrationType: 'add') that focuses the channel input when no message is selected. The existing reply-on-enter behavior still takes precedence when a message is selected.

https://claude.ai/code/session_01W97jtR2NF17k66NXWTKE7Y


Generated by Claude Code

When a channel message list was focused but the input was not, pressing
enter no longer focused the input. The focus-input-on-enter hotkey was
dropped in a refactor (its TOKENS.channel.focusInput token was left
orphaned). Re-register an enter hotkey on the message list scope that
focuses the channel input when no message is selected, while preserving
the existing reply-on-enter behavior when a message is selected.
@macro-application

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2c5cf22d-6444-4bb7-931e-b6ab0f4785e4

📥 Commits

Reviewing files that changed from the base of the PR and between 778d99d and 29d7320.

📒 Files selected for processing (1)
  • js/app/packages/channel/Channel/create-channel-hotkeys.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved keyboard navigation in channels with better hotkey behavior.
    • Arrow key navigation now properly focuses the message input when reaching the end of the message list.
    • Enhanced enter key functionality for faster access to message composition.

Walkthrough

This PR improves keyboard navigation in the channel input by refactoring focus behavior into a reusable helper and extending hotkey handling. A new focusInput helper is introduced to query and focus the contenteditable input element. The arrowdown hotkey's "no next message" path is updated to use this helper. Additionally, a new enter hotkey is registered with registrationType: 'add' to focus the input when no message is selected, conditioned on the absence of current selection.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format (fix:) and is 70 characters, meeting the under-72-character requirement. It clearly describes the main change: fixing the enter-key behavior to focus input when no message is selected.
Description check ✅ Passed The description clearly explains the regression problem, the specific fix implemented, and how it relates to the code changes in the pull request. It provides sufficient context about re-registering the enter hotkey.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants