cmux-next sidebar: manual order only; attention order lives in the Priority view
In progress: waiting on CI's compile and the regression test's red on base and green on head.
Leo (2026-10-20): the normal sidebar keeps manual order. A drag always sticks, and no row moves on its own. Unread and attention show only as badges. Sorting by attention belongs only in the optional Priority view (#22778).
What was moving rows
SidebarRows.showranSidebarPriority().reorderedon every rebuild whilemodel.priorityOrderingwas on.priorityOrderingreusednotifications.attention.moveToTop, which is on by default. With the default, any rebuild after a state change (unread, waiting, failed, working, done) re-sorted the rows and undid the user's drag.- This PR deletes that projection:
SidebarRows.shownow sets the rows it was given. It also removesSidebarModel.priorityOrderingandSidebarPriority.reordered, along with that function's helpers and its test.SidebarPriority.itemsstays, because the Priority view uses it.
Sort settings checked
- Sort by Name, Last Used and Directory (
WorkspaceSortKey) run only as one-shot actions (WorkspaceVerbHandlers.sort). Nothing applies them again when something changes. sidebar.groupBydefaults tonone.
Not in this PR
- When a notification arrives,
NotificationCenterService.moveToTopstill moves its workspace to the top once (notifications.attention.moveToTop, default on, matching classic'sapp.reorderOnNotification). This is also an automatic move. Turning the default off is a defaults change, which needs a call-owner review, so it goes in a separate PR to keep this one from being held. - #22626 builds on the projection this PR deletes, so this PR makes it moot.
Test
Tests/CmuxNextAppTests/SidebarManualOrderTests.swift:
- Five rows, with
moveToTopon. Drag row 5 to row 1. - Every other row turns unread, waiting, failed or working, both in place and through a full rebuild, before and after the daemon holds the drag.
- Then they all finish.
The order stays w5 w1 w2 w3 w4 throughout. Commit a0b00158cd6 adds the test alone; it should fail on base.
Observed / Not run
- Observed:
prepush-gate.pyreports no new violations. - Not run yet: the Swift compile and the test (fleet and CI), both pending.
Changelog
- Changed: The sidebar keeps the order you set. A row's unread or agent state no longer moves it, and attention order lives in the Priority view.
Agent session: cosmic-gray
๐ค Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Makes the cmux-next sidebar keep manual order only: a drag always sticks and no row moves on its own. Unread and attention states now show only as badges; attention order lives just in the Priority view.
Previously SidebarRows.show re-sorted rows by attention while notifications.attention.moveToTop was on (the default), undoing a drag on any rebuild after a state change. This PR removes that projection entirely (SidebarPriority, SidebarPriorityModel.priorityOrdering, and their tests) โ the Priority view ranks chats with AgentPriorityRanking instead โ and adds a regression test covering drags across unread, waiting, failed, working, and done state changes.
One behavior is unchanged for now: when a notification arrives, its workspace still jumps to the top once. Changing that default is deferred to a separate PR.