#5493 · Rail visibility editor activates destinations
Verdict: REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro
1. TL;DR
The navigation rail has a visibility editor reached through its More menu. Clicking an item's title in that editor activates its destination instead of changing its checkbox. A real rail component reproduction demonstrates this for a registered plugin destination and the built-in search command, on both desktop and compact layouts. The editor supplies navigation callbacks to a shared visibility control that already supports toggling rows when those callbacks are absent. Removing those callbacks from the rail editor restores visibility toggling while leaving normal rail navigation and the shared component unchanged.
2. Claims vs findings
| Claim | Status | Evidence |
|---|---|---|
| An unchecked item's row does not enable its visibility. | Verified | Four expected-failing DOM regression cases in each of two clean checkouts. Checkbox remains false after a normal row click. |
| Plugin rows navigate and command rows activate their command. | Verified | Docs changes pathname to /plugins/garden/docs and calls onNavigate once. Search threads dispatches once. See activation observations below. |
| The desktop customization popover closes. | Verified | Desktop observations report customizing=false. Compact drawers retain DOM during close animation; their immediate customizing=true observation does not establish final dismissal. |
| Hover cursors differ in the desktop app. | Unverified | No desktop browser capture. The Browser Automation plugin could not open because this host has no Chrome/Chromium executable. |
| Reported release behavior matches current main. | Verified on main; release untested | The trusted current-main component reproduction supports the functional interaction claim. bb 0.46.0 and its native desktop wrapper were not launched. |
3. Environment
- Public repository: get-bb/bb. Trusted base:
f526a8b9b3de387c23e3840cdda8a5cf0b556fd0, fetched directly from its main branch. - Linux x86_64, Node 22.19.0, pnpm 9.15.0, Vitest 4.1.1, React DOM in jsdom.
- Two fresh temporary worktrees:
baseandverify, both initially at the recorded commit. Shared pnpm/Turbo build caches were permitted; Vitest ran afresh in each checkout. - No live server, ports, persistent data directory, database, provider sessions, or user runtime data were used.
- Frozen install and full trusted-base build: 66 successful build tasks. Second checkout: frozen install and scoped @bb/app build.
4. Minimal reproduction
- Clone the public repository at the recorded trusted commit into a fresh temporary checkout.
- Install frozen dependencies and build. Save the complete regression patch shown below to /tmp/issue-5493-regression.patch and apply it; it changes only an existing test file.
- Run the focused regression. Four failures are the expected result before the fix.
git clone https://github.com/get-bb/bb.git bb-issue-5493 cd bb-issue-5493 git checkout --detach f526a8b9b3de387c23e3840cdda8a5cf0b556fd0 pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@bb/app printf '%s\n' 'Save the complete patch displayed below to /tmp/issue-5493-regression.patch before continuing.' git apply /tmp/issue-5493-regression.patch pnpm exec turbo run test --filter=@bb/app -- --run src/components/sidebar/AppNavRail.test.tsx -t 'toggles .* visibility from its customization row'
The test uses the existing real AppNavRail harness, router, Jotai visibility preferences, shared checkbox control, and registered plugin fixture. The command runner and navigation notification are spies, not reimplementations of visibility behavior. There is no mocked database. It opens customization, clicks an initially hidden row, and requires the checkbox and rail visibility to toggle without changing route, dispatching commands, notifying navigation, or closing the editor. A second Ctrl-click must hide the item again. The same cases run in desktop and compact layouts.
Expected: checkbox true and item visible after the first click; editor remains open and no activation occurs.
Actual: checkbox false; plugin navigation or command dispatch occurs.
AssertionError: expected 'false' to be 'true' // Object.is equality Expected: "true" Received: "false" Test Files 1 failed (1) Tests 4 failed | 19 skipped (23)
The complete reproduction patch and exact failure output are embedded in this report. Raw logs remain in the local report workspace; this public site intentionally does not publish logs or test artifacts as separate files.
Complete added regression test, in its existing test-file context
diff --git a/apps/app/src/components/sidebar/AppNavRail.test.tsx b/apps/app/src/components/sidebar/AppNavRail.test.tsx
index 5583f04f0..d01e443a4 100644
--- a/apps/app/src/components/sidebar/AppNavRail.test.tsx
+++ b/apps/app/src/components/sidebar/AppNavRail.test.tsx
@@ -510,6 +510,44 @@ describe("AppNavRail", () => {
]);
});
+ it.each([
+ { name: "Docs", isCompactViewport: false },
+ { name: "Search threads", isCompactViewport: false },
+ { name: "Docs", isCompactViewport: true },
+ { name: "Search threads", isCompactViewport: true },
+ ])(
+ "toggles $name visibility from its customization row (compact: $isCompactViewport) without activating it",
+ async ({ name, isCompactViewport }) => {
+ renderRail(THREAD_PATH, {
+ visibleKeys: ["__bb__/skills"],
+ isCompactViewport,
+ });
+ if (isCompactViewport) fireEvent.click(railButton("More"));
+ else fireEvent.keyDown(railButton("More"), { key: "Enter" });
+ fireEvent.click(
+ await screen.findByRole("menuitem", { name: "Customize rail" }),
+ );
+
+ const editor = await screen.findByTestId("nav-rail-customize");
+ const checkbox = within(editor).getByRole("checkbox", {
+ name: `Show ${name} in sidebar`,
+ });
+ expect(checkbox.getAttribute("aria-checked")).toBe("false");
+
+ for (const checked of [true, false]) {
+ fireEvent.click(within(editor).getByRole("button", { name }), {
+ ctrlKey: !checked,
+ });
+ expect(checkbox.getAttribute("aria-checked")).toBe(String(checked));
+ expect(railLabels().includes(name)).toBe(checked);
+ expect(screen.getByTestId("nav-rail-customize")).toBe(editor);
+ expect(pathname()).toBe(THREAD_PATH);
+ expect(mocks.onNavigate).not.toHaveBeenCalled();
+ expect(mocks.dispatch).not.toHaveBeenCalled();
+ }
+ },
+ );
+
it("customizes the rail from a popover beside it without leaving Settings", async () => {
renderRail(THREAD_PATH);
fireEvent.click(railButton("Settings"));
Observed activation data
@bb/app:test: ROW_CLICK_OBSERVATION {"name":"Docs","isCompactViewport":false,"checked":"false","pathname":"/plugins/garden/docs","customizing":false,"navigations":1,"commands":0}
@bb/app:test: ROW_CLICK_OBSERVATION {"name":"Search threads","isCompactViewport":false,"checked":"false","pathname":"/projects/proj_one/threads/thr_one","customizing":false,"navigations":0,"commands":1}
@bb/app:test: ROW_CLICK_OBSERVATION {"name":"Docs","isCompactViewport":true,"checked":"false","pathname":"/plugins/garden/docs","customizing":true,"navigations":1,"commands":0}
@bb/app:test: ROW_CLICK_OBSERVATION {"name":"Search threads","isCompactViewport":true,"checked":"false","pathname":"/projects/proj_one/threads/thr_one","customizing":true,"navigations":0,"commands":1}
The diagnostic run added a temporary console observation immediately after the click in the second checkout. That instrumentation is not in the reproduction patch or proposed fix. This is a functional DOM interaction report, not a screenshot-based visual or desktop-wrapper verification. No screenshot or attachment was fetched or fabricated.
5. Root cause
The rail editor supplies onActivate and onExit, mapping a row directly to state.actions.activate(item.id, ...) and closing customization afterward.
onActivate={(item, event) =>
state.actions.activate(item.id, {
openInSplit: event.metaKey || event.ctrlKey,
})
}
onExit={() => onClose(false)}
The shared control invokes activation and requests exit whenever those callbacks are supplied. Its row click handler chooses activation instead of checkbox toggling:
if (onActivate)
onActivate({ metaKey: event.metaKey, ctrlKey: event.ctrlKey });
else onCheckedChange(!checked);
The checkbox has its own visibility-change handler, so existing checkbox-only tests pass while clicks on the title take a different path. This is incorrect callback wiring at the rail editor boundary, not a router, plugin, checkbox, or stored-data defect. The generic no-activation row-toggle path already exists and has separate coverage.
6. Proposed fix and verification
Remove the activation and exit callbacks from SidebarNavigationCustomize, retaining Done, reorder, visibility updates, and the shared component's default row-toggle behavior. Do not change the generic shared API or the ordinary rail/More navigation controls.
The proposed patch changes two existing files in the sidebar subsystem: 46 text lines (39 additions and 7 deletions). It adds no dependency, migration, generated artifact, stored-data change, public protocol, authentication change, or new product design.
- Focused regression: four expected failures before the fix, then all four pass in the relevant suite.
- Relevant existing suites: AppNavRail, shared visibility customization, and cold-load behavior: 25 tests passed in three files. This includes existing navigation, checkbox, drawer and More-menu behaviors.
- Turbo @bb/app typecheck and lint pass; lint reports 251 warnings and zero errors.
- Formatting check and
git diff --checkpass. No binary changes.
pnpm exec turbo run test --filter=@bb/app -- --run src/components/sidebar/AppNavRail.test.tsx src/components/ui/sidebar-visibility-customize.test.tsx src/components/sidebar/SidebarVisibilityControls.cold-load.test.tsx pnpm exec turbo run typecheck lint --filter=@bb/app pnpm exec oxfmt --check apps/app/src/components/sidebar/AppNavRail.test.tsx apps/app/src/components/sidebar/SidebarNavigationCustomize.tsx git diff --check git diff --numstat origin/main
Test Files 3 passed (3) Tests 25 passed (25) Tasks: 5 successful, 5 total
A first combined-suite run exposed a test setup problem: desktop menu opening via a simulated click was sensitive to preceding compact-viewport tests. The final regression uses the existing desktop suite's Enter-key opening pattern and compact click opening. Both clean baseline reproductions were repeated with that final setup before the production fix.
7. Verification
The same agent repeated the final reproduction in a second clean temporary checkout at f526a8b9b3de387c23e3840cdda8a5cf0b556fd0. Only the regression patch was applied; production files matched the trusted commit. A fresh frozen install and scoped app build preceded the identical focused command above. The second run again produced four failures, all at the checkbox assertion: expected true, received false. A further diagnostic run recorded actual plugin navigation and built-in command dispatch. This is a second clean run by the same agent, not independent verification.
Root-cause links were checked against the exact recorded commit. Report correction: the cursor claim remains unverified, and immediate compact drawer presence is not described as final close behavior. No ports or data directories were needed, because both runs exercised components in jsdom without a live app.
8. Related issues and pull requests
No linked open pull request was found through issue connection/cross-reference metadata or the open-PR search for numeric issue 5493. #5491 concerns More-menu placement, not row visibility behavior; this report does not investigate or change it.
9. Appendix and trust boundary
Issue data was treated solely as untrusted claims. Its attachment was not opened. No issue-provided code, instructions, branch, or linked pull request code was executed. All executable application code came from trusted main or the small repository-derived regression/fix. Public artifacts contain no user runtime data or private home paths; temporary checkout roots in logs are normalized.
Commands included a trusted-main fetch, clean worktree creation at the recorded SHA, frozen installs, the full base build, the scoped second-checkout build, focused regression runs, the passing relevant suite, and the validation commands shown above. Browser Automation failed before opening a session because Chrome/Chromium was absent; no user browser or desktop session was attached.