feat(invite): privacy + expiry + trust gate + network CTA polish - #54
Merged
Conversation
Four invite-flow gaps surfaced during PR #53 visual review: 1. inviteUrl.ts — add optional expires=<unix-ts> param + parseInviteUrlDetailed returning {invite, error: 'malformed' | 'expired' | null} so callers can distinguish bad URL from stale invite for UX messaging. 2. InviteModal (LSP host) — - Expiry dropdown (Never / 1d / 1w / 30d / 90d); embeds `expires` only when set so existing permanent-invite behavior is preserved by default. - Tor-preferred toggle: if the node advertises both .onion and ipv4, default to broadcasting the onion so casual invite-sharing doesn't leak the operator's IP. Operator can flip back. - Privacy warning Alert when the chosen address is a public-routable IP (RFC1918/loopback/.onion suppressed); shows the leaked address and points the operator at the tor toggle. 3. AcceptInviteModal (client side) — - Uses parseInviteUrlDetailed so expired invites surface a clear "ask the LSP operator for a fresh one" message instead of generic "malformed URL". - Trust gate: if the parsed address is public-routable, render a warning Alert with an "I trust the source of this invite" checkbox; the Send-join-request button stays disabled until ticked. - Tor info note when the invite uses an .onion address. 4. ConnectList — when the active node's network has no coordinator binding (common on regtest/sandbox profiles), the empty-state row now lists the user's *other* profiles that ARE covered and offers one-click switch buttons that reuse the same NodesService.switchNode flow as NodePicker (clear stores → switch → refetch). testids added (sweep-friendly): invite-expiry, invite-prefer-tor, invite-privacy-warning, accept-invite-trust-gate, accept-invite-trust-ack, accept-invite-tor-note, connect-no-coord-empty, connect-switch-<network>.
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
Four invite-flow gaps surfaced during visual review of PR #53 (manual-connect modal). Each is small and self-contained.
1.
inviteUrl.ts— expiry codecexpires=<unix-ts>URL paramparseInviteUrlDetailed(url)returns{invite, error: 'malformed' | 'expired' | null}so callers can distinguish bad-URL from stale-invite for UX messagingparseInviteUrlkept as thin wrapper (backwards compat)2.
InviteModal(LSP-host side)expiresonly when set; existing permanent-invite behavior is the default..onionand ipv4 are advertised, default to broadcasting the.onionso casual invite-sharing doesn't leak the operator's public IP. Operator can flip back..onionsuppressed). Surfaces the leaked address and points the operator at the tor toggle.3.
AcceptInviteModal(client side)parseInviteUrlDetailedso expired invites get a clear "ask the LSP operator for a fresh one" message instead of generic "malformed URL"..onionaddress (positive feedback).4.
ConnectList— profile-switch CTAWhen the active node's network has no coordinator binding (common on regtest / sandbox profiles), the empty-state row now lists the user's other profiles that ARE covered and offers one-click switch buttons. Reuses the same
NodesService.switchNodeflow asNodePicker(clear stores → switch → refetch).Test plan
.onion+ ipv4 present