Repository navigation
Image viewer: a copy that cannot be drawn says so, on the image it copied - #18431
Conversation
A reply's inline image opens a viewer over the pane: zoom about the pointer (pinch, Command-scroll, double click, + - 0), pan a zoomed image, arrows and the arrow keys through every image of the chat, copy as PNG, Escape or a click beside the image to close. The mock light-theme chat shows three screens to open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agent-pane.image-viewer: a reply with three screenshots, and images in two replies the viewer's arrows go through. The opened viewer needs a click, so its states wait for play steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red: the viewer's image list keeps an image on a fence's later line, loses images after a lone backtick, with parentheses in the target or inside bold; Tab leaves the viewer; an image the list misses opens without its name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The viewer's image list now comes from Markdown.tsx's own block parser and inline pattern (inlineImages), so it holds exactly the images a reply draws: none from code, and those after a lone backtick, with parentheses in the target or inside bold. An image the list still misses opens under its own name. WebKit's pinch (gesture events) zooms about the pointer; the stage's padding is symmetric so zoom stays about the pointer; Tab wraps inside the viewer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e data URLs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Notes draw under the reply by first reference, so the viewer lists their images there too; a reply whose only image has an upper-case data URL scheme is read, as Markdown.tsx draws it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mock chat and the gallery entry show a chart, a gradient and a diagram instead of drawn app screens: previews are never mockups of cmux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The viewer is a ui/Dialog (Base UI): it traps focus, makes the pane behind inert, closes on Escape and returns focus to the image, replacing the hand-rolled role, tab index and Tab handling the UI rules forbid. Only its own image keys (arrows, + - 0) stay a key handler, marked ui-allow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ext-image-viewer # Conflicts: # webviews/src/agent-session/acpmux/conversation/Markdown.tsx
…e reply budget Red: since base moved data URLs over 4 KB behind short refs and capped a reply at 8 MB, chatImages lists none of a reply's long images. Focused: bun test src/agent-session/acpmux/conversation/imageViewer.test.tsx -t budget (fail: 0 listed, 6 drawn) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he reply budget inlineImages mirrors renderInline again: it takes the URLs back from capDataUrls' short refs (passed down into bold, italic and link text), and chatImages drops the reply's images past dataUrlsOverBudget, which draw as their name. Focused: bun test src/agent-session/acpmux/conversation/imageViewer.test.tsx -t budget (pass) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red since the move to ui/Dialog: a press inside the viewer focuses the dialog popup, above the body that handled the image keys, and the wheel and gesture listeners ran before the portal mounted the stage. Focused: bun test src/agent-session/acpmux/conversation/imageViewer.test.tsx (fail: keys stay at scale(1); Control-scroll not prevented) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ui/Dialog passes onKeyDown to its popup, which takes focus after a press inside, so the viewer's arrows and + - 0 keys go there. The stage is a callback ref, so the pinch and wheel listeners attach once the portal mounts it. Focused: bun test src/agent-session/acpmux/conversation/imageViewer.test.tsx (11 pass) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ext-image-viewer # Conflicts: # webviews/src/agent-session/acpmux/App.tsx
The opened viewer as play steps on the reply with three images, and anchors that prove nothing under the viewer moves. Regenerated agent pane bundle for the base merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ext-image-viewer # Conflicts: # webviews/src/agent-session/acpmux/Localizable.xcstrings # webviews/src/agent-session/acpmux/conversation/Markdown.tsx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ext-image-viewer # Conflicts: # webviews/src/agent-session/acpmux/conversation/Markdown.tsx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ext-image-viewer # Conflicts: # webviews/src/agent-session/acpmux/App.tsx
Base no longer commits the web bundles: the agent-pane bundle files are dropped; only GENERATED.md stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picks up the bundle-removal CI fixes. The string catalog keeps base's text and adds only this branch's keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge kept this branch's generated strings and dropped base's composer.connectSSH and composer.connectCloud. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ys on its image Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Blacksmith runners detected OOM events on the following jobs:
|
|
|
|
Unclear: CI failed on
Not re-run automatically: Written by |
# Conflicts: # webviews/src/agent-session/acpmux/conversation/ImageViewer.tsx # webviews/src/agent-session/acpmux/conversation/clipboard.ts # webviews/src/agent-session/acpmux/conversation/imageViewer.test.tsx
|
The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/37689519735 at 3e0a1ad failed: cmux-next generated files. |
Summary
The image viewer's Copy button now always gives an answer, and that answer only shows on the image it copied. This follows up a review of #18200.
Follows #18200 (the image viewer), which landed as f2eb10f.
Testing
webviews/on the local machine.bun test src/agent-session/acpmux/conversation/clipboard.test.ts: 1 pass, 1 fail at the red commit (the draw error escaped instead of failing the copy); 2 pass after the fix.bun test src/agent-session/acpmux/conversation/imageViewer.test.tsx: 11 pass, 1 fail at the red commit (the late result showed "Copied" on the next image); 12 pass after the fix.bun test src/agent-session/acpmux/conversation test/ui-rules.test.ts test/gallery-coverage.test.ts test/pane-english.test.ts: 194 pass.vp checkpasses on the changed files, and the typecheck passes on all 1023 files.Changelog
none (the image viewer has not shipped yet; #18200 carries its changelog line)
Proof
No visual change: the button's labels and icons are the ones #18200 added. The tests above cover the behavior.
Checklist
image.copyFailedandimage.copy.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
The image viewer's Copy button now always answers, and its answer stays on the image it copied.
Written for commit 84e78d7. Summary will update on new commits.
Note
Low Risk
Localized clipboard and UI feedback in the unreleased image viewer; no auth or data-path changes.
Overview
Image viewer copy now always resolves and ties success/failure feedback to the image that was copied.
copyImagerejects when the source cannot be turned into a PNG (zero dimensions, missing 2D context, tainted canvas / draw or encode errors) instead of leaving the clipboard promise pending or copying a blank 1×1 PNG as “Copied”. The Copy handler records the clickedsrcand only updates the button label when that same image is still on screen when the async copy finishes, so stepping to another image before copy completes no longer shows “Copied” on the wrong slide.Adds unit tests for
copyImagefailure paths and a viewer test for the late-completion case.Reviewed by Cursor Bugbot for commit 84e78d7. Bugbot is set up for automated code reviews on this repo. Configure here.