Skip to content

Escape doesn't blur composer — no keyboard-only path to j/k message navigation #3952

@TomBanksAU

Description

@TomBanksAU

Bug Description

When the composer input is focused, there is no keyboard shortcut to unfocus it. This means keyboard-only users have no way to leave typing mode and use the j/k keys for session navigation — they are forced to reach for the mouse and click outside the composer.

The j/k navigation handler (sessions.js line 6248) correctly passes through when focused on an input/textarea via _isInteractiveSwipeTarget, but there is no way to get out of that state with the keyboard. Escape handles onboarding, settings, search, and message edits, but does not blur the composer.

Steps to Reproduce

  1. Open a conversation in hermes-webui
  2. Click the composer input so it is focused (or press Cmd/Ctrl+K to start a new chat)
  3. Press j or k — characters are typed into the composer instead of navigating sessions
  4. Press Escape — nothing happens; the composer retains focus
  5. j/k still cannot be used for navigation

Expected Behavior

Pressing Escape while the composer is focused should blur (unfocus) it. Once the composer is blurred, pressing j or k navigates to the next/previous session in the sidebar.

Actual Behavior

Escape has no effect when the composer is focused. The only way to move focus away is to click elsewhere with the mouse.

Proposed Solution

Add a composer blur to the Escape key handler in static/boot.js. When the #msg textarea is the active element and Escape is pressed, blur it (document.activeElement.blur()). This should go after higher-priority panel-closing Escape behaviours (onboarding, settings, etc.) so those still take precedence when active.

Environment

  • hermes-webui running locally at 127.0.0.1:8787
  • All modern browsers

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsprint-candidateStrong candidate for next sprintuxUser experience / visual polish

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions