Skip to content

fix(next): select text from transcript gaps - #26704

Merged
teamleaderleo merged 31 commits into
feat-cmux-nextfrom
nx-transcript-gap-selection-1028
Oct 29, 2026
Merged

teamleaderleo merged 31 commits into
feat-cmux-nextfrom
nx-transcript-gap-selection-1028

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Dragging from the blank padding between transcript rows now starts or restarts text selection at the nearest visible caret. A line above contributes its end and a line below its start. Plain gap clicks clear an old selection; text and controls keep their native pointer behavior.

Leo's request:

There's these dead zones in between, like, the padding between tool calls and, like, prompts and agent messages and stuff. So we need to be able to, like, just have that not be a dead zone. Just have that also be able to, like, go into the mouse down and re-highlight, like, the text thing.

The existing transcript handler resolves mounted text once on pointerdown and extends a native range during the drag. Public fixtures cover all nine tool/prompt/agent row pairs, both side gutters, selection restart and clearing, control padding, and invisible code handoff text. Separate midpoint cases add a 32px gap only in the integration fixture, measure the actual upper/lower article bounds, and verify that each press lands outside both rows and their controls; production spacing is unchanged.

The pointerdown path now checks event.composedPath() before classifying transcript padding. Presses whose path enters an open shadow root or shadow host stay with native selection; the handler never synthesizes a range inside that boundary. The browser test server supplies Pierre's real portable workers on HTTP so HighlightedCode and EditDiffHunks render their actual diffs-container text. Regressions drag inside each component's own shadow root, assert native pointer ownership and code-only selection, then unmount React roots and terminate the test workers. Product scheme policy is unchanged.

Changelog

Fixed: Text selection can start in the gaps and padding between transcript messages and tool calls.

Observed / Not run

  • Final source head: 093474ad1e141146b2008496254cbcac71981420; whole tree ea7f132314bd5dd41ede7aa0f6a82f3dfe312947.
  • Fleet browser run 40801742241: 95 passed, 0 failed, across Chromium and WebKit. This includes all nine row-type pairs, actual inter-row midpoints, RTL, sender chips, native video play/seek ownership, real highlighted code and diff shadow roots, side gutters, selection clearing/restart and virtualization. The workflow then stopped on formatting in two changed files.
  • Formatting and full web-check recovery 40802306645: SUCCESS. Applied the formatter output for those two files; the tested formatted tree equals the final source tree above. No behavior changed after the 95-test run. Scoped pre-push gate and whitespace check pass.
  • The handler now owns only explicit transcript gap targets (scroller/thread surfaces, the composer strip, and the row's transparent padding marker). Every content descendant keeps native pointer handling. The row marker inherits the real padding, including zero-padding tool rows; no control denylist is needed.
  • The nearest mounted text is resolved only on pointerdown. Above/below anchors use the text endpoint and computed direction, while drags keep the existing bounded animation-frame and virtualization path. Pointerup, cancel, lost-button movement, blur and unmount clean up the listeners/frame.
  • Earlier red/green run 40646866503 proved the original gap drag fails on base and selects text after the fix. The final capture below reruns the same public fixture and drag on the final tested tree.
  • Final gallery and full web-check run 40805502807: SUCCESS, all 26 light/dark gallery cases healthy with zero newly broken states. The tool-to-tool gallery arm now supplies an actual 32px fixture gap, matching the existing midpoint regression; production adjacent-tool spacing remains unchanged. Snapshot 26f252bb3c2fa64c543a375614febc57078a57fb and final source share the whole tree above.
  • Native macOS build and signed app execution were not run; this change is confined to web selection behavior.

Review (independent Codex gpt-6-astra high, review_gap_final_26704): SHIP at 093474a

The reviewer re-inspected the whole final diff, surrounding lifecycle, and final gallery-only repair from the bare mirror. Primary inspection agrees. This is a different-model read-only subagent review; fleet runs are separate evidence.

The transcript spacing follows the private Claude tool-row and Codex expanded-command references; those reference images are not published here. The gap-behavior captures below use the public agent-pane.gutter-select/gaps-ready gallery fixture, Chromium 151, 1280×560, English, Apple System Colors, and the same drag coordinates.

Before: gap drag selects nothing After: gap drag selects text
Before gap selection After gap selection

Final checks: all 80 checks pass apart from Package dependency lists sorted in cmux-next. Exact base replay 40808066907 reproduces the identical CmuxNextHomeEngineTests: imports CmuxNextHome but does not declare it in its dependencies on the tested merge base fe31ba94c5d1eeee3c81dc1768a8a910872e9b8c. This PR changes no Swift, manifest or dependency-checker input. All four own web shards and gallery health pass; no pending checks remain.

Agent session: agent session

Add browser regressions for row-gap midpoint drags and control ownership before the gap handler repair.\n\nAgent-Session: https://cmux.com/deeplink/agent?harness=codex&session=transcript-gap-selection-1028&host=big-red

Agent-Session: https://cmux.com/deeplink/agent?id=aid-f7f42a8c196bca5f0498
Leo reported dead zones between tool calls, prompts, and agent messages. Resolve a gap or side-gutter press to the nearest mounted caret on pointerdown, then extend a native range across rows without intercepting controls.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-f7f42a8c196bca5f0498
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 093474a: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr26704 -f ref=nx-transcript-gap-selection-1028 -f platform=macos -f backend_mode=local

Unclear: web / react-apps-base-check (2) failed: no known signature; failed step: Run base reds and compare. This PR merged before its CI finished: fix forward on main.

CI failed on 093474ad1e (run 40806343448 attempt 1): 3 unknown.

Job Verdict Why
web / react-apps-base-check (2) unknown no known signature; failed step: Run base reds and compare
web / react-apps-base-check (3) unknown no known signature; failed step: Run base reds and compare
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Not re-run automatically: web / react-apps-base-check (2), web / react-apps-base-check (3), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 7c46740 to compare; do not merge until green; see lane-rules
red: web / Web status; base red: the same failure on the base 7c46740; does not block
red: web / react-apps-base-check (2); no finished base run on 7c46740 to compare; do not merge until green; see lane-rules
red: web / react-apps-base-check (3); no finished base run on 7c46740 to compare; do not merge until green; see lane-rules
red: web / react-apps-check; base red: the same failure on the base 7c46740; does not block

Gallery before/after for 093474a: 16 states rendered, 10 images differ, 1351 more touched states not rendered. Images are in the run's artifact, not on this public PR.

gh run download 40806343310 -R manaflow-ai/cmux -n gallery-advisory-26704-093474ad1e141146b2008496254cbcac71981420 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.addressed-message/relayed Apple System Colors Light unchanged 0% own IncomingMessageCard.tsx
agent-pane.addressed-message/relayed Apple System Colors unchanged 0% own IncomingMessageCard.tsx
agent-pane.agent-message-row/sent Apple System Colors Light changed 0.0235% own AgentMessageRow.tsx
agent-pane.agent-message-row/sent Apple System Colors changed 0.0213% own AgentMessageRow.tsx
agent-pane.agent-message-row/lanes Apple System Colors Light unchanged 0% own AgentMessageRow.tsx
agent-pane.agent-message-row/lanes Apple System Colors unchanged 0% own AgentMessageRow.tsx
agent-pane.agent-message-row/sent-subagents Apple System Colors Light unchanged 0% own AgentMessageRow.tsx
agent-pane.agent-message-row/sent-subagents Apple System Colors unchanged 0% own AgentMessageRow.tsx
agent-pane.agent-message-row/sent-hover Apple System Colors Light changed 0.0238% own AgentMessageRow.tsx
agent-pane.agent-message-row/sent-hover Apple System Colors changed 0.0217% own AgentMessageRow.tsx
agent-pane.agent-message-row/sent-opened Apple System Colors Light changed 0.0251% own AgentMessageRow.tsx
agent-pane.agent-message-row/sent-opened Apple System Colors changed 0.0232% own AgentMessageRow.tsx
agent-pane.agent-message-row/sent-opened-long Apple System Colors Light changed 0.0145% own AgentMessageRow.tsx
agent-pane.agent-message-row/sent-opened-long Apple System Colors changed 0.0126% own AgentMessageRow.tsx
agent-pane.agent-message-row/outcomes Apple System Colors Light changed 0.0275% own AgentMessageRow.tsx
agent-pane.agent-message-row/outcomes Apple System Colors changed 0.0238% own AgentMessageRow.tsx
agent-pane.agent-message-row/both-directions Apple System Colors Light unchanged 0% own AgentMessageRow.tsx
agent-pane.agent-message-row/both-directions Apple System Colors unchanged 0% own AgentMessageRow.tsx
agent-pane.chat-find-bar/empty Apple System Colors Light unchanged 0% own conversation.css
agent-pane.chat-find-bar/empty Apple System Colors unchanged 0% own conversation.css
agent-pane.chat-find-bar/matches Apple System Colors Light unchanged 0% own conversation.css
agent-pane.chat-find-bar/matches Apple System Colors unchanged 0% own conversation.css
agent-pane.chat-find-bar/next-match Apple System Colors Light unchanged 0% own conversation.css
agent-pane.chat-find-bar/next-match Apple System Colors unchanged 0% own conversation.css
agent-pane.chat-find-bar/no-results Apple System Colors Light unchanged 0% own conversation.css
agent-pane.chat-find-bar/no-results Apple System Colors unchanged 0% own conversation.css
agent-pane.chat-width/standard Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/standard Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors unchanged 0% own App.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 28, 2026
Exercise every tool, prompt, and agent row pair through the real virtual transcript, including both gutters, selection restart, plain clicks, and control ownership.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-f7f42a8c196bca5f0498
@blacksmith-sh

blacksmith-sh Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpfud8hby4/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpn5i_e8f5/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs

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

Preserve native text and control presses, resolve every row gap and side gutter to the closest rendered line, and only inspect mounted text on pointerdown. Keep touch scrolling native. Add the public gallery matrix for tool, prompt, and agent row pairs.

Agent-Session: https://cmux.com/deeplink/agent?id=aid-f7f42a8c196bca5f0498
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-4w1xqn created for this PR by the cmux coordinator.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at 28a929e

No blocking findings.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at 1cac423

No blocking findings.

Reviewed the supplied diff and changed files. Tests were not rerun in this environment.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at 682f9e3

No blocking findings.

@teamleaderleo
teamleaderleo merged commit 3797a6b into feat-cmux-next Oct 29, 2026
181 of 186 checks passed
@teamleaderleo
teamleaderleo deleted the nx-transcript-gap-selection-1028 branch October 29, 2026 02:49
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

teamleaderleo added a commit that referenced this pull request Oct 30, 2026
…mpty rows, dev host trust, four stale tests) (#27794)

* fix(webviews): six react-apps-check base reds (tables in WebKit, empty rows, stale tests)

- markdown tables: a drag across cells in WebKit stayed on its first cell.
  prosemirror-tables normalizes a text selection whose head lands at the next
  cell's start to the first cell's text; Chromium waits for the mouseup to write
  the editor's selection to the page, WebKit writes it at once and its drag stops
  there. tableTextSelectPlugin drops that normalization while the button is down.
- transcript: a row whose renderer draws nothing took its padding again
  (`article.acpmux-row:empty` stopped matching once every row holds its
  `.acpmux-row__gap` target, #26704). The rule now matches a row with no child
  but the gap.
- MarkdownMath: the test reads the text without the <wbr> break points #27277 adds.
- bare-ref-repo: another agent's message is one line until opened (#27312); the
  test opens it before reading its chips.
- transcript-send-remount: the fixture's turn ends with its footer, so the reply
  does not gain its own action row on send (#27313), a redraw the test is not about.
- trailing-plates-tool-output: Reduce Motion still runs transitions for 0.01ms;
  the test reads the actions once their reveal has run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-ffe9f4bb4afcf68decf6

* fix(webviews): the browser dev host never invents a folder's trust

chat-open-long (busy daemon) has been red since #24144. Before the pane's
daemon client binds its actions, a trust read reaches the browser dev host,
which answered every folder "unknown". That drew a "Trust cmux?" card
(73px) over a folder acpmux trusts. Since #24144 scoped trust to its route
authority, the client's bind reads the folder again and the card goes away,
so the transcript shifts. Before #24144 the wrong card just stayed.

The dev host now says it can't answer acp.trust.get (native.unsupported),
as it does for other host-only reads. readFolderTrust treats that as "can't
say" and draws no card, and the client's read after the bind gives acpmux's
real answer. The shipped app's native host is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(markdown): a table press ends however the button comes up

Review (Codex, #27794): the drag flag ended only on a mouseup or dragstart
the page saw. A button released over another app never reaches the page,
so the flag stayed set, and the filter went on dropping a cross-cell text
selection's narrowing (a keyboard caret move out of it). The window
listeners also outlived an editor destroyed mid-press.

The press now also ends on the window's own blur (not capturing, since the
press's own focus change blurs an element), on a key, and on a mousemove
with the primary button up (as prosemirror-view's own MouseDown does). The
plugin view's destroy removes the listeners, and a new press clears any
earlier one first.

A browser test can't release the button without delivering a mouseup to
the page (Playwright keeps it pressed, and so does prosemirror-view's own
MouseDown), so the case isn't simulated. The existing drag, click and
Shift-click tests cover the paths that must keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(markdown): a key pressed mid-drag does not end a table press

Review (Codex, delta at 11a2424): Shift or Cmd pressed during a cross-cell
drag leaves the button down, but the capturing keydown listener ended the
press, so WebKit's drag went back to sticking on the first cell. The window's
blur and a mousemove with the primary button up still end a press whose
mouseup never reached the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: ci <ci@example.invalid>
teamleaderleo added a commit that referenced this pull request Oct 31, 2026
teamleaderleo added a commit that referenced this pull request Oct 31, 2026
…lapse it (#29699)

* Transcript: a collapsible's whole header line is its toggle

The edits card header toggled only from its title strip; now its padding,
icon, counts and gaps toggle too, and the same holds for an agent message's
line and a disclosure row's line. Inner controls keep their own click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

* foldAnchor test: click an agent message line's words

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

* Format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

* Edits card: keep the header marked interactive for gap selection (#26704)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

* Received line: the sender keeps its own click; gallery audit allows the edits header's chevron wash

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

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

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant