feat(agent-pane): accept new tab inline suggestions safely
What changed
The CMUX Next New Tab omnibar now accepts a visible inline URL completion with Right or End when the caret is at the end of the field. Only a top row that is an address and extends the typed prefix qualifies: an open result (the typed address or a top site) or a visited page (history), the way Chrome's omnibox completes. Tab, workspace, search and Ask rows stay explicit picks. Accepting only fills the field; it never opens a page.
Tab advances the highlighted suggestion only after the keyboard has moved the highlight (Down/Up or Ctrl-N/Ctrl-P, then Tab). Otherwise, including the default top-row highlight or a mouse hover, Tab is left to the browser, so keyboard users can Tab from the field to Send. Neither Right/End nor Tab opens a page or sends a prompt. Enter and the Send button remain the explicit activation gestures.
Why
The omnibar already ranks completions and documents Right/End acceptance, but the page did not implement that keyboard path. The first version also took Tab whenever suggestions showed, which is nearly always while there is text, so Send was unreachable by Tab.
Review also flagged that the old comment said history rows "stay explicit picks" while the code accepted them. 04e8e86ae43/b8b41bfd4e0 briefly removed history from inline completion. 3e1564c9eaf/b98377dcd41 restored it because visited-page completion was intentional (1d8f0db), and the comment now describes that behavior.
Changelog
- Added: Right or End in the New Tab field accepts the inline address completion; Tab steps through suggestions once the arrow keys have moved the highlight.
Validation
Each regression test was committed before its fix. Same command throughout, from webviews/:
bun test test/new-tab-omnibar.test.tsx test/new-tab-screen-model.test.ts
- Tab, red at 04e8e86ae43: "Tab with suggestions showing but no keyboard-highlighted row moves focus on" failed because Tab was prevented (defaultPrevented true). Green at b8b41bfd4e0: 13 pass, 0 fail.
- History restored: red at 3e1564c9eaf, green at b98377dcd41.
- At b8b41bfd4e0:
bun test test/new-tab-*.test.* test/newtab-*.test.*78 pass, 0 fail (browser-only tests skipped locally);bun run typecheckclean;bunx vp lintandbunx vp fmt --checkon the four changed files clean. - No native build or dogfood; webview-only change.
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
The New Tab omnibar now accepts a visible inline URL completion with Right or End, and Tab advances a keyboard-highlighted suggestion while the popover is open. Neither key opens a page or sends a prompt; Enter and the Send button remain the explicit activation gestures.
Scope
- The branch merged in the
feat-cmux-nextbase, so the diff also carries that work (cmux app links in Markdown, Cmd-P navigation, the pinned Home dock, the composer and markdown viewer, new-terminal grid sizing, CI rolbback/build fixes, and optchat auto-resume). - Inline completion applies only to a top-row open result (typed address or top site) or a visited page (history) that extends the typed prefix; prompt, search, and tab rows stay explicit picks.
- Tab steps only a row the keyboard already highlighted, so when no row is keyboard-picked Tab still moves focus on to Send.