feat(canvas): add snapshot sharing - #768
Merged
Merged
Conversation
beruro
marked this pull request as draft
August 11, 2026 15:36
beruro
marked this pull request as ready for review
August 13, 2026 14:52
- isPublicWebUrl rejects loopback/RFC1918/link-local/IPv6-private and .local/.internal hosts on encode and decode - distinct short-link-unavailable-too-large error so a service outage is not reported as an oversized canvas - unsupported modes rejected at availability/create; newer-version links distinguished from corruption - LRU accounting includes cached result links; misconfigured API URL fails loudly instead of laundering into service-unavailable; eviction aborts are silent to subscribers and covered by tests; titles truncate on code-point boundaries (cherry picked from commit b59aebc3ea51242e5e5c8c7605a28947971bafec)
Add the canvasApp.share* key set and canvasApp.retry to en/zh/zh-Hant sessions.json, matching the 768 subset of cc0a56b83. Keys for other PRs (design*/revision*/compare*/domSelection/tools/input/manageIssues) are intentionally excluded; existing shareDialogRetryShort and shareDialogRetryingShort keys are kept in place.
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.
Problem
Canvas needs a dedicated way to publish one completed prototype without sharing the surrounding conversation, session, repository, account, or later revisions. Embedding every compressed snapshot in the URL creates very long links, while reusing ORG2 Cloud session sharing applies the wrong data scope. A failed short-link upload also left a permanently cached long fallback, so the same Canvas kept showing “short-link service unavailable” after recovery.
Solution
https://canvas.org2.dev/and its same-origin/api/canvas-sharesendpoint.The owned viewer and proxy are deployed at
https://canvas.org2.dev/and tracked in ORGII-cloud-infra#20.Potential risks
CompressionStreamAPI.State and edge coverage
Audit
Architecture coverage included state/types, privacy boundaries, cache/runtime ownership, configuration limits, and wire validation. Rust/backend layers were skipped because this PR changes only the desktop frontend contract.
Frontend UI audit: 0 fixes recommended, 15 elements kept with documented reason, 0 abstraction candidates.
Performance verdict: pass. There is no idle resource; memory is bounded; fallback freshness is checked lazily; concurrent retries are single-flight.
Effects: no Effect was added or materially changed. The existing cleanup Effect only invalidates a pending promise subscriber on unmount.
Verification
pnpm typecheckafter merging latestdevelop— passed.git diff --check— passed.git rev-list --left-right --count origin/develop...HEAD—0 9.UI evidence
The live viewer is available at https://canvas.org2.dev/. The fallback dialog keeps the complete link usable and adds a localized, loading-aware “Retry short link” action. Visible, loading, and disabled states have render-test coverage.