Add shareable invitation links

Codes now travel as links with the code in the URL fragment, which the
app reads and clears before mounting (and on hashchange). An offer link
opens a preview that suggests an idle slot, preferring the one paired
with the sender's device, and only fills in the code; the user still
creates the answer. Answer links reach the waiting sender tab over a
same-origin BroadcastChannel, are acknowledged once and reported as
used afterwards, and fall back to copy and paste when no tab answers.

The panel offers Share link where the Web Share API accepts URLs, Copy
link, and the bare code under a disclosure. The browser check covers
the offer dialog, clean URL, answer relay, reuse, fallback on another
origin, an invalid fragment, axe on both dialogs and exact bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SchluffeandClaude Opus 5.5 committed 2026-10-19 22:44:15 +02:00
1 parent 8bd37ac8b1
commit 43ee7f119f
14 files changed
+422 -59

No files matched your search

+6 -1
View File
@@ -1,4 +1,4 @@
# Shareable invitations (planned, not implemented)
# Shareable invitations
Phase 4 of the [UX roadmap](ux-roadmap.md). The sender shares a link instead of
a pasted code; the receiver opens it, previews it and creates an answer, which
@@ -103,6 +103,11 @@ hand-written encoder or a dependency, and scanning adds camera handling.
## Implementation steps and acceptance checks
Steps 1–5 and 7 are implemented (`src/lib/codes.ts`, `src/lib/invitations.ts`,
`InvitationDialog.vue`, and the invitation flow in `scripts/browser-check.ts`,
which opens the fallback on a second origin instead of a separate browser
context). Step 6 still needs manual verification.
1. Codec module with Node tests: round trips for both types and versions, bare
code vs. link, whitespace, invalid base64url, oversized input, decompression
bomb, wrong `type`, `ref` mismatch, old-format detection.
+10 -12
View File
@@ -88,21 +88,19 @@ storage denial/recovery, and protocol-version validation. Design and review note
are in [the device identity protocol](device-identities.md); this is not an
independent cryptographic audit.
## 4. Shareable invitations
## 4. Shareable invitations — implemented
Detailed in [the invitation plan](invitations.md).
Detailed in [the invitation design](invitations.md).
For HTTPS, encode fresh offers in URL fragments with an explicit Share/Copy link
action and an import preview. Keep connection details out of query strings and
server paths. Fragments still expose their contents to link recipients and any
service carrying the full link; explain that invitations are private. Clear the
fragment after import. Provide a similarly convenient answer handoff; an answer
exchange remains necessary. Keep pasteable codes as the universal fallback.
Offers and answers are shared as links with the compressed code in the URL
fragment, through **Share link** where supported or **Copy link**; the bare code
stays available. Opening a link clears the fragment. An offer opens an import
preview with slot selection and never answers automatically. An answer link
reaches the waiting sender tab in the same browser over `BroadcastChannel` and
otherwise falls back to copy and paste. An answer exchange remains necessary.
Bound and validate payloads, handle stale/incompatible links, and test practical
URL limits across messengers and mobile browsers. Do not promise a short link
without a storage service. Consider compressed payloads and QR only after checking
real payload sizes and decoding limits.
Still open: manual checks of link length, previews and in-app browsers across
real messengers and phones. QR codes remain deferred.
## 5. Guided connection flow