feat: webcam tables - live stream for players, auto-captured flop with staff confirm #53
[vc]: #CWvO3xu6UCEeb346kGJILbCaUoGwNjXoG82RJCyMzMc=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJwcmVmbG9wLXN0YWdpbmctY29uc29sZSIsInByb2plY3RJZCI6InByal9OMlZWUGJ1ZFpXYWpyYlFYVlI4MFV6aUpCYVB3Iiwicm9vdERpcmVjdG9yeSI6ImFwcHMvY29uc29sZSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9pcmlzZXMtcHJvamVjdHMtY2U1NDlmNjMvcHJlZmxvcC1zdGFnaW5nLWNvbnNvbGUvOXRaWlBVMW9RQng2blJ1NnBlTUNIQjhuZWVqaiIsInByZXZpZXdVcmwiOiJwcmVmbG9wLXN0YWdpbmctY29uc29sZS1naXQtZmVhLTRmMWIwMC1pcmlzZXMtcHJvamVjdHMtY2U1NDlmNjMudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJwcmVmbG9wLXN0YWdpbmctY29uc29sZS1naXQtZmVhLTRmMWIwMC1pcmlzZXMtcHJvamVjdHMtY2U1NDlmNjMudmVyY2VsLmFwcCJ9fSx7Im5hbWUiOiJwcmVmbG9wLXN0YWdpbmctd2ViIiwicHJvamVjdElkIjoicHJqX0VrU3Y2VEtkRkthbE9qWjE4RVhrR2NkRk13b00iLCJyb290RGlyZWN0b3J5IjoiYXBwcy93ZWIiLCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vaXJpc2VzLXByb2plY3RzLWNlNTQ5ZjYzL3ByZWZsb3Atc3RhZ2luZy13ZWIvQzE0WTR3ZjdQOHFSR25OVk1rdzM5NFA0VlpkbyIsInByZ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ZXI9RGFuc2lEYW51dHomcmVwbz1QcmVGbG9wJnByPTUzIn0=
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated |
| :--- | :----- | :------ | :------ |
| <a href="https://vercel.com/irises-projects-ce549f63/preflop-staging-console"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_N2VVPbudZWajrbQXVR80UziJBaPw&teamId=team_Qtajbnyu0ZBt3TGPBIbgiyg1&s=32" width="16" height="16" align="middle" alt="" /></sup></a> preflop-staging-console | !Ready Ready | Preview | <relative-time datetime="2026-11-11T00:04:00.994Z">Nov 11, 2026 12:04am UTC</relative-time> |
<details><summary>3 Skipped Deployments</summary>
| Project | Deployment | Actions | Updated |
| :--- | :----- | :------ | :------ |
| <a href="https://vercel.com/irises-projects-ce549f63/pre-flop"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_vut2f2gIrTFSHr2fHKpzbnxzguZ9&teamId=team_Qtajbnyu0ZBt3TGPBIbgiyg1&s=32" width="16" height="16" align="middle" alt="" /></sup></a> pre-flop | !Skipped Skipped | | <relative-time datetime="2026-11-11T00:04:00.993Z">Nov 11, 2026 12:04am UTC</relative-time> |
| <a href="https://vercel.com/irises-projects-ce549f63/preflop-staging-table"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_Ru8csFXhHa2eZll7oHAlsJnkt3kj&teamId=team_Qtajbnyu0ZBt3TGPBIbgiyg1&s=32" width="16" height="16" align="middle" alt="" /></sup></a> preflop-staging-table | !Skipped Skipped | | <relative-time datetime="2026-11-11T00:04:00.994Z">Nov 11, 2026 12:04am UTC</relative-time> |
| <a href="https://vercel.com/irises-projects-ce549f63/preflop-staging-web"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_EkSv6TKdFKalOjZ18EXkGcdFMwoM&teamId=team_Qtajbnyu0ZBt3TGPBIbgiyg1&s=32" width="16" height="16" align="middle" alt="" /></sup></a> preflop-staging-web | !Skipped Skipped | | <relative-time datetime="2026-11-11T00:04:00.994Z">Nov 11, 2026 12:04am UTC</relative-time> |
</details>
<a href="https://vercel.com/vercel-agent/request-review?owner=DansiDanutz&repo=PreFlop&pr=53" rel="noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://agents-vade-review.vercel.sh/request-review-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://agents-vade-review.vercel.sh/request-review-light.svg"><img src="https://agents-vade-review.vercel.sh/request-review-light.svg" alt="Request Review"></picture></a>
Your trial has ended. Reactivate Greptile to resume code reviews.
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"50fdf2ee18f873edbf6ec20de8fe647418719df0","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->
<details>
<summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-11T00:01:15.227378Z">2026-11-11T00:01:15.227378Z</relative-time> | 50fdf2e | PR opened |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
</details>
</details>
<sub><sub>!P2 Badge</sub></sub> Stop automatic capture when staff manually select a flop
If staff select cards manually while the watcher is still running, a later stable camera reading unconditionally replaces their selection—even if the settlement confirmation dialog is already open. This can undo an operator's correction of a camera misread and change the cards submitted by “Settle and pay” after they opened the dialog. Pause automatic capture once manual editing or confirmation begins, or require explicit acceptance before replacing an existing selection.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<sub><sub>!P2 Badge</sub></sub> Clear the selected device when a remembered camera fails
If the remembered webcam is unplugged or an OBS virtual camera is no longer available, the automatic start fails and clears sessionStorage but leaves deviceId pointing to the unavailable device. Every subsequent “Use webcam” click calls start(deviceId) with the same exact constraint, so an available replacement camera cannot be opened; the camera selector is also hidden until a stream exists. Clear the selected device state or retry without the exact device constraint so staff can recover without reloading the page.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50fdf2ee18
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
</details>
Fixed in bbd9fe0: picking, clearing or applying cards by hand, or opening the settle confirmation, pauses the watcher, and a capture arriving then is ignored, so it never replaces the operator's cards.
_🤖 Addressed by Claude Code_
Fixed in bbd9fe0: when a remembered camera fails to open, the selected device is cleared too, so the next Use webcam opens the default camera.
_🤖 Addressed by Claude Code_
Your trial has ended. Reactivate Greptile to resume code reviews.
DansiDanutz
What
Until the real live-poker capture chain (docs/12) exists, a manual play-money table can now run from a webcam over the table:
youtube-nocookie.comandplayer.twitch.tv; the tablet still frames nothing.manual_flop_snapshots. Each row records the settled cards, the cards the camera read, and who confirmed. The hash is also written to theround.manual_flopaudit entry. Typing by hand still works and stores no snapshot.API
POST /v1/admin/tables/manual{name, stream_url?}PUT /v1/admin/tables/:id/manual/stream{stream_url | null}(admin/ops, manual tables only, audited)POST /v1/admin/tables/:id/manual/flop{…, snapshot?: {image_base64, sha256, read_cards}}GET /v1/tables/:id,/v1/lobbyand the admin list returnstream: {provider, id} | nullTests
stream-link.test.ts(21 link cases) andmanual-stream.test.ts(8 integration tests: stream set/change/remove/audit, refusal of bad links, authorization, snapshot stored, corrected card kept, hash/JPEG/size refusals that leave the hand locked). Full API suite: 409 passed.streamEmbed.test.ts. Web: CSP test and LiveStream render test (170 passed). Console:flopWatch.test.ts(6) andsnapshot.test.ts(2).e2e-manual-table.test.tsnow drives the automatic flow in a real browser: a fake camera shows three cards, the watcher captures them, staff confirm, the hand settles, and the stored JPEG hash matches. It passed locally against the installed Chrome (PLAYWRIGHT_CHROMIUM).Not verified
reader.frame.test.ts: 2 blur cases fail locally on desktop Chrome. The reader code is unchanged here; CI uses Playwright's Chromium.