cmux NEXT New Tab: Tab switches between Search and Ask

Merged
TE
18d ago
+1139-27

The default New Tab screen gets its Search | Ask switch back, working like a browser omnibox with an aside. This reverses R86 (Lawrence, 2026-10-04) at Leo's call on 2026-10-18; the plan records the reversal.

  • A glass pill at the right of the field reads "Search | Ask" with a "Tab to switch" hint. The hint hides when the pane is narrow. The pill sits in the field's row, not in the button row with the model, mic and Send.
  • Tab flips the mode, and focus stays in the field. Clicking either half also switches. Shift-Tab still moves focus, so the keyboard can leave the field. The field is described by the hint, and a polite live region says the new mode.
  • Once Down or Up has moved the highlight, Tab steps it instead, as in Chrome's omnibox (#21198). Without a keyboard highlight, Tab is the switch's.
  • Ask mode puts "Ask Claude Code" first. Search mode puts "Search the web for …" first and changes the placeholder to "Search the web or type a URL". Return takes the first row. An address or domain still opens first in either mode.
  • Lag: the thumb slides with a CSS transform on the compositor. The switch writes data-mode straight to the DOM, then re-renders the rows in a startTransition. A busy main thread can delay the row list, but it can't stall the slide. With reduced motion, the thumb jumps.
  • A switch clears a keyboard highlight, so after Down and a click on the pill, Tab switches again.
  • The highlighted row is held by its key, not its index. An arrow pressed while a switch is still rendering stays on the row it picked when the rows reorder (Greptile's P1).

Changelog

Added: Tab switches the New Tab between Search and Ask again.

Validation

All on Huge Blue at the merged tree (base d0dcccd2ad):

  • bun test test/new-tab-search-ask.test.tsx test/new-tab-omnibar.test.tsx: 17 pass at f5bb970b2. The new an arrow pressed before a switch renders keeps its row through the reorder fails on the old head 3ec0b65 and passes now.
  • Every test/*new-tab* and test/*gallery* file: 158 pass, 0 fail.
  • vp check --no-fmt has no findings in the changed files, and vp fmt --check on them is clean. The one type error (test/markdown-reading-settings.test.ts), the icons.tsx format finding and the type-scale and text-focus check failures are all in files this PR doesn't touch, at the base.
  • The base's Tab with suggestions showing but no keyboard-highlighted row test now expects the switch, and still checks that Shift-Tab isn't consumed.
  • Gallery states: typed-ask-mode, typed-search-mode, empty-search-mode (the Search placeholder) and typed-url-search-mode (an address still leads in Search). Captures come from the gallery advisory run.

šŸ¤– Generated with Claude Code