fix(cmux-next): new workspace rows show at the press, in press order
Summary
Leo, 2026-10-18, on nightly 22637785a4: new workspaces show up in the sidebar too slowly, and out of order (workspace-50, 49, 38, 42, 48, 41, 47, 46, 33). In his words, "it goes out of order bc it opens too slowly".
This first commit is only the failing test. The fix follows once the fleet run shows where the time goes.
RapidWorkspaceCreateTests.fiftyCmdNDrawEachRowAtItsPressInPressOrder makes 50 default-named Cmd-N presses at key-repeat speed (33 ms) on the same-tree daemon. It samples the rows the sidebar actually draws (SidebarListView.displayed), not the model, and expects:
- each press's row drawn within 250 ms of the press;
- every drawn frame listing the new rows in press order;
- the final order in press order, and the names counting up with the presses.
It prints the median and worst press-to-row times, for before and after.
Testing
Red and green runs of the same test will be recorded here.
Changelog
- Fixed: New workspaces show in the sidebar as soon as you create them, in the order you created them, even when you make many quickly.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes quick Cmd-N presses creating new workspaces that appeared late and out of order in the sidebar.
Each new workspace is placed before the row the sidebar shows first. With back-to-back presses, that row is the previous new workspace whose placement is still in flight; the fallback previously sent the new workspace to the bottom. SidebarSection.globalIndex now anchors a slot to the first workspace at or after it that the daemon's order lists, skipping rows it does not list yet.
Tests
- Adds a regression test driving 50 default-named Cmd-N presses at key-repeat speed and sampling the drawn sidebar rows, plus unit tests covering placement before unplaced rows.
- Prints the median and worst press-to-row times.