Skip to content

Read-only HTML document sharing over encrypted rooms#10

Merged
lightsofapollo merged 3 commits into
mainfrom
james/share-html
Jun 18, 2026
Merged

Read-only HTML document sharing over encrypted rooms#10
lightsofapollo merged 3 commits into
mainfrom
james/share-html

Conversation

@lightsofapollo

Copy link
Copy Markdown
Owner

Summary

Adds the ability to share .html/.htm files 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 }; SnapshotPlaintext is now { doc_type, content, anchor_index: Option<_> } — HTML carries no anchor index.
  • 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 docTypeHtmlViewer 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 context menu) enabled for HTML.

Testing

  • Rust share_html_file_publishes_read_only_snapshot — decrypts the snapshot blob → DocType::Html, asserts no anchor index. cargo test --lib 421 pass.
  • Web new HTML browser-session case (content + docType=html); node scripts/run-tests.mjs 31 files / 0 fail; svelte-check clean.
  • Headless E2E scripts/test-html-share-e2e.sh (task test:html-share): boots the real Miniflare relay + owner/reviewer daemons, owner shares sample.html, reviewer joins, and asserts the reviewer renders the shared HTML read-only (iframe srcdoc carries the owner's bytes; no editor).
  • Regression scripts/test-review-e2e.sh (markdown collab) still 13 PASS / 0 FAIL.

Notes

  • web/dist/index.html is gitignored and built at compile time. After web changes, rebuild the frontend (cd web && npm run build) before cargo buildbuild.rs short-circuits to a prebuilt dist if present.
  • Out of scope (follow-up): comments/anchors/suggesting on HTML, live-updating shares.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
attn Ready Ready Preview, Comment Jun 18, 2026 12:46am

Request Review

lightsofapollo and others added 2 commits June 17, 2026 18:43
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>
@lightsofapollo lightsofapollo merged commit 30c1b11 into main Jun 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant