fix(sidebar): include disclosure rows in keyboard navigation
Keyboard-only sidebar navigation now includes Done and Show more disclosure rows. Up/Down, Tab and Shift-Tab can focus each disclosure; Return and Space activate it through the shared SidebarFoldAction; Left/Right close or open it. Focus is kept separate from workspace selection and is cleared when a row disappears.
This is the keyboard navigation slice for the audit at e7ab659e6d23. It builds on #27671's SidebarFoldAction and deliberately leaves AXPress wiring and callback ownership to that PR.
Validation
python3 scripts/cmux-next/prepush-gate.py --commits a954126e7a1704be4d1c9d60c39ace1bc370e840..HEAD(running on the fleet lane VM; result to be recorded)git diff --check- Added
SidebarFoldKeyboardTestscovering arrow/Tab reachability, Return/Space activation, directional open/close, selection preservation and stale focus cleanup. - Native Swift tests require the fleet route; no local build was run.
- No screenshot is included because this is keyboard behavior and focus-state wiring; the existing disclosure row treatment remains unchanged apart from its keyboard focus ring.
Follow-up fixes (review findings)
- A reload that removes the focused disclosure clears its focus and ring, so the row coming back (filter cleared) has neither, and Return does nothing until the keyboard reaches it again.
- A click on Done or Show more moves keyboard focus to the clicked disclosure without a ring (as a click on a group header does), so a ring left on another disclosure can't take the next Space or Return.
- Red/green:
cmux-ci run --class light --script scripts/ci/package-test-lane.sh --arg=suite --arg=Packages/macOS/CmuxNext --arg=CmuxNextAppTests.SidebarFoldKeyboardTests,CmuxNextAppTests.SidebarFoldAccessibilityTests --env CMUX_TEST_REQUIRE_GUI=1on the fleet: red at 83c8d98ecdc (new test only:clickingAnotherFoldMovesFocusAndItsRingAwayfails, focus and ring stay on Show more and Space toggles it); green at b4a7689370c and at the final head 3f6aa3302b9f382803aec1a5851cd3831d9bce0a (after merging base for the conflict and base's CloudAppLinkOwnerAnswerTests compile fix): SidebarFoldKeyboardTests 5/5, SidebarFoldAccessibilityTests 3/3. - A click on a tab row (or any row but a group header or disclosure: section, empty section, empty group, folder, block, status) takes keyboard focus and its ring off a focused disclosure or header, as workspace and item clicks already did, so Return, Space and the arrows can't act on the old disclosure. Red at 6e637c452b0 (new
clickingATabRowTakesFocusOffTheFold: focus and ring stay on Show more after the tab click, and Return/Space toggle it); green at 30360ae080c4cf8433cc4f633188d058bbb053ff: SidebarFoldKeyboardTests 6/6, SidebarFoldAccessibilityTests 3/3.
Design spec
Fits sidebar.md (leo-workspace design/sidebar.md): the Done and Show more fold rows keep their look; they only join the keyboard walk and draw the sidebar's existing keyboard focus ring, as group headers already do. No spec change.
No capture: keyboard focus and activation behaviour only; the fold rows look the same except for the existing focus ring, and the tests above check the ring.
Changelog
Changed: Keyboard-only users can reach, focus and open or close Done and Show more sidebar disclosure rows.
risk: normal
Parent: #27671
agent-identity footer --repo manaflow-ai/cmux
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Makes the sidebar's Done and Show more disclosure rows navigable by keyboard and VoiceOver; they were previously click-only. Keyboard, accessibility, and mouse activation now use the same fold toggle action.
- Up/Down, Tab, and Shift-Tab move focus to a disclosure; Return and Space toggle it; Left and Right close or open it; VoiceOver press does the same.
- A mouse click moves focus to the clicked disclosure without a ring, so the next Space or Return acts on that row; the ring shows only when keyboard focus moved there.
- A click anywhere but on a group header or disclosure clears fold focus, so Return or Space after it never toggles the fold the keyboard had focused.
- Focus never changes workspace selection and clears when a disclosure disappears or its view is recycled; a hidden or stale accessibility element cannot toggle its fold.
- Adds
SidebarFoldKeyboardTestsandSidebarFoldAccessibilityTestscovering reachability, activation, open/close, selection preservation, and stale focus cleanup.