Repository navigation
Share a chat visual straight from the inline preview - #27634
brennanb2025 wants to merge 22 commits into
Conversation
HTML could only be shared as an artifact from a local file:// browser tab. The editor offered Share only for Markdown, and the document preview that renders HTML on SSH and paired hosts had no Share at all. The editor now shares HTML files too, and the document preview's toolbar gets the same Share button, reading the page from its owning host. Both use one source key per file per host, so either surface finds the link the other published. Co-Authored-By: Claude <[email protected]>
…t-visual-inline-share
The inline visual's hover toolbar gets the existing Share button beside Open in new tab. It re-reads the page through the chat's host and publishes it under the same key as the file's editor tab and preview, so every surface updates one link. Co-Authored-By: Claude <[email protected]>
…25/chat-visual-inline-share
…25/chat-visual-inline-share
|
Sharing a chat-generated chart or report previously required opening it in another tab. This PR adds the existing Share control to the inline preview and publishes it through the ordinary file publisher. Review status: blocked on the upstream stack; still draft. The published head remains The review reproduced and corrected three problems in this PR’s initial implementation:
An architecture challenge recommended keeping this approach. A fresh second correctness review accepted all three corrections, and the dedicated performance and eight-category readiness audits found no new issue in this PR’s own accepted source. The fixer passed 64 tests across eight focused suites, plus formatting, lint, code-quality and React Doctor checks. Independent tests also exercised real file rewrites, host selection, ordinary Windows file-listing paths, concurrent reads and callback changes. Final integration waits for #27608’s complete file-read ownership correction and #27633’s ownership and contained-reader corrections. Both remain under review without final pushed heads. Those changes are owned by their PRs; no workaround or unrelated source change was added here. Not yet verified: the final combined head, queued typecheck/pre-push checks, final-head CI, and remote rendered QA. M4Air preparation is complete but execution is held for that final head. Windows QA startup failed before task delivery and its process identity could not be verified, so its worktree was preserved. Authenticated publication and live paired/SSH execution were not exercised. The inherited local read transport’s unenforced deadline remains a documented limitation; no new regression from it was established here. No PR merge, auto-merge or ready-state change has occurred. This comment will be updated after the final integration and validation, rather than adding another review summary. |
…rant's host The editor, the rendered preview and a local browser tab each built their own share key, so one file could publish to several links: a Windows path spelled C:/ in one place and C:\ in another, and the preview keyed from whichever host the workspace resolved to at render time, not the host it was reading from. One key function now serves every surface, with main's formats (local path, the CLI's SSH key, ['editor', env, host, path] with the 'remote' fallback) and Windows drive/UNC paths spelled with backslashes. The preview's grant handle keeps the location it was minted for. Share reads the page through that location and keys from it, so a later host change can't move either; an SSH grant keeps its connection id, so its read fails closed instead of reading a local file. Publishing prepares the request once per click, before sign-in and the auth retry, so a retry publishes what the user clicked Share on. Co-Authored-By: Claude <[email protected]>
…' into brennanb2025/chat-visual-inline-share
…-files' into brennanb2025/chat-visual-inline-share # Conflicts: # src/renderer/src/components/native-chat/NativeChatInlineVisual.tsx # src/renderer/src/components/native-chat/NativeChatMarkdown.visual.test.tsx
Share on the inline visual reads the file again at the click, without joining a read already under way, shows that page in the frame if it changed, and publishes the same text under the file's one key (the key the editor tab, preview and browser tab use for that file on that host). A read that fails keeps the frame and reports the file as unreadable. The parity helpers for the Share surfaces move into a test-support file so the chat visual is checked against them too. Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
…-files' into brennanb2025/chat-visual-inline-share
The Share popover is portalled and takes focus, so neither hover nor focus-within held the toolbar and the Share button faded out under its own popover. The toolbar now owns the popover's open state and stays visible while it is open. Co-Authored-By: Claude <[email protected]>
…orkspaces A preview of an SSH workspace a paired server proxies mints its grant on that SSH target, so it already keys the file the same way the editor does; the new test locks that in. Also corrects the SSH read comment: the connection id is kept because dropping it would read the path on this machine. Co-Authored-By: Claude <[email protected]>
The open state lived in the visual, which outlives the toolbar, so a visual that went away while Share was open reopened the popover by itself when it came back. The toolbar is now its own component holding that state, so it unmounts with the toolbar. Co-Authored-By: Claude <[email protected]>
…-files' into brennanb2025/chat-visual-inline-share
Review status (quick review loop, 2026-10-12)The problem this PR fixes. An inline HTML visual in a native chat could be opened but not shared. To share it you had to open the file somewhere else first, and the link you got could differ from the one the editor or preview would make for the same file. What changes for you. The inline visual's hover toolbar now has Share next to Open.
This round. A fresh reviewer went through this PR's own changes, and one architecture pass covered all three stacked PRs; the architecture pass kept the design. Fixes got a second, narrow review, then a readiness check ran on the final diff.
Verified.
Not verified.
|
…25/chat-visual-inline-share
…t-visual-inline-share
…25/chat-visual-inline-share # Conflicts: # src/renderer/src/lib/file-artifact-source-key.test.ts
…25/chat-visual-inline-share
…25/chat-visual-inline-share
ELI5
When an agent shows a chart or report inline in a native chat, you can now share it as an artifact right there. Hover the visual and a Share button appears next to "Open in new tab". It's the same Share button the editor, the HTML preview and the browser tab use, and it updates the same link they would for that file.
What Changed
The problem (STA-10098): to share an inline chat visual you had to open it in a tab first and share from there. #27633 makes these visuals ordinary files in the chat's folder, and #27608 gives every surface one Share link per file. The inline preview itself still had no Share.
Before:
After:
Mechanism:
readNativeChatVisualArtifactRequest,native-chat-visual-share.ts) does one read through the same reader the inline frame uses (Save chat HTML visuals as ordinary workspace files #27633'sreadNativeChatVisualFile), with a newfreshoption. A normal read joins any read of the same file already under way; afreshread never does, so its answer comes from after the click. Share any HTML file from the editor and the remote preview #27608's publish flow builds the request once per click, before sign-in and its retry, so the page read is the page sent.showDocument, which swaps the frame only when the HTML changed (the same rule its own reads use). Share calls it with the page it read, so what you see and what is published are the same text.fileArtifactSourceKey(owner, absolutePath)from Share any HTML file from the editor and the remote preview #27608, whereowner(host and environment) andabsolutePathcome from Save chat HTML visuals as ordinary workspace files #27633's one resolution of the visual's path against the chat's folder. No copy of the key format here, so the key is the editor's, preview's and browser tab's key for the same file, Windows drive paths included.ArtifactPublishPreparationError('unreadable')and does not touch the frame.Why
STA-10098 asked for Share right on the inline preview. Reusing the shared button, the one key function and the visual's own reader keeps chat visuals the same as every other HTML file, which is the point of #27633 and #27608.
Alternatives considered:
freshoption exists.Difference from the common pattern: none intended. This reuses Orca's existing Share button and publish flow unchanged; only the request builder is new.
Linked Issue
STA-10098 (Linear)
Visual Proof
Live check on the M4Air at head
745b0011590(all three PRs together): a hidden, isolated dev build with real Claude, plus a second isolated Orca paired to it as a remote host.Hovering the inline visual shows Open and Share:
Share opens the same popover as everywhere else. That rig had no Orca account and sharing was off, so it asks for both:
On a chat on a paired remote host, the toolbar showed the same buttons and Share opened the same popover.
Not checked live: an actual publish (needs a signed-in account), so the fresh read at publish time is covered only by unit tests.
Testing
NativeChatMarkdown.visual.test.tsx(rendered visual, real Share button and publish flow):native-chat-visual-share.test.ts:C:\/C:/spellings (local and paired), using Share any HTML file from the editor and the remote preview #27608's parity helpers (moved intofile-artifact-source-key.test-support.tsso both tests share them);Also passed: all native-chat, artifacts, browser-pane and editor-share tests (502 files),
tc:web, oxlint, oxfmt, the changed-code quality gate, andorca-ci-checks.I manually tested these changes locally (toolbar and Share popover live on head
745b0011590, local and paired host; no publish, no account)Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)