Skip to content

Build the link page locally and move to seal 0.3.0 - #3

Merged
kualta merged 1 commit into
mainfrom
local-link-page
Nov 9, 2026
Merged

kualta merged 1 commit into
mainfrom
local-link-page

Conversation

@kualta

@kualta kualta commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Summary

The plugin now builds NOTE's link page itself and no longer uses an address Flow ID chose. It moves to @flow-industries/seal 0.3.0.

  • Why: a dishonest Flow ID could answer with a verification address on NOTE's own origin whose fragment or query leads to a request of its choosing, such as a passkey request whose code it ground to match the Flow ID code. Checking the origin alone, as 0.1.1 did, let that through.
  • Link page: src/link-page.ts holds NOTE_ORIGIN and linkPageFor(userCode), which returns https://note.flow.talk/link?code=<user code>. The modal's Open, Copy link and the clipboard-failure field all use it.
  • Fewer paths: the old "a verification address elsewhere is shown, never opened" branch is gone, because there is no other address now.
  • One origin: the controller passes noteOrigin: NOTE_ORIGIN to seal's linkDevice, so the prompt's own linkPage uses the same origin.
  • seal 0.3.0: ^0.2.0 -> ^0.3.0.
    • The device builds the link page itself and validates noteOrigin.
    • LinkPrompt.userCode arrives normalized as XXXX-XXXX.
    • Passkey pairing codes are never shaped like a user code.
  • Plugin version: 0.1.1 -> 0.1.2 in manifest.json, package.json and versions.json.
  • Review nits from the previous PR:
    • Starting a new link in the same modal resets the "copy failed" state, and also the auto-open, so the new code's page opens again.
    • README step 3 now reads "Approve from the browser where you use NOTE, such as the one that set up or recovered your notepad." Step 2 says the plugin builds the address itself from the Flow ID code.

Tests

  • tests/link-page.test.ts: the page is https://note.flow.talk/link?code=BCDF-GHJK. User codes carrying #passkey=…, &passkey=1, ../recover?… or //evil.example/… still give NOTE's origin, path /link, no fragment and a single code parameter.
  • tests/e2e.test.ts: seal's in-memory Flow ID answers with its own verification address, note.example. The address the plugin opens and copies is still NOTE's, and it equals the prompt's linkPage.

Testing

All on Bun 1.4.2:

bun x bun@1.4.2 install --frozen-lockfile
bun run lint            # clean
bun run lint:obsidian   # 0 errors (13 warnings, all on lines this PR doesn't touch)
bun run typecheck       # clean
bun test                # 95 pass, 0 fail
bun run build
bun run smoke           # main.js loads, requiring only obsidian and @lezer

Manual check in Obsidian:

  1. Install main.js, manifest.json and styles.css and run Link this vault.
  2. The page that opens, and the one Copy link puts on the clipboard, is https://note.flow.talk/link?code=XXXX-XXXX, with the Flow ID code shown in the modal.
  3. Cancel and link again: the new code's page opens.

Simplify pass

I reviewed the diff against AGENTS.md. Obsidian API use stays in src/obsidian/. The new module is plain TypeScript and is tested under bun test.

  • The validated-or-null linkPage and every if (page) branch are gone, so the modal has one path.
  • There are no new comments beyond the module's doc comment and one WHY line in the e2e test.

I re-ran the full check set after the pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T21:54:34.994767Z 6152082 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kualta
kualta merged commit 818d565 into main Nov 9, 2026
1 check passed
@kualta
kualta deleted the local-link-page branch November 9, 2026 21:58
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.

1 participant