Close review round 1 on the chat-switcher column

Fixkamo-internal
Shipped
August 26, 2026 at 8:52 AM UTC
Author
kamo
Commit
1db50f2

- ChatSwitcherColumn: move the collapse preference's PUT out of the setCollapsed updater into the click handler itself. The updater was impure (it fired a fetch as a side effect), which React StrictMode double-invokes to check for exactly that, so every toggle sent two identical PUTs in dev; a synchronous throw from fetch could also have aborted the state update. `next` is now computed from `collapsed` and the PUT fires once, outside the updater. - ChatSwitcherColumn: the expanded region is now `role="region"` (a plain div has no ARIA role, so its aria-label was invisible to assistive tech), and both toggle buttons carry `aria-expanded`. - ChatSwitcherColumn: INITIAL_BUCKET is now `Partial<Record<string, Bucket>>` rather than a total `Record`, so an unmapped toolId is a type error to overlook instead of a silently-typed `Bucket`. - ToolWindowShell: the content-area flexDirection is now the explicit `switcher ? 'row' : 'column'` rather than an unconditional 'row' whose correctness depended on the children wrapper div stretching to fill either layout the same way. - New ToolWindowShell.test.tsx: the shell was only ever exercised through ToolDock.test.tsx's mock of it, so its own layout code (the flip above, and its `{isMax && switcher}` gate) had never actually run in a test. - New registry/tools.test.ts: asserts the flag against the REAL toolPlatform map, exactly the five conversation tools. ToolDock.test.tsx deliberately pins the AND-gate mechanism against a synthetic map, so nothing else would catch chatSwitcher being dropped from one of the five (or added to a sixth) by accident.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing