Skip to content

cmux NEXT: a chat's file changes open on the right at every width; no branch error outside a repository - #29672

Merged
teamleaderleo merged 6 commits into
feat-cmux-nextfrom
fix--changes-review-opens-right
Nov 1, 2026
Merged

teamleaderleo merged 6 commits into
feat-cmux-nextfrom
fix--changes-review-opens-right

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Leo, 2026-10-31, on a screenshot of a chat's file-changes review drawn over the middle of the chat: "AND WHY THE FING DOES IT STILL NOT FING OPEN TO THE RIGHT". His placement rule from the same day: "just open it on the existing. you only need the rightmost bottom auto split when there's a terminal that gets opened when there's already a browser, and vice versa". In short, the changes open on the right, never over the chat.

Why it still floated

A chat's View changes has two paths (openDiff in App.tsx):

  1. diffBeside opens the folder's git diff in its own native pane right of the chat (Lawrence, 2026-10-13: "when i click diff viewer it opens in new pane to right"). That path works only when the chat folder is a repository and every file the turn wrote is inside it.
  2. Otherwise the turn's own diff opens in the page (cmux NEXT: a one-file Edited card expands to its diff; View changes shows new and out-of-repo files #23161 added this fallback for new and out-of-repo files). That is Leo's case: the chat runs in ~/Projects, which is not a repository, and the turn wrote to ~/.claude/.../memory/*.md.

The in-page view went beside the transcript only when the pane was at least 1160px wide (@container (min-width:1160px) in header/header.css, from #17556, "as in the Codex app"). In a narrower pane, styles.css hid the transcript and the chat header (visibility:hidden), and the panel (position:absolute; inset:0) covered the chat. Earlier right-side work (#28989 and #28044 on lower-right placement, #29080 on MCP open placement) changed only the native pane path, so it never reached this fallback. That is why the bug "still" showed.

Changes

  • header/header.css: the in-page changes view sits right of the transcript at every width. The chat keeps 44% of the pane, and at least 320px when the pane is 640px or wider (--acpmux-review-chat). No container or media query decides this any more.
  • styles.css: opening changes no longer hides the transcript or the chat header.
  • The red banner "The branch state could not be read. Refresh and try again." came from the view's Commit and Push status read (git.status). For a folder outside a repository, the session host answers operation.failed with details.extra.code: not_a_repository, and useGitWrite treated that as a failed read. Now isNoRepository (in changes/gitWrite.ts) marks that answer as "no repository". The view then offers no Commit or Push and shows no error. Other failures (timeouts, git errors) still show the banner with Refresh. The native diff page uses the same hook and now behaves the same way.

Test

webviews/test/agent-pane-changes-placement.test.tsx:

  • The .acpmux-reviewing>.acpmux-diff-panel rule sits at the top level, inside no @container or @media, and places the panel at --acpmux-review-chat. The transcript gets the matching right margin.
  • No pane sheet hides .acpmux-reviewing>.acpmux-scroll or .acpmux-header.
  • isNoRepository accepts not_a_repository and rejects timeouts and git failures.
  • useGitWrite with a not_a_repository status: statusFailed false and available false. With a timeout: still statusFailed.

Command: cmux-ci test -- bash -c 'cd webviews && bun test test/agent-pane-changes-placement.test.tsx test/diff-viewer-git.test.tsx test/changes-status.test.ts && bun run check'

Observed / Not run

  • Observed: on the fleet Linux run of 330b0d3, 17 pass and 0 fail, and vp lint and the type check were clean. vp fmt flagged 2 files; b56ca15 formats them, and vp fmt --check now passes.
  • Red on the base: the test commit (25551f9) comes before the fix. It fails on the base because isNoRepository does not exist there, and the CSS assertions describe rules the base does not have. I did not run it separately on the fleet.
  • No native capture: this changes webview CSS only. Leo will try the build himself.

Risk: normal. Webview-only (CSS plus one hook). The in-page view now shares the pane with the chat in a narrow pane instead of covering it.

Changelog

Fixed: A chat's file changes open on the right, beside the chat, at every pane width, and a chat in a folder that is not a git repository no longer shows "The branch state could not be read."

Agent session: agent session

🤖 Generated with Claude Code


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


Summary by cubic

Fixes the chat's file changes view so it always opens on the right, beside the transcript, instead of covering the chat in panes under 1160px wide. Also stops chats in folders that are not git repositories from showing a "The branch state could not be read" error.

  • The changes panel and transcript now share the pane at any width; the chat keeps 44% of the pane (at least 320px when the pane is 640px or wider). A browser test now covers the narrow-pane case.
  • A not_a_repository status read no longer counts as a failure: the view hides Commit and Push and shows no error, while timeouts and git errors still show the banner with Refresh.

Written for commit 1a98382. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 3 commits October 31, 2026 13:43
…ws no branch error

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64
… folder outside a repository shows no branch error

The in-page changes view (a folder outside a repository, or a turn that wrote outside it) sat beside
the transcript only in a pane 1160px wide or more and covered the chat below that. It now sits on
the right at every width. Its status read treats not_a_repository as no Commit/Push, not a failure.

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>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64
@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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

Review c7f5a27: 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=pr29672 -f ref=fix--changes-review-opens-right -f platform=macos -f backend_mode=local

Gallery before/after for 3d5f7fa: 16 states rendered, 0 images differ, 1700 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41244220688 -R manaflow-ai/cmux -n gallery-advisory-29672-3d5f7fa966bfde91467e5a705ba475c95e84f114 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.access-offer/turn-no-credits Apple System Colors Light unchanged 0% own styles.css
agent-pane.access-offer/turn-no-credits Apple System Colors unchanged 0% own styles.css
agent-pane.access-offer/turn-low-credits Apple System Colors Light unchanged 0% own styles.css
agent-pane.access-offer/turn-low-credits Apple System Colors unchanged 0% own styles.css
agent-pane.access-offer/turn-no-offer Apple System Colors Light unchanged 0% own styles.css
agent-pane.access-offer/turn-no-offer Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/environment Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/environment Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/sources Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/sources Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/directory Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/directory Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/keyboard Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/keyboard Apple System Colors unchanged 0% own styles.css
agent-pane.add-project-panel/browse-error Apple System Colors Light unchanged 0% own styles.css
agent-pane.add-project-panel/browse-error Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-list/page-failed Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-list/page-failed Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-list/page-recovered Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-list/page-recovered Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-list/page-empty Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-list/page-empty Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-loading/first-page Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-loading/first-page Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-loading/indexing Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-loading/indexing Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-loading/loaded Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-loading/loaded Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-loading/empty Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-loading/empty Apple System Colors unchanged 0% own styles.css
agent-pane.all-chats-loading/failed Apple System Colors Light unchanged 0% own styles.css
agent-pane.all-chats-loading/failed Apple System Colors unchanged 0% own styles.css

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

Passes: CI passes on c7f5a27bba.

CI passes on c7f5a27bba (run 41303431007 attempt 1).

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.

web and size checks: green

Shipped in:

@teamleaderleo

teamleaderleo commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@cursor

cursor Bot commented Oct 31, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at 3d5f7fa

SHIP at 3d5f7fa

Visual verdict: The 16 supplied after/before gallery pairs are pixel-identical and contain no changes-panel state, so the new split is not visually exercised.

  1. [P1] [follow-up] isNoRepository misses errors from the native diff page. diffGitSource passes PageClient errors directly, whose resource details are wrapped as {origin, details: {...extra...}}; the predicate only checks error.details.extra at gitWrite.ts:150. Therefore an out-of-repository git.status in the native diff viewer still sets statusFailed and shows the branch error. Unwrap the page error details or add a PageError-path test.

Follow-ups:

  • [P1] Fix isNoRepository handling for the native diff page’s wrapped PageClient errors.

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 3d5f7fa: an independent review passed this exact head (next-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Awareness note from an agent lane that does not own this PR; it is not a review or a request to take the PR over.


Carried in #29904: this PR's commits unchanged, plus a base merge that resolves the styles.css conflict with #29618. That conflict blocked this PR from landing. This PR stays open for its owner to close.

teamleaderleo added a commit that referenced this pull request Nov 1, 2026
… no branch error outside a repository (#29904)

* test: the changes view opens right of the chat; a non-repo folder shows no branch error

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

* cmux NEXT: the changes view opens right of the chat at every width; a folder outside a repository shows no branch error

The in-page changes view (a folder outside a repository, or a turn that wrote outside it) sat beside
the transcript only in a pane 1160px wide or more and covered the chat below that. It now sits on
the right at every width. Its status read treats not_a_repository as no Commit/Push, not a failure.

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

* style: format

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

* test: the edited card's diff opens on the right on a narrow pane too

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

* agent pane changes: the file tree gives way by the panel's width, not only the window's

Beside the transcript the in-page changes view can be ~320px of a 640px pane; the
250px tree hid only by viewport width, leaving the diff ~70px. The panel is now a
named inline-size container and the tree (and file headers' folder) hide when the
panel itself is 620px or narrower.

Review (codex gpt-6.1-sol xhigh) BLOCK at 70b1865.

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

* changes view: a folder outside a repository is checked again on each scope load and Refresh

Review (codex gpt-6.1-sol xhigh) BLOCK at 905340a: with no-repository latched, Commit and
Push (and the status Refresh) stayed hidden after a git init until the view was reopened.
useGitWrite gains recheck(), which rereads git.status only while the folder was found
outside a repository. The chat's changes view calls it on each scope load (a scope switch,
Refresh), the diff page on its Refresh. The error stays suppressed.

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

---------

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

Copy link
Copy Markdown
Collaborator Author

Awareness note from an agent lane that does not own this PR; it is not a review or a request to take the PR over.


Landed as #29904 (this PR's commits plus a base merge resolving styles.css).

# Conflicts:
#	webviews/src/agent-session/acpmux/changes/useGitWrite.ts
#	webviews/src/agent-session/acpmux/styles.css
#	webviews/test/agent-pane-changes-placement.test.tsx
@blacksmith-sh

blacksmith-sh Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Found 7 test failures on Blacksmith runners:

Failures

Test View Logs
main.DeveloperIdAppTests.test_download_prints_the_active_profile_only/
test_download_prints_the_active_profile_only
View Logs
nightly must build and hand off the macOS 26 helper and Xcode 26.5 app before publishin
g/
nightly must build and hand off the macOS 26 helper and Xcode 26.5 app before publishin
g
View Logs
stubs: /System/Library/Frameworks/Security.framework/Versions/A/Security has no stub/
Security has no stub
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_CFRetain']/
CoreFoundation, missing 1: ['_CFRetain']
View Logs
stubs: CoreFoundation.tbd: install-name /System/Library/Frameworks/
CoreFoundation.framework/Versions/A/CoreFoundation, missing 1: ['_log2']/
CoreFoundation, missing 1: ['_log2']
View Logs
test_helper_never_takes_a_hosted_mac_and_skips_compile_on_hit (main.WorkflowTests.t
est_helper_never_takes_a_hosted_mac_and_skips_compile_on_hit)/
test_helper_never_takes_a_hosted_mac_and_skips_compile_on_hit (main.WorkflowTests.t
est_helper_never_takes_a_hosted_mac_and_skips_compile_on_hit)
View Logs
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)/
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)
View Logs

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

@github-actions github-actions Bot added risk:low Risk tier (docs/ci/risk-tiers.md) and removed risk:normal Risk tier (docs/ci/risk-tiers.md) labels Nov 1, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

SHIP at 1a98382

Visual verdict: no images; Leo tries the build

No correctness findings.

Follow-ups:

  • [P2] [follow-up] No after screenshots were provided, so visual verification remains pending.

cmux-bot[bot]
cmux-bot Bot previously approved these changes Nov 1, 2026

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 1a98382: an independent review passed this exact head (next-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 11:47 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 11:47 Inactive
@cmux-bot
cmux-bot Bot dismissed their stale review November 1, 2026 11:54

A newer verdict blocks c7f5a27 (no independent SHIP at the head).

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

SHIP at c7f5a27

Visual verdict: no images; Leo tries the build

  1. [P2][follow-up] The mock outside-repository status path still throws a plain Error at mockGit.ts:106. Since isNoRepository only accepts the structured machine error at gitWrite.ts:149, ?mock still shows the branch failure banner and Git controls for the dotfiles fixture. Make the mock emit details.extra.code: "not_a_repository" and add coverage.

Focused Bun tests could not run because Bun is unavailable in the review box.

Follow-ups:

  • [P2][follow-up] Align the mock status error with the native not_a_repository response.

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves c7f5a27: an independent review passed this exact head (next-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo
teamleaderleo merged commit c17c8da into feat-cmux-next Nov 1, 2026
101 of 106 checks passed
@teamleaderleo
teamleaderleo deleted the fix--changes-review-opens-right branch November 1, 2026 14:21

This branch was previously deployed

1 inactive deployment
ci-routing-agent — c7f5a27b Deployed Nov 1, 2026 by cmux-bot[bot] via wait for same-key tree publisher #96010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants