Files
orca/src/renderer
Brennan BensonandClaude f89d51ba02 Share any HTML file from the editor and the remote preview (#27608)
* Share any HTML file from the editor and the remote preview

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 <noreply@anthropic.com>

* Share every file under one key per host, and preview Share from its grant'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 <noreply@anthropic.com>

* Pin preview Share key parity with the editor for server-proxied SSH workspaces

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 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-12 15:30:48 -07:00
..