refactor(desktop): extract Workbar as a feature slice - #3444
Conversation
e42f8c2 to
13d9b75
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for extracting Workbar into a coherent feature slice. The production boundary looks clean: topology and persistence have one owner, Desktop IO stays behind the existing adapter seam, and the Terminal and side-chat lifecycle paths retain their stale-result and disposal fencing.
I found no blocking production issue. I left one non-blocking P2 inline because the narrow side-chat regression test currently does not resize the overlay it intends to exercise.
AI-assisted review disclosure: Codex coordinated independent architecture, lifecycle, and UI/test review passes against exact head 13d9b75cb3d0ed4d2bd44e4e4f3c16d837f70337; I reviewed the consolidated evidence and approve this exact head.
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for simplifying the Workbar into a real feature slice. The latest layout regression is fixed, the current-head test is green, and two independent passes found the extraction behavior-preserving across the major state, Side Chat, and Terminal boundaries. One recoverable Terminal cleanup edge remains in the extracted owner, noted inline.
AI-assisted review disclosure: OpenAI Codex coordinated two independent exact-head reviews. I verified the retained failure path, resolved prior thread, current-head CI, mergeability, and review state, and I made the final review decision.
ecbe4d5 to
08aa100
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for taking this on — 83 files and +5813/-2957 of pure relocation is a lot of careful work, and the slice boundary you landed on reads well.
Reviewed at exact head 08aa1007b842e207ebf8c647d5382944b70f3c99 against base f2722fd143a575bb18e54ba30985fca16e2a7e2c. No blocking findings.
For a refactor PR the only claim that matters is "this is just a move", so that is what we checked:
- Old paths are actually gone.
session-workbar-layout.tsis deleted,use-shell-layout.tsdrops 224 lines,app-shell.tsxdrops 596,app-shell-effects.tsdrops 60. No second Workbar authority survives alongside the new slice. - CSS relocation is cascade-equivalent. 1416 lines leave
chat-detail.css/quote-side-panel.cssand 1418 arrive instyles/workbar/*.css. The six newworkbar/*imports now sit beforechat-detail.cssrather than inside it, which would matter if the 26 lines left inchat-detail.cssshared selectors with the moved rules — they do not (what remains is.maka-turn[data-search-highlight]plus comments).side-chat.cssis imported immediately afterquote-side-panel.css, preserving its position relative to everything downstream. @xterm/xterm/css/xterm.cssmoved from two component-level TS imports to a single top-level@import. It is unlayered in both forms, so its precedence over thelayer(components)rules that style.xtermis unchanged. The only difference is that it is now always loaded instead of loaded on first terminal mount, which is not a behaviour change worth flagging in a desktop app.- Failure paths were preserved, not simplified away.
stopTerminalmarks a terminal stopped and releases ownership only inside.then(); a rejected stop keeps ownership so a later cleanup can retry. Terminal registration precedes tab commit, stale generations stop, and the Side Chat path keeps its dispose fence after eachawait.
Not merge-ready yet, for reasons outside the code: the branch is CONFLICTING against main, and there are no checks on this head at all — statusCheckRollup is empty. The existing APPROVED decision belongs to an older head; this repository does not dismiss stale reviews, so that badge is not evidence anyone has read the current code. Please rebase and let CI run; given the size of this diff, a conflict resolution is exactly where an accidental behaviour change would slip in, so we will re-check the moved logic on the new head rather than carry this result forward.
This review was AI-assisted. Findings were verified against the exact head listed above; any mistakes are ours to correct — please push back where we got it wrong.
1ee4ab5 to
d182a68
Compare
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
d182a68 to
624c4c6
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks — and thanks for the patience across four rounds. Re-reviewed at exact head 624c4c643f316aa05096c69aab19f3e7e50f6c04, freshly pulled. test is green and the PR is MERGEABLE / CLEAN.
Worth stating plainly: our earlier APPROVE sits on 13d9b75c, five heads back, so it didn't carry. This is a fresh pass over the current code.
Both of my earlier P2s are resolved:
- Workbar width variable —
--maka-session-workbar-widthnow lives on the shared parent.maka-workbar-layout-varsrather than a sibling, and the E2E sets 320px there and asserts the overlay actually renders at ~320. That closes it at the cascade rather than by adjusting the selector. - Terminal stop ownership —
stopTerminalonly releases ownership once stop succeeds, with in-flight de-duplication and afinallythat clears the stopping marker, so a failed stop leaves the resource for the next cleanup to retry. Releasing on the optimistic path was the actual bug; this fixes the ordering rather than adding a retry on top.
On the size. 6396 added lines invites the question of whether a refactor is carrying passengers, so I checked the split: roughly 1939 lines are tests, E2E and stories, plus ~128 of docs; the remainder is tool migration, service ports and the controller. The production entry consumes only the feature's public entry, with no Desktop global bridge reaching inside — which is the property that makes this a boundary extraction rather than a file shuffle. I found no unrelated product change riding along.
Behavioural equivalence is where I spent the most effort, since that's what a move of this size can quietly break. Session switching, StrictMode replay, late terminal starts, Side Chat collapse and source switching, and out-of-order browser selections all still have their guards and tests. Topology and resource lifetime moved out of AppShell without leaving a second reducer or a competing authority behind.
No findings. Approving.
This review was AI-assisted. Findings were verified against the exact head listed above; any mistakes are mine to correct — please push back where I got it wrong.
Summary
window.maka.host/commands/selectorssurface while preserving storage, IPC, layout, mounting, and cleanup behavior.Refs #3439
Verification
npm run lint— passed (2,513 files)npm run format:check— passed (1,565 files)npm run build— passednpm run typecheck— passednpm --workspace @maka/desktop test— passed (1,061 tests, 124 suites)npx knip --workspace apps/desktop— passednpx knip --workspace packages/ui— passednpm run astryx:surface-inventory— passed (199 files, 1 exclusion)npm --workspace @maka/desktop run build-storybook— passednpm --workspace @maka/desktop run smoke:storybook— passed (162 stories)npm --workspace @maka/desktop run e2e— passed (41 passed, 1 skipped)Review focus
AI use
Select exactly one:
Tool(s) and scope: Codex — architecture analysis, implementation, tests, latest-main replay, lifecycle race review, and pull request preparation. The human contributor reviewed the contribution and accepts responsibility for it.
All substantive commits include
Generated-by: Codex; retain the trailer in the final squash commit.Checklist
Does this PR entail a change in behavior?