Repository navigation
refactor(ui): extract the scanner camera lifetime - #53
Merged
Merged
Conversation
Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Move fuda's frontends from Solid to Preact through the owner's
void-preactadapter to adopt their preferred structure and dogfood their library.This layer stacks on #52. Extract the shared camera lifetime while every view still uses Solid, so the next layer can port Scanner without copying its camera loop.
What changed
camera.ts.CameraInputcarries the video and callbacks.CameraSessionreturnsrelease.Scope
Four files in shared UI and its specification. Scanner props, all renderers, and checked-in E2E assertions stay unchanged. The camera module remains internal because no other package imports it yet.
Blast Radius
The gate and the member app's Enter view both use Scanner. Normal scanning keeps its existing behavior. Failure and teardown paths now release resources and discard late callbacks. Returning to a visible page cannot start a second concurrent decode.
Verification
All pnpm commands used
mise x node@24 -- corepack pnpm.pnpm checkpasses. All 846 files correctly formatted; no warnings, lint errors, or type errors in 1019 files.pnpm testpasses. 2,424 Vitest tests and 70 Solidity tests.pnpm fallow:auditpasses. No issues in 19 changed files; dead code, complexity, and duplication findings are all zero.PLAYWRIGHT_BROWSERS_PATH=/tmp/fuda-pw pnpm e2epasses. Gate 7, dash 6, app 6.pnpm --filter @fuda/ui testpasses. 47 tests in 8 files, including all 16 new camera cases./signedsmoke passes with Chromium's fake camera and a fictional session in the isolated E2E database. One decoded code releases the tracks, removes the video, and shows the rejection message. No page errors.git diff --checkpasses. E2E-generated Void lock changes are restored.Local evidence is under
/home/yuji/code/github.com/oboroxyz/fuda-sh/artifacts/2026-11-05-preact-migration/scanner-camera/, including original defect failures, mutation logs and script, full gate logs, and the app smoke script and output.Deploy and manual checks
No deployment. All local verification servers are stopped.
Owner checks remain on real iPhone and iPad Safari cameras in gate and Enter. Confirm rear-camera selection, permission denial, hide/show, release after a scan, and navigation during acquisition. Confirm the physical gate keyboard reader. Automated fake media does not verify real devices or hardware timing.