Skip to content

feat(web): pair page and device list - #235

Merged
i098 merged 4 commits into
fm/sanctum-any-devicefrom
fm/sanctum-anydev-s6
Nov 23, 2026
Merged

i098 merged 4 commits into
fm/sanctum-any-devicefrom
fm/sanctum-anydev-s6

Conversation

@i098

@i098 i098 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Closes #229

Slice S6 of the any-device listener wave: the web pages where a person pairs a hardware listener and sees the devices they have.

What changes

  • /pair (web-app/src/pages/pair/index.tsx, lazy route in main.tsx): a signed-in person types the 8-digit code (?code= fills it), sees the device name and what it has, and approves or denies it. A signed-out visitor gets Sign in to pair, which returns to /pair?code=… through /auth/login?return_to=.
  • The page states: "It records the room while its light is steady or its screen shows listening."
  • Approve shows Paired; Deny shows Not paired. A 404 shows one inline error. The server's 403 lockout (A3) shows the lock message; the page keeps no count. An expired code during approval goes back to code entry with the reason.
  • web-app/src/lib/devices.ts: browser client of DevicesApi, derived from the contract like lib/capture/client.ts. Each failure settles to a named refusal (signed_out, not_found, locked, failed).
  • Menu > Settings > Devices (DevicesSection.tsx, signed in only): name, status and last use per device. Remove asks once (window.confirm, as Access tokens does), then the row shows revoked.

Before and after

Before After
/pair 1440x900
Device found 1440x900 -
Paired 1440x900 -
Settings 1440x900
/pair 390x844
Device found 390x844 -
Paired 390x844 -
Settings 390x844

The fullscreen listening view does not change.

Files outside the slice list

  • web-app/e2e/listen-fake.ts (+2 lines): serveListening answers GET /api/v1/devices with no devices. Without it, Settings in the existing listening specs shows a "Devices could not be read" alert, and listen-signin.spec.ts "a failed sign out" fails on two alerts.
  • changelog.d/229.added.md: the required fragment.

Verification (local, this host)

  • web-app/e2e/pair.spec.ts: 6 passed, against a routed DevicesApi fake (S1 is not merged yet).
  • button-style.spec.ts and listen-signin.spec.ts with this change: all passed. Under host load, button-style "every Menu section" (WorkOS Members) and listen-signin "outside the workspace team" failed once each, then passed alone.
  • web-app/tests/devices-client.test.ts: 4 passed (code input, refusal mapping on a real HTTP server, CSRF header on revoke).
  • npm run check, npm run build -w web-app, npm run quality:fallow -- --base HEAD, npm run quality:sentrux: pass.
  • Not run: the full npm run check:app (whole e2e suite and day replay), because the host is under heavy load and the rules limit runs to this slice's tests. No live server: S1 is not merged.

Review keeps

  • ponytail-review: the CSRF mapRequest in lib/devices.ts repeats 4 lines of lib/capture/client.ts. Kept: a shared helper would touch the capture slice, which this slice does not own.

i098 added 4 commits November 23, 2026 10:06
Add /pair, where a signed-in person types the code that a device
shows, sees what the device has, and approves or denies it. Add
Menu > Settings > Devices with Remove.

Closes #229
- Poll for the existing rise and needle thresholds for up to five seconds.
- Keep the fullscreen view and its audio fixture unchanged.
- Restore the original setup and pixel assertions for both specs.
- Keep the device client off the fullscreen listener startup path.
- Keep the original waveform checks and thresholds.
@i098
i098 merged commit f58fb71 into fm/sanctum-any-device Nov 23, 2026
11 checks passed
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