Skip to content

feat(stream): play as the saved profile in the browser - #84

Merged
enricobuehler merged 2 commits into
mainfrom
feat/profile-library-pin-hide
Nov 13, 2026
Merged

enricobuehler merged 2 commits into
mainfrom
feat/profile-library-pin-hide

Conversation

@enricobuehler

@enricobuehler enricobuehler commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Phase 4.4 of the profile-scoped features: the browser client plays as its profile. Both interfaces, the React shell and ?ui=console.

  • The library as the saved pick. GET /library/page and GET /library carry the pick this browser keeps for the host as as. A 404 profile_unknown is asked once more without as and shows no error. The web shell uses any saved pick, the console only one it was told to remember, as for a dial. A pick that moved reads the shelf again.
  • A profile's unlock. The row's unlock word decides: none dials, pin and pin_key ask for the PIN (4 to 8 digits, masked), anything else for the account password. The page holds no unlock key, so every unlock is typed. A profile-locked close reopens the prompt with the host's sentence as sent. The console draws its own screen (prompts_unlock), and what it types never leaves wasm.
  • Hide for me. Only on the shelf read as a pick whose row says person: true. A tile's button hides (PUT /library/hidden/{id}?as=), with Undo; "Hidden for " lists what the profile hides, each with Show. A refusal with a code shows the host's sentence and changes nothing; one without a code is worded by the page. The console gets hides, SetHidden and FetchHidden.
  • Pins both manifests at punktfunk 7ff5eeeed (from 28c312102), in its own commit. The page's messages gain Italian and Brazilian Portuguese with it.

Vectors from punktfunk 7ff5eeeed, copied verbatim and replayed: library-profile-vectors.json (all cases, through the real Host), hide-for-me-vectors.json (all three sections), profile-unlock-vectors.json (unlock_words, gate, after_refusal, pins). Its messages, refused and challenge_answers sections pin what an unlock key signs, and this page holds none.

Two things only a real host showed

  1. On the browser plane the unlock goes behind the auth response, not behind the hello. The host reads the device's AuthResponse with a reader that drops any ProfileUnlock in front of it, then waits 5 s and answers close_lock_pin_unreadable. The hello still announces it (FEATURE_UNLOCK_FOLLOWS); pf_cred_signed sends it. The 2b contract says "right after ClientHello", which holds for the native plane only.
  2. Each dial needs its own "host went silent" clock. The prompt dials again without a reconnect, so the refused dial's clock made the next dial read as a forgotten pairing. A Pending from the host now also holds that clock, which is what an unlock's dial waits on while a profile's desktop starts.

Screenshots

From the real page (Vite dev server, release wasm) against a real host built from punktfunk 7ff5eeeed, on loopback. The host's own sentences, as sent.

PIN prompt Typed, masked
PIN prompt PIN typed
Wrong PIN: the host's line A PIN typed inside the host's wait
Wrong PIN Wait
The library as a profile, with "Hide for Kid" on a tile Hidden, with Undo
Library as Kid Hidden
The hidden shelf with Show A refused hide (403 profile_change_not_allowed)
Hidden list Refused
Who's playing, before the prompt Nothing hidden
Picker None

What the host was asked, from the same run:

GET /api/v1/library/page?limit=200                               no saved pick
GET /api/v1/library/page?limit=200&as=9a0e6849e7b0               the pick, before the PIN: 404 profile_unknown
GET /api/v1/library/page?limit=200                               once more as the box, no error
GET /api/v1/library/page?limit=200&as=9a0e6849e7b0               after the PIN: the profile's shelf
PUT /api/v1/library/hidden/custom:296d034cc611?as=9a0e6849e7b0   200, the title leaves the shelf
GET /api/v1/library/page?limit=200&hidden=true&as=9a0e6849e7b0   the hidden list
PUT /api/v1/library/hidden/custom:cd4c4de9ada3?as=9a0e6849e7b0   403 after the owner signed the device out

Host audit log: profile PIN checked … result="wrong_pin", then result="locked_out" inside the wait, then result="opened", and the device on the lock's list as for_now.

The console interface (?ui=console), same host, same run. The PIN is typed on the console's own screen and crosses to the session inside wasm.

The console's picker marks the locked profiles Its PIN screen, typed, masked
Console picker Console PIN
Wrong PIN: the host's line "Hide for Kid" in a title's options, on the remembered pick's shelf
Console wrong PIN Console hide
Hidden: the neighbour takes focus, the page's line shows The hidden shelf with Show
Console hidden Console hidden list
Shown again
Console shown

States that run could not reach, from the Storybook fixtures (every new story is in the CI screenshot artifact, at both widths):

The password form (a person's own account) The host starts the profile's desktop
Password Opening
The hidden list failed to load With covers
Failed Covers
Phone: wrong PIN Phone: the hidden shelf
Phone PIN Phone hidden

Decisions worth a look

  • The password form is in. The hello offers the unlock for every profile dial, so the host answers an own-account profile with profile-locked too, and the prompt needs both forms. The vectors' unlock_words name both.
  • "Stay signed in on this device" is on the prompt, as on the console's screen and per the 2b contract for a client with no key store.
  • One button, no menu, on a tile. Hide is the only action there, and Undo is on the line that confirms it. It shows with the pointer on the tile, with focus, and always where nothing hovers.
  • A refusal reads in the host's English. Refused carries a message id, and this page words no refusal by id yet, the lock's included.
  • EngineOptions.promptsUnlock: a consumer of @punktfunk/stream that draws no prompt keeps the host's "update" sentence.

Checked

Locally, on the final tree: npm run check, npm test (140 + 19), the Storybook build and its screenshots (78), npm run build (release wasm, emsdk 4.0.9), scripts/pack-gate.sh, npm run cjk-e2e; cargo fmt --check, clippy (native and wasm, -D warnings) and tests for packages/stream and server.

Against the real host, driven by Playwright Chromium, in both interfaces: pairing, the picker, the PIN prompt, a wrong PIN, the wait, the right PIN, the library as the profile, hide, the hidden list, Show. In the web shell also Undo's line and a refused hide; in the console also the library read as the remembered pick only.

After the right PIN the handshake completes: the host logs profile PIN checked … result="opened", video codec negotiated codec=H265, handshake complete — streaming, and the page logs session live.

Not checked

  • A picture after the right PIN. The rig's host ran on macOS, which has no encoder: it ends the session half a second after the handshake ("the software source needs the software encoder, which is Linux-only"). Frames from a locked profile need a Linux or Windows host.
  • A stopped locked seat started by the PIN (Pending for up to three minutes, then the redirect to the seat's plane). The rig's profiles play on the box's own session. The engine's side of it is covered by tests only.
  • The account-password form against a host. It needs a profile on a person's own account, which is Linux only.
  • Safari and Firefox. A real TV.

enricobuehler added 2 commits November 14, 2026 00:21
The stream crates and the server leave 28c312102, so both halves build one
core again. The newer core carries a profile's lock, the console kit's PIN
screen and Hide for me; nothing here turns them on yet.

The page's messages follow the pin: Italian and Brazilian Portuguese ship
with it.
The library is read as the pick this browser keeps for a host. A profile
the host no longer holds, or will not show this device, is read once more
as the box, with no error.

A profile that opens with a PIN or an account password is asked for it
before its dial: the web shell's sheet, or the console's own screen. The
unlock goes behind the device's answer to the host's challenge, where the
browser plane reads it, and is not kept. The host's sentence for one it
refused shows under the field.

A profile's person hides a title from its tile and brings it back from the
list of what the profile hides. The rules replay the monorepo's vectors.
@enricobuehler
enricobuehler merged commit cfa242a into main Nov 13, 2026
8 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