fix(cmux-next): same-time chats keep their order; workspace titles arrive instantly

Merged
TE
19d ago
+44-4

Summary

This re-cuts the parts of #21318 that the current tip still needs. #21318 conflicts, and its sidebar priority half already landed in #21281.

  • Chats reported in the same millisecond keep one order. Recent sessions, device chats and folded children sort newest first, then by their durable id. Before, a snapshot or host push that listed two same-time chats in the other order made them trade places, so the New Tab list moved for no reason. This is the same class of needless motion Leo reported today, and #21781 fixes another case of it.
  • A late workspace title arrives instantly. #21242 added sidebar.workspaceTitleMotion as an opt-in lab. Its doc comment and PR both say production stays instant, but it shipped crossfade as the default. This puts the default back to instant.

Testing

The tests were committed first (3418446eb8) and failed on the tip:

  • bun test test/new-tab-steady-chats.test.tsx: 7 pass, 2 fail. Both same-time cases came back in the other order.
  • SidebarCollapseMotionTests.workspaceTitleArrivalIsInstantByDefault (from #21318) expects .instant; the tip default is .crossfade.

After the fix:

  • bun test test/new-tab test/newtab: 73 pass, 0 fail.
  • bun run typecheck: no type errors.
  • The Swift test runs in CI.

Changelog

  • Fixed: Recent chats on the New Tab page no longer swap places when two were updated at the same moment, and a workspace's late title no longer crossfades in the sidebar.

🤖 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

Fixes two cmux-next regressions: chats reported in the same millisecond keep a deterministic order, and late workspace titles arrive instantly instead of crossfading in the sidebar.

  • Recent sessions, device chats, and folded children now sort newest first, then by durable id, so snapshot or host push order can no longer make rows trade places.
  • The sidebar.workspaceTitleMotion lab's default returns to instant, matching its documented behavior; crossfade was shipped by mistake in #21242.