Skip to content

feat(e2ee): [risk:medium] FTUE guidance, error clarity, loading states, and component latency - #3448

Draft
zxch3n wants to merge 8 commits into
mainfrom
feat/e2ee-ftue-guidance-and-latency
Draft

zxch3n wants to merge 8 commits into
mainfrom
feat/e2ee-ftue-guidance-and-latency

Conversation

@zxch3n

@zxch3n zxch3n commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Round 3 · Track 3A — First-time E2EE user guidance, error matrix cleanup, black-box loading state elimination, and component-layer latency reductions (strictly scoped to packages/components/, locales/*.json, and packages/e2ee-client/src/passkey-browser.ts).

1. First-Time Guidance & Error Matrix Cleanup

  • Unbacked-up encrypted chat notice (P0): Added dismissible single-line E2eeRecoveryNotice in chat-landing.tsx (composerNoticeNode slot) jumping to /workspace/e2ee/$workspaceId?tab=recovery, plus a subtle "Not set" indicator on the narrow-screen Recovery menu row in e2ee-workspace-control-page.tsx.
  • Web unlock first screen (P0): Included recovery password in e2ee.browserUnlock.* across all 8 locales; converged the secondary E2eeLostAccessEntry on !canStart when openBrowserRecovery is present to eliminate competing recovery buttons; updated E2eeLostAccessEntry default copy when props.recovery is present.
  • Setup & creation & approval clarity (P1): Added 1-line subtitles for Passkey (recommended) / password / .vault file in recovery-vault-section.tsx (mode === "none"), tightened created copy when unfinished.length > 0, expanded e2ee.create.lossWarning to plain language, and reassured applicants in e2ee.team.waitingApproval that closing the page is safe.
  • Error matrix zero-out (P0/P1/P2):
    • Classified SecurityError in isLocalStorageFailure and distinguished Web browser storage guidance (*storageWeb).
    • Reused e2eeCreationErrorCode + i18n.exists + isLocalStorageFailure in create.tsx and mobile-create-workspace-sheet.tsx (never leaking raw e2ee_* codes).
    • Mapped both AbortError and NotAllowedError to E2eePasskeyCancelled in passkey-browser.ts.
    • Made e2ee.recovery.failed neutral, corrected e2ee.recovery.restorePartial facts, and unified Chinese locales to Passkey.
    • Distinguished camera denied vs unavailable in useQrCamera and all callers.
    • Prioritized unauthorized / conflict over retryOriginal in e2ee-team-settings.tsx approval errors.
    • Added alreadyMember direct open-workspace action and separated inviteExpired vs pinMismatch in e2ee-member-join.tsx.
  • Eliminated 5 black-box loading waits:
    • workspace-admission-gate.tsx: encrypted access verification copy + 6s fade-in ghost "Back to workspaces".
    • e2ee-automatic-pairing.tsx: 5s stepped keepOpen guidance before the 15s sync timeout.
    • e2ee-lost-all-recovery.tsx: wired onResult callback to stream per-workspace restore progress while busy.
    • create.tsx & mobile-create-workspace-sheet.tsx: encrypted key-generation button label while creating.
    • e2ee-member-join.tsx: surfaced waitingKeySlow at 20s (keeping 120s fast polling) + Spinner beside waitingTitle.

2. Component-Layer Latency Optimizations

  • Eliminated blind pairing polling:
    • e2ee-instant-qr.tsx: wired subscribeAccountPairingApproval for instant wakeup, dropping interval to an 8s fallback + exact expiry timer.
    • e2ee-automatic-pairing.tsx & e2ee-account-pairing.tsx: ran immediate check on mount/join and disabled high-frequency 800ms/2000ms setInterval when live Convex subscriptions are active (falling back only when unsubscribed/offline).
  • Unblocked first creation & open:
    • cloud-e2ee-workspaces.ts & cloud-platform-provider.tsx: optimistically added validated created workspaces via onWorkspaceCreated and ran refreshWorkspaces() non-blocking in the background.
    • e2ee-workspace-console.tsx: skipped redundant recordCreated on already-bound opens and skipped redundant immediate describe + synchronize when pin matches the fresh open() and subscribeLedgerHead is active.
    • runtime-provider.tsx & desktop-e2ee-content.ts: removed immediate redundant refreshNative() after native.open, and preloaded ./create-workspace-runtime + prefetched contentStreamsToken in parallel with native.open (strictly gated behind verified native.open + bucketId validation).

Verification

  • node scripts/check-i18n.mjs & node scripts/check-comment-ratchet.mjs: PASS (all 8 locales synced)
  • pnpm oxfmt --check & pnpm oxlint (all changed files): PASS
  • pnpm --filter @lody/e2ee-client typecheck, @lody/components typecheck, @lody/electron typecheck: PASS
  • Vitest: @lody/e2ee-client passkey-unlock.test.ts (4/4 PASS) and all 13 @lody/components E2EE suites (409/409 PASS)

…ing states, and component latency

Model: gemini-4-neon-medium
zxch3n and others added 7 commits November 26, 2026 23:08
…paces from usePlatform

Model: gemini-4-neon-medium
…ntPairing and mailbox updates

Model: gemini-4-neon-medium
- Recovery reminder on the encrypted chat landing becomes a card in the
  no-machine hint's language: shield art, title + one line, pill action and a
  corner close.
- Mobile console menu: header says "Encrypted workspace"; the workspace name
  moves to an identity row; Open workspace moves below the settings list.
- Creation choice drops the "Who can see the content" heading (kept as the
  radiogroup's accessible name).
- Recovery method rows show short verbs (Set up / Create) with the full name as
  aria-label and in overflow menus; titles wrap instead of truncating.
- Restore progress is a titled card with one row per workspace: status mark,
  short label, and a next step for partial / waiting / not-backed-up rows.
- Member join: "Signed in as" becomes a quiet footnote under the actions
  (emphasised on the wrong-account page); waiting states get a badge-and-clock art.
- Automatic pairing: device-pair art on the awaiting-device card and the
  approval guide; key sync is a centred view with the key travelling between
  devices (static under reduced motion).
- New e2ee/e2ee-illustrations.tsx with token-filled, theme-following SVGs and a
  Storybook board.

Model: claude-opus-5-5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides appended keys at the end of all 8 locale files; kept both sets.
Main lowered the components comment baseline, so the branch condenses five
added prose comments to stay at or under it.

Model: claude-opus-5-5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant