cmux NEXT: a chat's file changes open on the right at every width; no branch error outside a repository
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):
diffBesideopens 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.- Otherwise the turn's own diff opens in the page (#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 answersoperation.failedwithdetails.extra.code: not_a_repository, anduseGitWritetreated that as a failed read. NowisNoRepository(inchanges/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-panelrule sits at the top level, inside no@containeror@media, and places the panel at--acpmux-review-chat. The transcript gets the matching right margin. - No pane sheet hides
.acpmux-reviewing>.acpmux-scrollor.acpmux-header. isNoRepositoryacceptsnot_a_repositoryand rejects timeouts and git failures.useGitWritewith anot_a_repositorystatus:statusFailedfalse andavailablefalse. With a timeout: stillstatusFailed.
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 lintand the type check were clean.vp fmtflagged 2 files; b56ca15 formats them, andvp fmt --checknow passes. - Red on the base: the test commit (25551f9) comes before the fix. It fails on the base because
isNoRepositorydoes 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](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
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_repositorystatus 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.