cmux-next sidebar: a group dropped past an empty group keeps its members' rail

Merged
TE
16d ago
+200-1

Summary

Found by sidebar-cleanup's pre-nightly sidebar sweep (build ef4dfa4f2f5, fleet DEV): with groups Work (3 members), Infra (deploy) and an empty group, dragging Infra's header down past the empty group and dropping it left deploy with no group rail (the members' line) until a daemon workspace_group.move rebuilt the list.

Root cause: while a dropped group's card flies, the list hides the group's rows, so the applies under the flight leave its line out. When the card lands, finishLand shows the line with SidebarGroupLineViews.showMissing, which made the view but did not record the line in lines. A group fold (SidebarListView+Fold, foldLines) does not lay every line out again: it starts from lines. The next fold of any group therefore dropped the dropped group's rail, and it stayed gone until a full rebuild. Fix: showMissing records each line it shows in lines, so lines matches the views again.

Testing

SidebarGroupDragRailTests (CmuxNextAppTests), a real SidebarListView with the sidebar document's drag:

  • theRailShowsAfterAGroupDropsPastAnEmptyGroup: drop, echo, landing.
  • theRailShowsAfterADocumentDropSettles: the app's order. The drop goes to a SidebarDocStore (real mirror; a remote that does not answer), the list holds the drop's look until the model shows the move, and the card lands into those rows.

After each, every open group with members must draw its rail at alpha 1 at its rows, then still after Work folds and opens, then after a reload.

Command: cmux-ci run --class light --script scripts/ci/package-test-lane.sh --ref <sha> --arg=suite --arg=Packages/macOS/CmuxNext --arg=SidebarGroupDragRailTests

Observed / Not run

  • Red, test commit b878ffde (the doc-settle test before its frame check read fold targets): theRailShowsAfterADocumentDropSettles failed with after Work folds: g-infra draws no rail … suppressed []; lines [] and after Work opens: g-infra draws no rail … lines ["g-work"].
  • Red, final test commit ca0385bc (fleet step b9e927d6): both tests failed, 4 issues: after Work folds: g-infra draws no rail … lines [] and after Work opens: g-infra draws no rail … lines ["g-work"].
  • Green, 69e8e502: SidebarGroupDragRailTests (2 tests) passed. These regression suites also passed: SidebarDragKeepsGroupsTests, SidebarGroupDropLineTests, SidebarGroupReorderDocDragTests, SidebarGroupReorderTests and SidebarDragGeometryGroupDropTests.
  • The first green run, before the fold checks read the line's target, failed only on the in-flight frame ((9.0, 198.0…) vs (9.0, 114.0…)) on a worker where motion runs. The fold checks now compare against where the line is going.
  • The original reproduction (base 1a1acbd3 test alone, without a fold) passed on base. The drop by itself draws the rail; it is lost at the next fold.
  • Review: priority-view cross-review PASS (correctness, code read). Their nit, not changed: the test remote sleeps 600 s, so its tasks outlive the suite.
  • Not run: live drag in a DEV app.
  • CI reds not caused by this PR (they fail the same way on base): Tier routing (CmuxNextHomeEngineTests not in the target graph), Script tests (swift-test-summary.test.sh), generated files, and PR capture check.

Changelog

Fixed: A sidebar group dragged to a new place keeps the colored line beside its workspaces.

Localization: no user-facing strings changed.

🤖 Generated with Claude Code

Agent session: cosmic-gray