cmux-next: New Tab tabs draw the new-tab icon, not the agent chat bubble

Closed
AZ
10d ago
+26-6

Summary

Fixes item 15 of the cmux-next sweep (cmuxterm-hq#1421): Agent tabs and New Tab tabs shared the generic chat bubble. Both ride a conversation record, and TabItemMapping gave every conversation tab agent.chat.

The pane already knows which tabs are still on the New Tab page (AgentTabs.pageTabs), since it titles them "New Tab". It now passes that to the mapping, and those tabs draw the registry's tab.new.

TabWasNow
New Tab pageagent.chattab.new
Agent chat with a known harnessharness markharness mark (unchanged)
Agent chat without a harness markagent.chatagent.chat (unchanged)

Converted call sites:

  • TabItemMapping.item(_:fallbackTitle:isNewTabPage:): new isNewTabPage flag, default false.
  • PaneController.snapshot(): computes isNewTabPage once and uses it for both the title and the icon.

When a New Tab page becomes a chat, its title and icon change in the same snapshot.

Not changed:

  • Workspace-row kind icons. They are pending Leo's call.
  • The sidebar's tab list. It doesn't know which tabs are New Tab pages (it also titles them from the record), so it keeps agent.chat for them. Follow-up: give SidebarTabKind a new-tab case once the sidebar gets that state.

Testing

Red commit d6ea400baef adds ConversationTabItemTests.aNewTabPageTabDrawsTheNewTabIcon; the fix follows. The same conversation record maps to tab.new as a New Tab page and to agent.chat as a chat.

Changelog

Fixed: New Tab tabs show a new-tab icon instead of the agent chat bubble

Demo Video

Fleet builds of base (ff267c4b41d) and the fix, on a capture mini (1x display), opening a workspace's first New Tab.

New Tab tab at 6x, before (top) and after (bottom):

tab zoom

BeforeAfter
beforeafter

Checklist

  • Behavior changes have added or updated tests, or Testing says why not
  • UI change with no new or changed user-facing strings; localization not affected

🤖 Generated with Claude Code


Migrated from https://github.com/manaflow-ai/cmux/pull/17630 after correcting the PR author identity. The original head commit 4527a78193a3053c52d57b732d5a154d113f395f is preserved.


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


Summary by cubic

Fixes New Tab tabs in cmux-next drawing the agent chat bubble; they now draw the new-tab icon.

  • Both tab types ride a conversation record, so TabItemMapping gave every conversation tab agent.chat.
  • PaneController.snapshot() now computes whether a tab is still on the New Tab page and passes it to TabItemMapping.item(_:fallbackTitle:isNewTabPage:).
  • Adds a test covering the same record mapping to tab.new as a New Tab page and agent.chat as a chat.