fix(share): simplify + make the Share dialog honest (SHR-1/2/3/4/6)#125
Merged
Conversation
On a publish-capable desktop that isn't currently published, the bare "Copy link" buttons copied a `tauri://localhost` deep link that is dead for anyone else — and reported success silently. Route all three (the page-actions cluster, the page context menu, the nav "…" menu) through a shared `useCopyPageLink` hook that, in that local-only case, toasts and offers a "Publish" action into Settings → Sharing instead of copying. Published desktops, the web app, and LAN/remote servers copy as before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…SHR-2) The web relay publish path was labelled "Forward to the web" / "Forward this device" — unfamiliar wording that also blurred it against the LAN listener. Rename the forwarding surface (title, toggle, sign-in-pending and resumed announcements) to "Publish to the web" / "Publish this device", and retitle the LAN listener "Share on local network (advanced)" so the two publish paths read as clearly distinct. Copy only, no behavior change; en/de/ja/zh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
The scope select listed all five visibility scopes flat — including dormant `members` and the power-user `inherit`/`authenticated` — as if equal everyday choices. Show only the two that carry the real decision (`restricted` vs `public`) by default, tuck `inherit`/`authenticated` behind an "Advanced options" reveal, and drop `members` from the choices. Whatever the page is currently set to is always included, so a stored `members`/`authenticated`/`inherit` value still renders and stays settable. en/de/ja/zh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…" (SHR-6)
The `inherit` ("Workspace default") summary read the guest gate, so on a
claimed instance it misstated what inheriting resolves to — inherit
actually resolves to the root `defaultVisibility` (e.g. members) once
claimed; the guest gate only governs an unclaimed instance's rule-0
short-circuit. Expose `defaultVisibility` in `InstanceInfo` and, when the
instance is claimed, summarise from it (falling back to the guest-gate
line for unclaimed / pre-SHR-6 servers). Display-truth only — the actual
default is unchanged. en/de/ja/zh.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
On an unpublished desktop the dialog pointed managers at "Settings → Sharing & publishing" to get a sendable link — a detour that left the copied link dead in the meantime. Replace that pointer with an inline "Publish this device" button that drives the SAME `useForwarding().enable()` the Settings toggle runs (claim + dial out — no new exposure), with the claim warning, sign-in handoff, and refusal states shown inline. Once the tunnel is online the normal copy-link footer takes over with the forwarded URL, so a fresh desktop reaches a working link without leaving the dialog. The local-only hint is trimmed for the non-manager case. en/de/ja/zh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
Pre-endorsed review fixes on the SHR-1..6 Share-dialog simplification (security ✓ Sasha, code ✓ Quinn, design ✓ Devon — all nits only): - Gate the inline-publish irreversible-claim warning on `!enabled` too, so it doesn't redundantly re-show mid-reconnect (matches SharingPublishingSettings). (Quinn) - Keep "Workspace default" (`inherit`) among the primary scopes so resetting to the workspace default is always reachable, not buried; only the obscure `authenticated` sits behind the reveal. (Devon) - Finish the Publish rename: swap the last four "Forwarding" edge-state strings (partialUnscoped / ensureRescope / bindFailed / unbindHeld) to "Publishing" across en/de/ja/zh. (Devon) - Advanced-reveal a11y: move focus to the scope Select on reveal and relabel the link to "More access options". (Devon) - Tighten two copy lines that overstated access: the publish hint → "get a link you can share", and effective-default → "pages set to Workspace default" (not "inherited pages"), across all locales. (Sasha + Devon) - Add an e2e covering the SHR-4 progressive-disclosure scope path: primary options show, the reveal exposes `authenticated`, and a stored advanced scope round-trips. No access-default, edge, relay, account, or server changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
The per-page Share dialog was convoluted and, worse, dishonest:
tauri://localhostlink and reported success — a link that resolves to nothing for anyone off that device.members,authenticated) — as if they were equal everyday choices.inheritwas a mystery box.Epic: Epic: Sharing & publishing — simplify + make honest (IA 2026-07)
Closes SHR-1 / SHR-2 / SHR-3 / SHR-4 / SHR-6.
Solution
In-repo, user-facing only:
useCopyPageLink): on a publish-capable desktop that isn't published, copy-link raises a toast pointing at publishing rather than silently copying a dead URL.authenticatedsits behind a More access options reveal; dormantmembersis hidden — but whatever scope a page is currently set to is always offered, so no stored value is ever stranded.useForwarding().enable()— no new exposure, just no detour into Settings.InstanceInfo.defaultVisibility, so "Workspace default" states what it actually resolves to.In-repo only — no edge / account / default changes. The cross-repo site-visibility bridge is SHR-8 (owner-gated) and is not in this PR.
Key files:
ShareDialog.tsx,useCopyPageLink.ts, the 3 copy-link call sites (NavContextMenu/PageContextMenu/PageActionsCluster),server/app.ts(+ read-only field),sdk/provenance.ts(type), i18n ×4. No new deps.This PR also folds in the pre-endorsed review nits (all gates approved with nits only): gate the inline claim-warning on
!enabledso it doesn't re-show mid-reconnect; keep "Workspace default" among the primary scopes so reset-to-default stays reachable; finish the Publish rename on the last four edge-state strings; advanced-reveal a11y (move focus to the scope Select + relabel to "More access options"); tighten two copy lines that overstated access; and add an e2e for the new scope path.Before / After
5 flat scopes, incl. dormant
members/authenticated, as equal choices3 everyday scopes up front;
authenticatedbehind the reveal,membershiddenno progressive disclosure; no honest default read
More access options reveal + honest effective-default line
tauri://localhost; dialog dead-ends into Settings to publishThe captures come from the standalone web harness (no desktop forwarding), so the inline-Publish affordance isn't shown in the images — it's covered in the text row above.
Test procedure
pnpm verify— green: sdk 171, ui 950, server 645 unit tests; server e2e 251 checks; MCP e2e 40 checks.packages/web/e2e/share.spec.ts): asserts the primary options show, the More access options reveal exposesauthenticated, and a selected advanced scope round-trips (persists viasetPageVisibilityand rehydrates on reopen). It type-checks under the webtscpass; it runs in CI's sharded Playwright suite (it couldn't be run locally — a dev server was squatting on:3000).@visualChromatic baseline shifts intentionally (new "More access options" link + streamlined options).Operational notes
defaultVisibilityviewer-gating; inline-publish + effective-default e2e (needs a forwarding mock).pnpm verifygreen (sdk 171 / ui 950 / server 645 unit · server e2e 251 · MCP e2e 40) · gates cleared: security ✓ Sasha, code ✓ Quinn, design ✓ Devon.🤖 Generated with Claude Code
https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w