Repository navigation
fix(workspace-board): close the board when a right-sidebar tab is clicked - #30063
AmoabaKelvin merged 7 commits into
Conversation
…cked The board sheet can cover the right sidebar, but the tab buttons sit in the titlebar above it, so clicks switched the panel invisibly behind the board. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… tab Co-Authored-By: Claude Opus 5.5 <[email protected]>
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to
|
Linux and Windows draw the tab strip under the board, so the e2e only reproduces on macOS; the hook test keeps the rule covered in CI.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3e4a3c28-3f39-4636-9ae7-e3d24837c639
📒 Files selected for processing: 3
src/renderer/src/components/sidebar/use-workspace-kanban-outside-dismiss.test.tssrc/renderer/src/components/sidebar/use-workspace-kanban-outside-dismiss.tstests/e2e/workspace-board-right-sidebar-tab-dismiss.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
| return | ||
| } | ||
| // Why: titlebar tabs switch content the board covers, so it must close to show it. | ||
| if (eventTargetElement(event.target)?.closest('[data-workspace-board-dismiss]')) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
-
🏁 Script executed:
#!/bin/bash # Inspect the menu state passed to the hook and the controls available while it is open. rg -n -C 6 'useWorkspaceKanbanOutsideDismiss\s*\(|preserveOpenForMenu:|menuOpen|data-workspace-board-dismiss' \ src/renderer/src/components/sidebar \ src/renderer/src/components/dashboard \ src/renderer/src/components/right-sidebar
Repository: stablyai/orca
Length of output: 41823
🏁 Script executed:
set -o pipefail printf '%s\n' '--- outside-dismiss hook ---' nl -ba src/renderer/src/components/sidebar/use-workspace-kanban-outside-dismiss.ts | sed -n '1,110p' printf '%s\n' '--- workspace drawer menu bindings ---' rg -n -C 12 -F -e 'preserveOpenForMenu' -e 'onMenuOpenChange' -e 'DropdownMenu' -e 'data-workspace-board-dismiss' \ src/renderer/src/components/sidebar/WorkspaceKanbanDrawer.tsx \ src/renderer/src/components/sidebar/WorkspaceKanbanSheet.tsx \ src/renderer/src/components/sidebar/WorkspaceKanbanDrawerView.tsx \ src/renderer/src/components/sidebar/WorkspaceKanban* printf '%s\n' '--- dashboard drawer and menu bindings ---' nl -ba src/renderer/src/components/dashboard/AgentDashboardDrawer.tsx | sed -n '85,230p' printf '%s\n' '--- right-sidebar controls and containers ---' rg -n -C 10 -F -e 'data-workspace-board-dismiss' -e 'ActivityBarButtons' -e 'onSelect' \ src/renderer/src/components/right-sidebar
Repository: stablyai/orca
Length of output: 45667
🏁 Script executed:
set -o pipefail printf '%s\n' '--- preserveOpenForMenu callers ---' rg -n -C 8 -F 'preserveOpenForMenu' src/renderer/src --glob '*.tsx' --glob '*.ts' printf '%s\n' '--- board menu callback wiring ---' rg -n -C 14 -F -e 'onFilterMenuOpenChange' -e 'onMenuOpenChange' -e 'WorkspaceKanbanSettingsMenu' -e 'DropdownMenu modal=' src/renderer/src/components/sidebar/WorkspaceKanbanDrawerView.tsx src/renderer/src/components/sidebar/WorkspaceKanbanSettingsMenu.tsx src/renderer/src/components/sidebar printf '%s\n' '--- dashboard menu and sheet interaction ---' nl -ba src/renderer/src/components/dashboard/AgentDashboardDrawer.tsx | sed -n '95,190p' printf '%s\n' '--- right-sidebar root/tab interaction ---' rg -n -C 12 -F -e 'ActivityBarButtons' -e 'More sidebar tabs' -e 'DropdownMenu modal=' src/renderer/src/components/right-sidebar src/renderer/src/components | head -n 500
Repository: stablyai/orca
Length of output: 41938
🏁 Script executed:
set -o pipefail printf '%s\n' '--- board filter/settings menu ---' rg -n -C 18 -F -e 'function SidebarFilter' -e 'const SidebarFilter' -e 'DropdownMenu modal=' -e 'onOpenChange' \ src/renderer/src/components/sidebar/SidebarFilter.tsx \ src/renderer/src/components/sidebar/WorkspaceKanbanSettingsMenu.tsx \ src/renderer/src/components/sidebar/WorkspaceKanbanDrawerHeader.tsx \ src/renderer/src/components/sidebar printf '%s\n' '--- board sheet render ---' nl -ba src/renderer/src/components/sidebar/WorkspaceKanbanSheet.tsx | sed -n '30,150p' printf '%s\n' '--- right-sidebar activity-bar menu ---' nl -ba src/renderer/src/components/right-sidebar/activity-bar-buttons.tsx | sed -n '1,190p'
Repository: stablyai/orca
Length of output: 45659
Handle marked sidebar tabs before preserving an open menu.
SidebarFilter uses a non-modal menu, so a right-sidebar tab can receive pointerdown while the menu is open. The current early return skips [data-workspace-board-dismiss], leaving the board open after the tab switches panels.
Suggested fix
-
--- "a/src/renderer/src/components/sidebar/use-workspace-kanban-outside-dismiss.ts" +++ "b/src/renderer/src/components/sidebar/use-workspace-kanban-outside-dismiss.ts" @@ -45,17 +45,20 @@ const handlePointerDown = (event: PointerEvent): void => { const content = boardRef.current?.closest<HTMLElement>('[data-slot="sheet-content"]') - if (!content || preserveOpenForMenu) { + if (!content) { return } if (event.target instanceof Node && content.contains(event.target)) { return } // Why: titlebar tabs switch content the board covers, so it must close to show it. if (eventTargetElement(event.target)?.closest('[data-workspace-board-dismiss]')) { onOpenChange(false) return } + if (preserveOpenForMenu) { + return + } if (isWorkspaceBoardKeepOpenTarget(event.target)) { return }
Dismiss the board when a right-sidebar tab is activated, including keyboard clicks and selections while a board menu is open. Preserve ordinary portal and outside-pointer guards. Adapt the original contributor fix to the current shared dismissal handler and replace cast-only DOM fixtures with real hook coverage. Co-authored-by: Kelvin Amoaba <[email protected]>
Retain the independently reviewed renderer changes and original contributor history. Co-authored-by: alxojy <[email protected]> Co-authored-by: Kelvin Amoaba <[email protected]>
ELI5
When the Workspace board is open, clicking the right-sidebar tab buttons in the top bar (Files, Search, Source Control, Checks) seemed to do nothing. They did switch the sidebar, but the switch happened behind the board, where you can't see it. Now clicking one of those tabs closes the board so you see the panel you picked.
What Changed
Before: On a narrow window, or with the left sidebar closed, the Workspace board covers the whole window, right sidebar included. The tab buttons sit in the top bar, above the board, so clicks reach them. The panel changes behind the board and the board stays open, so the buttons look broken.
After: Clicking a right-sidebar tab, whether in the top strip, the side activity bar or the "More sidebar tabs" overflow menu, closes the board and shows the chosen panel.
Mechanism: The tab buttons and overflow menu items now carry a
data-workspace-board-dismissattribute. The board's shared outside-click handler (useWorkspaceKanbanOutsideDismiss) closes the board when a pointerdown lands inside an element with that attribute. Before this, it only closed on clicks to the right of the board and level with it, which a click in the top bar never is. The Agent dashboard drawer uses the same handler and positions itself the same way, so it gets the same fix.Why
I considered two approaches:
Linked Issue
Fixes #30064
Visual Proof
Before (release build v1.4.229): with the board open, clicking the top-bar tabs does nothing visible. Closing the board shows that the panel had switched behind it.
before-release-build.mp4
Before vs after (this branch, from the new e2e test at a 1000px-wide window): after clicking Source Control with the board open:
Testing
New e2e test
tests/e2e/workspace-board-right-sidebar-tab-dismiss.spec.tsdrives the real Electron app in the background: it sets a 1000px window, opens the right sidebar and the board, clicks the Source Control tab, and asserts the board closes and the tab switches. It fails onmain(the board stays open) and passes on this branch.Added a unit test for the new dismiss predicate (real DOM via happy-dom): a click inside a tagged tab dismisses the board, and generic content does not.
Ran the right-sidebar, dashboard,
WorkspaceKanban*and outside-dismiss suites (497 tests pass),pnpm tc:web, andpnpm run check:code-quality:changed.I manually tested these changes locally (bug reproduced in the release build; fix verified in the real app via the e2e run above, macOS)
Automated tests added/updated, or explained why not below
AI Disclosure
Diagnosed and implemented with Claude Code (Claude Opus 5.5), then reviewed by me.
Review
Agent skill upstream boundary
Notes
Renderer-only UI change. No platform-specific code, no IPC or wire changes, nothing that differs between SSH and local, and no mobile impact.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code
Maintainer changes
tests/e2e/AGENTS.md. I also removed its screenshot calls.No visible change beyond the contributor's fix. I checked on macOS in a hidden e2e build: the Workspace board and the Agent dashboard drawer both stay open on main when Source Control is clicked, and both close on this branch.
Maintainer verification — 2026-10-23
The final implementation also closes the board on keyboard-generated activation of a marked tab. Explicit tab activation bypasses the board-menu keep-open guard; board content and ordinary portal interactions keep their existing behavior. Both document listeners are removed on cleanup. The original Electron regression test remains unchanged.
Original implementation and E2E contribution: alxojy (alex). The existing maintainer follow-ups by Kelvin Amoaba and the contributor's complete commit history are retained. Both are explicitly credited in the integration commit.
Validated head:
c279ec33ff89d3c916fe995510824e473ece7d99, incorporating main4c7991509f4c8427fd8f87b9c695ee119401665a. The four feature files are byte-identical to the independently reviewed candidate (41e36f3a300cb4f3a2097850a72c8aad655af300; LOW risk, no blockers).Validation limits: the full E2E TypeScript project is not green (252 diagnostics, including missing
@orca-cloud/relay-contractandpg; none names the four changed files). A pristine-main diagnostic comparison was not performed, so these are not claimed to be proven baseline-only. Actual Electron UI validation was on macOS with the freshly built main/preload and official development renderer; Linux/Windows, a live SSH peer, mobile hardware and an actual Electron overflow-menu journey were not exercised. The real Radix overflow path was covered independently in DOM tests. No protocol, persistence or platform-specific API changed.The original visual attachments above are preserved. Fresh captures are retained in the maintainer's evidence bundle; uploading new attachments was unavailable because the GitHub browser session token was absent.
Final CI — 2026-10-23
All four exact-head workflows completed successfully, including the required aggregate and all follow-on jobs: PR Checks, Headless Node server, PR test LoC, and cleanup. No CI retry or follow-up code change was needed. The macOS-only regression test remains covered by the passing local real-Electron run; the Linux changed-spec lane skips that test as designed. The local full E2E TypeScript limitation described above remains explicit.