Skip to content

fix: private-room rematch, coach-marks seam, clean sign-out after deletion - #41

Draft
prodelt wants to merge 3 commits into
mainfrom
fix/rematch-and-seams
Draft

prodelt wants to merge 3 commits into
mainfrom
fix/rematch-and-seams

Conversation

@prodelt

@prodelt prodelt commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Draft only — main is frozen for judging. Do not merge.

What

  1. Unit test red on main (architecture). CoachMarks.tsx called document.addEventListener('keydown', …) directly, so tools/architecture.test.ts › "keeps a DOM input event listener behind its seam" failed. The capture-phase listener moved into a new seam, apps/web/src/seams/keys.ts (takeKey). CoachMarks imports it from that file, so it ships in the lazy CoachMarks chunk and the initial bundle stays the same. The architecture test was not changed. Behaviour is the same: Esc closes the guide wherever focus is and the screen never sees it; Enter steps on from the bubble without starting the Home lesson.
  2. «Ще заїзд» after a private room no longer drops friends into public quick match. The first person to press it opens a new private room and broadcasts its code on the old room's channel (rematch event; the existing race_channel_send/receive policy already allows it, so no migration is needed). Anyone still on the results sees «Оля кличе всіх на ще один заїзд.», and the button changes to «Приєднатися» (Enter), which joins by code. If that room can't be joined, a new one is opened instead. Quick-match results behave as before. The decision and its execution live in features/race/rematch.ts and are unit-tested.
  3. No console 403 after «Видалити назавжди». After delete-account the server has no session left, so /auth/v1/logout?scope=local answered 403. For a deleted account the stored session is now dropped before signOut. supabase-js then finds no token, makes no request, and still clears the browser and emits SIGNED_OUT. Ordinary sign-out still calls the server.

Checks (local; Actions is down)

  • pnpm check: typecheck + Biome + 64 files, 831 passed, 3 skipped (the organisers'-snapshot suite, as on main). This includes tools/architecture.test.ts.
  • pnpm build: initial JS 149.2 KB gzip, unchanged from main.
  • New tests: seams/keys.test.ts, app/guide/CoachMarks.test.tsx, features/race/rematch.test.ts, features/race/Results.test.tsx, features/account/auth.test.ts (a real supabase-js client against an in-test fake fetch; no live Supabase).
  • Chromium, by hand, against vite preview with every Supabase HTTP and WebSocket request answered in the page (none reached the project): private results → «Ще заїзд» opened new-room and sent one rematch frame; an incoming invite turned the button into «Приєднатися» and Enter landed in the friend's room with code K7M2PQ; quick results went to quick match. Coach marks: Enter 1/4→2/4 stayed on /, and Esc with focus outside the bubble closed it. No console errors.
  • e2e race.spec.ts non-backend tests (chromium): 2 passed. The @backend specs were not run.

🤖 Generated with Claude Code

prodelt and others added 3 commits October 6, 2026 00:56
CoachMarks listened for keydown on the document directly, which turned
tools/architecture.test.ts red on main. The capture-phase listener now
lives in apps/web/src/seams/keys.ts (takeKey), imported from its own file
so it stays in the lazy CoachMarks chunk. Behaviour is unchanged: Esc
closes the guide wherever focus is and the screen never sees it; Enter
still steps on from the bubble. A component test pins both down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The results' "race again" always called quickMatch, so friends from a
private room were thrown into public quick match. Now a private room's
rematch opens a new private room and broadcasts its code on the old
room's channel ('rematch' event, allowed by the existing realtime
policy); whoever is still on the results sees "<name> calls everyone to
another race" and the button becomes «Приєднатися», which joins by code.
If that room cannot be joined, a new one is opened instead. Quick-match
results behave as before.

The decision and its execution are pure (features/race/rematch.ts) and
unit-tested, along with a Results component test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After delete-account the server has no session left, so signOut's
/auth/v1/logout answered 403 and the browser logged it. For a deleted
account the stored session is dropped first; signOut then finds no
token, makes no request, and still clears this browser and emits
SIGNED_OUT. Ordinary sign-out still ends the session on the server.

Tested with a real supabase-js client against an in-test fake fetch.

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

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
typing-race Ready Ready Preview Oct 5, 2026 10:12pm UTC

This branch was successfully deployed

1 active deployment
Preview — dd545043 Deployed Oct 5, 2026 by vercel[bot]
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