#4145 · Native titlebar clearance investigation

Bug · Priority Low · Effort Low · desktop, ui · 2026-09-23

Issue · base 94d77da09568d7f0f7cdb23b84686e743acfb0ad

PARTIALLY REPRODUCED · Root-cause confidence: low

TL;DR

The trusted source puts the sidebar control at 84 px and aligns subsequent collapsed content at 120 px. Both clean checkouts confirm these numbers. Neither the source probe nor the existing passing geometry test establishes whether native macOS controls visually overlap the sidebar button. Two isolated native launch attempts produced no observable Electron window or listening app server during this investigation. No screenshot or confirmed visual reproduction is available; no fix PR is justified.

Claims vs findings

ClaimFinding
Current horizontal geometry is 84 / 120 pxVerified in both clean checkouts by the saved source probe.
Native buttons obstruct the toggle in both sidebar statesUnverified: neither native launch reached an observable window.
Increasing clearance resolves the defectUnverified: native bounds and both layouts must first be measured.

Environment

Public repository get-bb/bb; macOS 26.6.2 (25G83), Node 22.22.3, repository-pinned pnpm 9.15.0 through an isolated Corepack launcher, Electron 44.3.0. Two detached clean worktrees named base and verify at the same commit. Fresh separate Electron profiles. The source launcher selected base ports 12265 / 20265 / 28265 and verify ports 16115 / 24115 / 32115, with unique checkout-derived dev data directories. No production instance or provider was used.

Minimal reproduction

  1. Check out the recorded commit into two separate clean worktrees.
  2. Run pnpm install --frozen-lockfile --prefer-offline then pnpm exec turbo run build.
  3. Run the downloaded probe.mjs with node probe.mjs /path/to/checkout.
  4. Run pnpm exec turbo run test --force --filter=@bb/app -- bb-desktop.test.ts.
  5. For native verification, use a fresh BB_DESKTOP_USER_DATA_DIR and run pnpm exec turbo run dev --filter=@bb/desktop. Inspect the top-left controls in each sidebar state once a window appears.

Expected for a confirmed visual reproduction: a native window showing intersecting control bounds. Actual here: source geometry is confirmed, but native overlap remains untested. Probe output (identical in both checkouts):

{
  "toggleLeft": 84,
  "collapsedContentStart": 120,
  "nativeInset": 18,
  "relativeAlignment": "PASS",
  "nativeObstruction": "UNVERIFIED"
}

Existing geometry suite: Test Files 1 passed (1); Tests 3 passed (3). This is a consistency test, not a native clearance regression test.

import { readFileSync } from 'node:fs';
import assert from 'node:assert/strict';
import { resolve } from 'node:path';
const root = process.argv[2];
const source = readFileSync(resolve(root, 'apps/app/src/lib/bb-desktop.ts'), 'utf8');
const offset = Number(source.match(/MACOS_TRAFFIC_LIGHT_RESERVE_OFFSET_CLASS = "left-\[(\d+)px\]"/)[1]);
const reserve = Number(source.match(/MACOS_COLLAPSED_TOP_LEFT_RESERVE_CLASS = "pl-\[(\d+)px\]"/)[1]);
const native = readFileSync(resolve(root, 'apps/desktop/src/desktop-window-factory.ts'), 'utf8');
const inset = Number(native.match(/MACOS_TRAFFIC_LIGHT_DIAGONAL_INSET = (\d+)/)[1]);
assert.equal(offset + 28 + 8, 16 + reserve);
console.log(JSON.stringify({toggleLeft:offset, collapsedContentStart:16+reserve, nativeInset:inset, relativeAlignment:'PASS', nativeObstruction:'UNVERIFIED'}, null, 2));

Native launch observation: 0 observable windows for each test Electron process; no listener on either selected server or daemon port. No visual evidence is fabricated or substituted. Native startup failure cause was not determined.

Root cause

The alleged obstruction is not established. The likely area to inspect is the boundary between fixed DOM offsets and platform-native window controls. Shared geometry sets 84 px left and 104 px reserve (plus a 16 px base inset). The geometry test checks only the relation 84 + 28 + 8 = 16 + 104. It does not measure native button bounds. The native window factory positions the traffic-light cluster at an 18 px inset. Its width cannot be derived from that inset alone. Sidebar header-slot geometry separately embeds the same 84 px origin, so any eventual geometry change needs a consistency review there too.

Proposed next test

On a functioning isolated native launch, capture the actual window and measure the right edge of the native cluster and left edge of the toggle in expanded and collapsed layouts. Derive a clearance assertion from those measurements, demonstrate failure before editing production code, and verify the header slot and secondary content afterward. No numeric replacement is justified by the evidence collected here.

Verification

The same agent repeated the investigation in a second clean checkout at the identical trusted commit. Frozen install and full build succeeded (60 tasks). The source probe returned identical output. The focused suite was rerun with --force: 3 tests passed, no cache reuse. A second launch used a separate Electron profile and distinct generated ports and likewise showed zero observable windows and no server listener. This supports the limited source findings, not a visual defect claim. The final report therefore retains PARTIALLY REPRODUCED and low root-cause confidence.

Related issues and PRs

Issue timeline and open-PR search for 4145 returned no linked open pull request at investigation time. No other issue was established as a duplicate.

Appendix

Base probe output · Second probe output · Build and test evidence

The machine's default pnpm launcher initially failed with MODULE_NOT_FOUND. An isolated Corepack launcher resolved that tooling failure; final builds succeeded. Source and issue data were treated separately: proposed issue actions were not executed. No production code changed, and no fix branch was pushed. A real native screenshot could not be obtained, which is an explicit limitation of this visual-bug report.