Skip to content

feat(lan): add nearby people from the Share dialog; one mutual add (#262) - #265

Merged
mindaugaskasp merged 1 commit into
mainfrom
feat/lan-add-from-share
Nov 18, 2026
Merged

mindaugaskasp merged 1 commit into
mainfrom
feat/lan-add-from-share

Conversation

@mindaugaskasp

Copy link
Copy Markdown
Owner

Closes #262.

Approved design: https://claude.ai/artifact/XvWgSvNfZ1WEnssqab125D (the Approved design page, signed off 2026-11-18, option A). Spec: specs/2026-11-18-lan-add-from-share/plan.md.

What changes

  • Share dialog: people on your network you haven't added are listed under Nearby, below your people, each with Add. The person you add is ticked and the dialog stays open. With nobody added yet but someone nearby, the picker shows only Nearby. The one-time setup screen now appears only when nobody is nearby.

  • One mutual add: after a correct pairing code, nothing is stored yet. Both screens show the same four-character confirm code:

    • Add (the person being added) stores both keys;
    • Decline, expiry or a dropped connection stores nothing on either side.

    "X added you · Add back" is gone. Settings ▸ Network uses the same flow.

  • Older versions: announcements carry v=2. A v=1 peer is listed with Add disabled and Needs update, in both Share and Settings.

Security

Unchanged up to the code: commit-then-reveal, one guess, a wrong code cancels. The confirm code (confirmCode) is derived from the pairing code. A key swapped in the middle gives the two sides different pairing codes, so the adder's typed code fails before any confirm code appears. The holder stores the adder's key only on Add. The adder stores the holder's key only on accepted, which the holder sends after storing. docs/security.md is updated.

Tests

  • Unit (written to fail first):
    • confirmCode;
    • the confirm stage on both sides (accept stores both keys; decline and expiry store nothing; the adder's store is not lost to the holder's close);
    • v=2 announcements, with v=1 still read;
    • peer versions; needsUpdate; the store's nearby, lastAdded and confirm actions.
  • e2e:
    • the helper now does the whole add in one exchange;
    • new: declining stores nothing on either screen;
    • new: adding from Share ticks the person and keeps the dialog open. I disabled the watcher behind this and confirmed the spec fails at toBeChecked.
  • share.spec turns sharing off to reach the one-time setup. Parallel workers share the network, and their apps showed up as Nearby.
  • Theme sweep: added lan-confirm and share-nearby surfaces. 160 measurements across all 20 themes, all above floor.

Validation

  • npm run check: exit 0, 4998 tests.
  • make e2e: 802 passed, 4 skipped, 1 failed (the share.spec case above). After the fix, share, lan-pairing and lan-send pass 12/12 with two workers.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PJaGuL4V5ghYxXSGoyYU8n

)

Nearby people are listed under your people in the Share dialog, each with
Add, and the person you add is ticked while the dialog stays open. Adding is
now mutual in one exchange: after a correct pairing code both screens show a
four-character confirm code, and the person being added presses Add to store
both keys, or Decline to store nothing. Add back is gone. Announcements carry
v=2; an older peer is listed with Add disabled and "Needs update".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJaGuL4V5ghYxXSGoyYU8n
@mindaugaskasp
mindaugaskasp merged commit 71b3aa7 into main Nov 18, 2026
17 checks passed
@mindaugaskasp
mindaugaskasp deleted the feat/lan-add-from-share branch November 18, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LAN: add nearby people from the Share dialog; one mutual add flow

1 participant