Skip to content

New Tab: wire + capture and Plan/Build to the host - #27049

Open
teamleaderleo wants to merge 14 commits into
lane/nx-plus-newtab-capabilitiesfrom
lane/nx-plus-newtab-wiring
Open

teamleaderleo wants to merge 14 commits into
lane/nx-plus-newtab-capabilitiesfrom
lane/nx-plus-newtab-wiring

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Leo: "likewise, the chatgpt desktop app, let's do their + symbol's capabiliities for our composer. we want to be having more command palette related capabilities and stff to be able to to be surfaced".

The New Tab + menu now offers Attach Screenshot…, Attach Window… and the Plan/Build row in the app, not only in the component gallery. #26859 added the rows behind two optional NewTabScreen props, capture and onPlusMode, and App passed neither, so the app hid them. This PR passes them:

  • capture is the chat composer's existing composer.capture request (captureScreen). A cancelled pick returns no file and keeps the draft.
  • onPlusMode(pick) (in newtab/screenActions.ts) sends the page's deferred chat.new for the picked harness, folder and model, the same request the page's mode chip sends first, then chat.mode. The harness switch holds the mode until that chat starts (harnessSwitch.pickMode), and the page's send continues that chat. If the page's chat has already started, only chat.mode goes. A refused mode rejects, so the menu stays open with its error.
  • The + target follows the send's own order: a saved environment, then a machine, then no project, then this Mac's folder. A saved local environment picked after another machine or no project therefore offers Plan for its own folder. Plan/Build is offered only when the target is a project on this Mac, and onPlusMode refuses other targets.
  • A Plan picked before the place changes is kept. A send to another machine or to no project starts a fresh chat.new, which cancels the deferred switch holding the mode. The page keeps the last mode pick the host took and passes it to onAsk as mode. onAsk sets it on the started chat (chat.mode) before chat.send; if the mode is refused, nothing is sent. Both cases were found by the exact-head reviews of 1d1379dd and bdfd3956.

No native change: both requests already exist in the host.

Stack: #26843 (component) -> #26616 (native catalog) -> #26859 (New Tab Add rows) -> this PR. Base lane/nx-plus-newtab-capabilities at 65e16dad1afc844fce09a2a184b755003f884f8e.

Reference: ChatGPT desktop's + menu (composer-plus-menu-plugins-apps-sites). Copy: the capability rows in +. Keep: our colours and glass, the existing menu styling. Do not touch: the menu component, the model picker.

Verification

  • Regression first: cd webviews && bun test test/new-tab-plus-mode.test.ts fails 4/4 at 7b64e082 (the test commit: the screen actions have no onPlusMode) and passes 4/4 at the head.
  • Review fixes, red then green:
    • bun test src/agent-session/acpmux/newtab/NewTabScreen.test.tsx -t 'no Plan for a no-project' fails at 47d642da (the Plan row stays after Do not work in a project).
    • bun test test/new-tab-saved-environments.test.tsx fails 3/20 at e95eccf4. It covers a saved local environment after another machine (Plan offered for its folder) and Plan picked before the place changes to another machine or to no project, where the send must go chat.new, chat.mode, chat.send. It passes 20/20 at the head, across 4 runs.
  • At the head: NewTabScreen.test.tsx (23), new-tab-plus-mode (4), plusActions.test.ts (4), new-tab-saved-environments (20), new-tab-recent-project (11), new-tab-started-project (10), new-tab-ask-attachments (4), new-tab-ask-model (1) and new-tab-create-actions (2) pass. bun run check, scripts/web-lint.sh, python3 scripts/cmux-next/prepush-gate.py and git diff --check pass.
  • Gallery plays, Chromium, light and dark, strict CLS 0: agent-pane.new-tab/attachment-menu and agent-pane.newtab-plus-capabilities ready, planning, files and skill all report layout shift 0 and no anchor movement. The only step problems are frames over 33 ms on a shared Linux host, which the gallery tests exclude as runner timing. One of them is consistent: the skill play's row click takes about 270 ms in both themes. That code is Composer: share New Tab Add capabilities #26859's and unchanged here. The 0.017892 menu-opening shift Composer: share New Tab Add capabilities #26859 reported is gone. It came from the shared anchor's first-frame sizing, which fix(ui): constrain popup height before first placement #26852 fixed and the rebased stack now includes.

Observed / Not run

Run on a Linux host: the tests, checks and gallery plays above. Not run: a native build, or capture in the real app on a fleet Mac. The change is web-only and uses existing host requests.

Before / after

Real gallery captures of the mounted App New Tab page (agent-pane.new-tab, variant attachment-menu, 900×560, synthetic fixture). Before is #26859 at 65e16dad; after is this head. The menu now lists Attach Screenshot… and Attach Window…, which the app wired. Plan/Build appears only once the selected harness advertises a plan mode, which this fixture doesn't; the component gallery's planning variant covers it.

Theme Before (#26859 65e16dad) After (43446b78)
Dark
Light

Text under the open menu reads through its glass in these Chromium gallery frames. That is the documented Chromium backdrop behaviour (ui/glass/glass.css), and the same in both columns.

Risk: normal. The change is web-only and wires two existing host requests to rows that already exist. A Plan pick follows the mode chip's own order (deferred chat.new, then chat.mode). A send that starts a fresh chat now waits for that chat and its mode before the prompt, as a send to another machine already waited for its chat.

Changelog

Added: New Tab's + menu attaches a screenshot or window and switches Plan/Build.

Agent session: agent session

teamleaderleo and others added 8 commits October 28, 2026 21:20
Agent-Session: aid-5b89a1f2e81a1f8a5484
Agent-Session: aid-5b89a1f2e81a1f8a5484
The New Tab + menu's mode row had no host: NewTabScreen hid Plan/Build and
the capture rows because App passed neither onPlusMode nor capture. Four
cases fail before the wiring (no onPlusMode on the screen actions).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-97c8fe4890b3452e72be
App passes the New Tab screen the chat composer's composer.capture request
and an onPlusMode that sends the page's deferred chat.new for the picked
harness, folder and model (as the mode chip does), then chat.mode, which the
switch holds until that chat starts. A started chat, another machine or no
project gets only the mode, since chat.new there would open the chat itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-97c8fe4890b3452e72be
teamleaderleo and others added 2 commits October 28, 2026 21:53
Review of #27049 (P1): a no-project send is a fresh chat.new {noProject},
which cancels the deferred switch holding the + mode pick, so the prompt
ran in Build. Fails at 1d1379d: the Plan row is still offered after
Do not work in a project.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-97c8fe4890b3452e72be
A no-project or another machine's send is a fresh chat.new that cancels the
deferred switch holding the mode pick, so a Plan picked from + was dropped
and the prompt ran in Build (review of #27049, P1). The page now offers
Plan/Build only for a chat in a project on this Mac, whose send continues
that deferred chat, and onPlusMode refuses the other targets.

Red then green: bun test src/agent-session/acpmux/newtab/NewTabScreen.test.tsx
-t 'no Plan for a no-project' failed at 47d642d (the Plan row stayed after
Do not work in a project) and passes here; NewTabScreen 23, new-tab-plus-mode
4, recent-project 11, started-project 10 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-97c8fe4890b3452e72be
teamleaderleo and others added 2 commits October 28, 2026 22:24
Review of #27049 at bdfd395: a saved local environment picked after
another machine kept the + menu bound to that machine (Plan hidden), and a
Plan picked before the place changed to another machine or no project was
dropped by the send's fresh chat.new, so the prompt ran in Build. All three
fail at bdfd395.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-97c8fe4890b3452e72be
Review of #27049 at bdfd395:
- The + target is now derived in askChat's order (saved environment,
  machine, no project, this Mac's folder), so a saved local environment
  picked after another machine or no project offers Plan for its folder.
- A Plan picked before the place changes to another machine or no project
  is no longer dropped: the page keeps the last mode pick the host took,
  and a send that starts a fresh chat passes it to onAsk, which sets it on
  the started chat before the prompt goes (a refused mode sends nothing).

Red then green: bun test test/new-tab-saved-environments.test.tsx fails
3/20 at the test commit and passes 20/20 here (4 runs). NewTabScreen 23,
new-tab-plus-mode 4, recent-project 11, started-project 10,
ask-attachments 4, ask-model 1, create-actions 2 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-97c8fe4890b3452e72be
teamleaderleo and others added 2 commits October 28, 2026 22:42
Review of #27049 at 43446b7: a Plan picked before the place changes to
another folder or a saved local environment on this Mac was not sent with
the new chat, and the page kept one mode pick for all harnesses. Four
cases fail at 43446b7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-97c8fe4890b3452e72be
Review of #27049 at 43446b7:
- Every send now names the harness's + mode pick (onAsk mode), on this
  Mac's folders and saved local environments too. On this Mac chat.new is
  the harness switch, so chat.mode goes in the same turn, right after it,
  and the switch holds it until its chat starts (as the mode chip sends
  it); elsewhere the mode waits for the created chat, as before.
- The page keeps one + mode pick per harness, so Plan for one harness
  survives a pick for another and a switch back.

Red then green: the four cases of 183d767 fail there and pass here.
All 27 test files that use onAsk pass; saved-environments 22,
NewTabScreen 24, new-tab-plus-mode 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-97c8fe4890b3452e72be
@teamleaderleo
teamleaderleo force-pushed the lane/nx-plus-newtab-capabilities branch from 65e16da to ef18145 Compare October 28, 2026 22:45
@cmux-bot

cmux-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown

cmux status (one comment, edited in place; each line is updated by the job that owns it)

CI fast guards failed on 43446b7809 (https://github.com/manaflow-ai/cmux/actions/runs/40780000462). It does not block the merge; a red guard merged into main breaks it for every open PR.
The log named no failed step; see the run.

Agents: python3 scripts/ci/guard_attribution.py fix applies the mechanical fixes locally.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 4a915783 Deployed Oct 28, 2026 by teamleaderleo via wait for same-key tree publisher #73645
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant