fix(app): restore collapsing a checkout on the home session list - #1711
fix(app): restore collapsing a checkout on the home session list#1711chphch wants to merge 1 commit into
Conversation
Proof — each checkout folds on its ownOne project,
Captured against a standalone What was read, and what could have faked a passRow counts are Frame 4 is byte-identical to frame 3, which is what persistence looks like — so it was checked separately rather than assumed: a nonce stamped on After frame 3 the persisted the bare project id for the main checkout, and that same id joined by a NUL to the A separate run on single-checkout projects covers the rest: folding one project leaves the other alone, and pressing Coverage is Expo web. |
The session list could be folded per project until the home list was rebuilt around projects and worktrees, which replaced the project header that carried the chevron. The `collapsedProjects` local setting outlived it and is still in the schema, so the state people already had is intact — nothing reads it any more. This puts the toggle back on the header the rebuild left us. Because that header is now per checkout, a tap folds exactly the card it sits on: a project with three worktrees can hide the two it is not working in and keep the third open. The primary checkout keys on the project id, the key the old code used, so an existing collapsed project stays collapsed. The `+` button stays its own pressable next to the toggle, so starting a session in a project never folds it. A collapsed header shows how many sessions it is hiding. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
1cdb4a2 to
fed8e97
Compare
|
@bra1nDump — this restores something What went awayBefore that commit the home list could be folded per project. Two things point the other way. #1706 (still open, not mine) asks for exactly this affordance, filed two days before the removal. And ProofOne project, The key is Rebased onto current |

The home session list could be folded per project until
c63c80ffrebuilt it around projects and worktrees: that commit replaced the project header the chevron lived on, and the collapse went with it. Nothing in the commit says it was meant to go — and thecollapsedProjectslocal setting is still in the schema with nothing reading it any more, so whatever people had already folded is sitting there intact. This puts the toggle back, on the header the rebuild left us.Because that header is now per checkout, a tap folds exactly the card it sits on. A project with two worktrees renders three sections, and folding all three from one chevron would hide sessions the user never pointed at — so each collapses on its own, and you can fold the worktrees you are not working in while the main checkout stays open. The primary checkout keys on the project id, which is the key the old code used, so a project someone had already collapsed comes back collapsed.
Two smaller decisions. The
+button stays its own pressable beside the toggle, so starting a session in a project never folds it. And a collapsed header shows how many sessions it is hiding, since a folded card otherwise tells you nothing about what is inside.Worth noting that #1706, filed two days before the rebuild and still open, was leaning on this: "Collapsing cards helps (and the collapsed state is nicely persisted)". That issue asks for something further — a switch that drops the grouping entirely — and this PR does not attempt it. It only restores what that issue was already building on.
Proof
Driven against the running app (standalone
happy-server+ Expo web + Playwright), on a project with a main checkout and two worktrees so the per-checkout behaviour is actually visible. Frames and the full assertion log are in the comment below; in short: folding thealphaworktree left the main checkout andbetaexpanded, folding the main checkout as well leftbetastill expanded, and a real page reload (performance.getEntriesByType('navigation')[0].type === "reload") brought that three-way state back. The persisted setting held exactly two keys — the bare project id and the project id plus thealphapath — and none mentioningbeta.pnpm typecheckis clean andvitestpasses 922 tests, three of them new for the key derivation.