cmux NEXT sidebar: Priority rows slide to their new place by default

Merged
TE
16d ago
+199-22

In the cmux NEXT sidebar's Priority view, a chat whose rank changes now slides to its new row by default. A row that leaves closes its slot, so the rows below slide up into it. A new row opens a slot from zero height. Before this change, the panel only animated when ui.animations.newWorkspace was on. That switch is meant for new workspace rows (Cmd-N). With it off, every reorder snapped into place and a leaving row disappeared at once, leaving a gap that the rows below jumped into.

Motion kind. No MotionKind covers sidebar reorders. The two kinds that exist are newTab and newWorkspace, and both are for inserts. The main list doesn't use a kind for moves either: SidebarListView.apply checks newWorkspace only when a new workspace row is inserted, and moves rows on Motion.sidebar's .move spring through RowMotion. The Priority panel now does the same thing. It checks Motion.sidebar.animatesMovement, which covers the master switch ui.animations.enabled, ui.animations.sidebar, ui.animationSpeed and Reduce Motion, and it moves rows on the same .move spring. It also follows the main list's rule from SidebarRowTransition: an opening row starts, and a closing row ends, at zero height at the top of its run of consecutive opening or closing rows. When motion is off, every change applies in one frame inside Motion.withoutAnimation, and leaving rows are removed right away. The row's preview label now lays out at the row's full height, so an opening or closing slot clips the text instead of squeezing it.

Files: Packages/macOS/CmuxNext/Sources/CmuxNextSidebar/Views/Priority/SidebarPriorityPanelView.swift, SidebarPriorityRowView.swift, test Packages/macOS/CmuxNext/Tests/CmuxNextAppTests/SidebarPriorityMotionTests.swift.

Changelog

Changed: Priority view rows in the cmux NEXT sidebar now slide to their new place when their rank changes, and rows that come or go open or close their slot. All of this follows the sidebar animation settings and Reduce Motion.

Tests

SidebarPriorityMotionTests runs a panel in a window on screen with ui.animations.newWorkspace off and Reduce Motion pinned off. It checks that right after a reorder, a removal or an insert, the rows are still on their way to their slots and a leaving row is still in place. Then it lets frames run until the rows reach their slots and the closed row is gone. A second test case pins Reduce Motion on, and a third turns the master switch off. Both check that every change lands in one frame.

Command: cmux-ci run --class light --target-worker aws-m4pro-9 --script scripts/ci/package-test-lane.sh --ref <sha> --arg=suite --arg=Packages/macOS/CmuxNext --arg=SidebarPriorityMotionTests --env CMUX_CI_XCODE_APP=/Applications/Xcode_26.6.app

  • Red, base 911894cc81da plus the tests only (38ace9c86586, temporary branch leo/priority-reorder-motion-red), step 30b8eabae016085f390b5fda on aws-m4pro-9: 3 of 4 tests fail with 6 issues. The reorder snaps (c.frame.minY โ†’ 0.0), the leaving row is gone at once (b.superview โ†’ nil), and the new row shows whole (b.frame.height โ†’ 23.0). The motion-off test passes.
  • Green, head e37fdcef9dc3, step b07f026b5bde6c1134b6a87f on aws-m4pro-9: all 4 tests pass, nothing skipped.
  • cmux-ci compile-check --ref e37fdcef9dc3 --app: passed.

Observed / Not run

Observed: the fleet red and green runs above, both on a host with a display. Runs on headless hosts (aws-m4pro-2/5/6) skip every test in this suite, so they don't count as evidence. Also observed: prepush-gate.py and check-motion.sh pass, and the app compile-check passes.

Not run: a native before/after capture. This PR has the media-tour label, so CI tours the head on a Mac. I didn't watch it in a running app.

Agent session: cosmic-gray

๐Ÿค– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Priority view rows in the cmux NEXT sidebar now slide to their new place by default when a chat's rank changes, and rows that leave or arrive open or close their slot. Before, reorders only animated when ui.animations.newWorkspace was on, so with it off every change snapped into place and a leaving row vanished over a gap.

Behavior

  • Rows move on the sidebar's .move spring, matching the main list's rows, and respect the sidebar animation settings and Reduce Motion.
  • A leaving row closes its slot from the top so the rows below slide up into it; a new row opens its slot from zero height.
  • With motion off, every change lands in one frame and leaving rows are removed right away.

Tests

  • Adds SidebarPriorityMotionTests covering reorders, removals, inserts, and motion-off behavior.