Skip to content

fix(workspace-board): close the board when a right-sidebar tab is clicked - #30063

Merged
AmoabaKelvin merged 7 commits into
stablyai:mainfrom
alxojy:fix/workspace-board-close-on-right-sidebar-tab
Oct 24, 2026
Merged

AmoabaKelvin merged 7 commits into
stablyai:mainfrom
alxojy:fix/workspace-board-close-on-right-sidebar-tab

Conversation

@alxojy

@alxojy alxojy commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​78 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​77
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10

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-dismiss attribute. 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:

  • Close the board on tab click (this PR). It matches the existing behavior, where clicking to the right of the board already closes it. It's a small, contained change, and it works at any window width.
  • Shrink the board so it stops at the right sidebar's edge. Both stay visible, but on narrow windows the board's lanes get cramped, and the board's width and the outside-click bounds would both need to track the right sidebar's live width.

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:

Before (board stays open over the switched panel) After (board closes and Source Control is shown)
Before: board still covering the window after clicking Source Control After: board closed and Source Control panel visible

Testing

  • New e2e test tests/e2e/workspace-board-right-sidebar-tab-dismiss.spec.ts drives 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 on main (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, and pnpm 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

🤖 Generated with Claude Code

Maintainer changes

  • The e2e test now only runs on macOS. On Linux and Windows the tab strip sits below the titlebar, so the board covers it and the click can't reach it. That means the bug only happens on macOS, and the unguarded test would have failed in the Linux CI lane.
  • Because CI never runs that macOS-only test, I swapped the unit test of the exported predicate for one that goes through the hook itself. It clicks a tagged tab inside a portalled dropdown menu and expects the board to close. It runs on every platform and fails on main.
  • The e2e now checks that the Source Control panel is visible instead of reading the store, per tests/e2e/AGENTS.md. I also removed its screenshot calls.
  • The dismiss check had one caller, so I inlined it.

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 main 4c7991509f4c8427fd8f87b9c695ee119401665a. The four feature files are byte-identical to the independently reviewed candidate (41e36f3a300cb4f3a2097850a72c8aad655af300; LOW risk, no blockers).

  • Untouched main reproduced the visible failure twice before adopting the fix, using a real disposable Git project and actual rendered controls.
  • Fresh owner verification after integration: 54 tests across 8 suites, full renderer TypeScript, all seven changed-code quality gates, scoped anti-slop and formatting passed.
  • The actual hidden Electron regression test passed. Five Git workspace journeys and two folder-workspace journeys passed using clicks and Enter activation; the selected Source Control/Explorer panels and folder file were visibly rendered after the board closed. Screenshots were captured and inspected. All validation windows stayed hidden and unfocused, and owned processes were cleaned up.
  • Independent review additionally passed 55 repository tests across 9 suites and 17 external adversarial tests, including actual Radix overflow pointer/Enter activation, the Agent dashboard drawer, listener cleanup, StrictMode and containment/geometry boundaries.

Validation limits: the full E2E TypeScript project is not green (252 diagnostics, including missing @orca-cloud/relay-contract and pg; 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.

alxojy and others added 2 commits October 17, 2026 20:39
…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]>
@alxojy
alxojy marked this pull request as ready for review October 17, 2026 12:54
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Right-sidebar activity-bar buttons and overflow-menu items now include a workspace-board dismissal marker. The pointer handler detects marked targets and closes the board before checking keep-open targets. Unit and end-to-end tests cover marked-target dismissal, including a Source Control tab click.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to 8fff3

A sidebar tab can still switch panels behind the board while its filter menu is open. This narrow case should be fixed or accepted before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: closing the Workspace board when a right-sidebar tab is clicked.
Linked Issues check Passed The changes satisfy the coding requirement in issue #30064. Right-sidebar buttons and overflow items carry data-workspace-board-dismiss. useWorkspaceKanbanOutsideDismiss closes the board when a po…
Out of Scope Changes check Passed The changes stay within issue #30064. Production changes implement right-sidebar tab dismissal through the shared outside-dismiss handler. The unit and end-to-end tests verify this behavior. No unrela…
Description check Passed The description follows the repository template closely. It has the ELI5, What Changed (before/after and mechanism), Why (two alternatives compared), Linked Issue (Fixes #30064), Visual Proof (before …
Full details: Linked Issues check

Explanation

The changes satisfy the coding requirement in issue #30064. Right-sidebar buttons and overflow items carry data-workspace-board-dismiss. useWorkspaceKanbanOutsideDismiss closes the board when a pointerdown occurs on a marked control or its descendant. The unit test covers a marked control in a portalled menu. The macOS end-to-end test verifies that Source Control becomes visible and the board closes. The shared handler also covers the Agent dashboard drawer described in the issue.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #30064. Production changes implement right-sidebar tab dismissal through the shared outside-dismiss handler. The unit and end-to-end tests verify this behavior. No unrelated product behavior or unrelated files are identified.

Full details: Description check

Explanation

The description follows the repository template closely. It has the ELI5, What Changed (before/after and mechanism), Why (two alternatives compared), Linked Issue (Fixes #30064), Visual Proof (before and after media), Testing (new e2e test, unit test, and suite runs with a manual macOS check), AI Disclosure, the upstream boundary checkbox, Notes, and Checklist. The LoC block is automation output. The maintainer sections add a verification trail and CI results. Two gaps remain. The Testing section does not state which platforms were tested beyond macOS, and the Linux and Windows impact is only asserted in Notes. The lint, typecheck, test, and build checkbox is unchecked, although the maintainer notes say CI passed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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.
@AmoabaKelvin
AmoabaKelvin self-requested a review October 23, 2026 16:04

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
📥 Commits

Reviewing files that changed from the base of the PR and between a3fe11e and 8fff38d.

📒 Files selected for processing: 3
  • src/renderer/src/components/sidebar/use-workspace-kanban-outside-dismiss.test.ts
  • src/renderer/src/components/sidebar/use-workspace-kanban-outside-dismiss.ts
  • tests/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]')) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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]>
@AmoabaKelvin
AmoabaKelvin merged commit de37a4c into stablyai:main Oct 24, 2026
39 checks passed
@alxojy
alxojy deleted the fix/workspace-board-close-on-right-sidebar-tab branch October 24, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Right-sidebar tab buttons do nothing while the Workspace board is open

3 participants