Read-only HTML document sharing over encrypted rooms#10
Merged
Conversation
Share .html/.htm files through the existing E2E-encrypted review
transport in read-only mode: a reviewer opens and reads the rendered
HTML, with no collaborative editing. Frozen snapshot; comments/anchors
deferred. Closes attn-qgd.
Rust:
- DocType { Markdown, Html }; SnapshotPlaintext is now
{ doc_type, content, anchor_index: Option<_> } — HTML carries no
anchor index (read-only, no comment anchors yet).
- bootstrap shares HTML (is_html_path/is_shareable_path; folder-share
collects .html/.htm); publish_snapshot branches by type — markdown
builds the anchor index, HTML skips it.
Web:
- Wire types: inlineSnapshot { docType, content, anchorIndex? };
ReviewSnapshot { docType, content }; new DocType.
- Native (App.svelte) + browser (BrowserReviewApp) reviewers branch on
docType -> HtmlViewer for HTML (read-only, no editor/collab/margin),
read-only Editor for markdown. HTML is kept out of collab seeding and
anchor remap.
- HtmlViewer gains a srcdoc content mode (reviewer has no local file),
keeping attn:// path mode for the owner's local view.
- Share affordances (breadcrumb button + file-tree menu) enabled for HTML.
Tests:
- Rust: share_html_file_publishes_read_only_snapshot decrypts the
snapshot blob -> DocType::Html, no anchor index.
- Web: HTML browser-session case (content + docType=html).
- Headless E2E: scripts/test-html-share-e2e.sh (task test:html-share)
drives relay + owner share + reviewer join and asserts the reviewer
renders the shared HTML read-only over the real transport.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
main (PR #9, room-replay) added tests using the pre-change SnapshotPlaintext { markdown, anchor_index } shape and reordered the share outbox (SnapshotBlob is no longer index [1]). Update the merged tests to the new { doc_type, content, anchor_index: Option } shape, and make the HTML-share test locate the snapshot_blob envelope by kind instead of a fixed index so future ordering changes don't break it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the ability to share
.html/.htmfiles through the existing end-to-end-encrypted review transport in read-only mode. A reviewer opens and reads the rendered HTML — no collaborative editing. The doc is a frozen snapshot; commenting/anchoring is deferred to a follow-up.This reuses the encrypted collab room machinery (no public plaintext hosting) — the only difference from markdown sharing is that HTML is read-only: no prosemirror editor, no collab seeding, no comment anchors.
Closes
attn-qgd.Changes
Rust
DocType { Markdown, Html };SnapshotPlaintextis now{ doc_type, content, anchor_index: Option<_> }— HTML carries no anchor index.bootstrapshares HTML (is_html_path/is_shareable_path; folder-share collects.html/.htm);publish_snapshotbranches by type — markdown builds the anchor index, HTML skips it.Web
inlineSnapshot { docType, content, anchorIndex? },ReviewSnapshot { docType, content }, newDocType.App.svelte) + browser (BrowserReviewApp) reviewers branch ondocType→HtmlViewerfor HTML (read-only, no editor/collab/margin), read-onlyEditorfor markdown. HTML is kept out of collab seeding and anchor remap.HtmlViewergains asrcdoccontent mode (reviewer has no local file), keepingattn://path mode for the owner's local view.Testing
share_html_file_publishes_read_only_snapshot— decrypts the snapshot blob →DocType::Html, asserts no anchor index.cargo test --lib421 pass.content+docType=html);node scripts/run-tests.mjs31 files / 0 fail;svelte-checkclean.scripts/test-html-share-e2e.sh(task test:html-share): boots the real Miniflare relay + owner/reviewer daemons, owner sharessample.html, reviewer joins, and asserts the reviewer renders the shared HTML read-only (iframesrcdoccarries the owner's bytes; no editor).scripts/test-review-e2e.sh(markdown collab) still 13 PASS / 0 FAIL.Notes
web/dist/index.htmlis gitignored and built at compile time. After web changes, rebuild the frontend (cd web && npm run build) beforecargo build—build.rsshort-circuits to a prebuiltdistif present.🤖 Generated with Claude Code