Skip to content
This repository was archived by the owner on Sep 4, 2026. It is now read-only.
This repository was archived by the owner on Sep 4, 2026. It is now read-only.

FloatingMenu takes no focus: context menus are effectively mouse-only #381

Description

@ElbertePlinio

Deferred from the #371 review (UI + accessibility profile). Pre-existing, not a
regression from that PR, but it moved the affordance so it is worth recording.

1. FloatingMenu does no focus management

src/components/FloatingMenu.tsx has no autofocus, no focus trap, and no focus
restore. When a context menu opens, focus stays wherever it was — and in the
flat sidebar's project dropdown it is worse than that: the row that was
right-clicked is unmounted when the dropdown closes, so focus falls to
document.body. Operating the menu then requires tabbing from the document
start through a portal at the end of the DOM.

It is not a trap — the capture-phase window Escape listener dismisses from
anywhere — but it means a keyboard-only user cannot practically reach
rename / archive / remote host / move to group for a project in the flat list.
Shift+F10 and the Context Menu key do open it (Chromium fires contextmenu),
so the menu is reachable in principle and unusable in practice.

The same applies to every FloatingMenu caller — chat rows, project tree rows,
the new-chat menu — not just the project filter.

Fix shape: focus the first menu item on mount and restore focus to the
invoking element on close. That is a component-level change benefiting every
caller, which is why it is filed here rather than against any one surface.

2. Right-click on a dropdown option row is undiscoverable

The chips that #371 replaced carried
title="… — right-click for project options". DropdownOption has no title
support, so the hint was lost; the rows now advertise nothing.

Overloading the Dropdown's existing title prop is not the fix — it feeds the
trigger's aria-label (`${title}: ${currentLabel()}`), so a hint there
would produce a long, noisy accessible name. Wants either an optional per-row
title on DropdownOption, or a visible affordance decided by
design-director.

Validation

  • A keyboard test asserting focus lands inside the menu on open and returns to
    the invoker on close.
  • Extend tests/vrt/dropdown.spec.ts and the flat-list spec.

Refs #371

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-ideAgent IDE last-mileuxUX / interaction polish

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions