Skip to content

feat(view): camera shows what it read — running Scanned list + real shutter (0.17.0) - #35

Merged
mabry1985 merged 6 commits into
mainfrom
feat/putaway-camera-ui
Nov 11, 2026
Merged

mabry1985 merged 6 commits into
mainfrom
feat/putaway-camera-ui

Conversation

@mabry1985

@mabry1985 mabry1985 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Josh used Put away for real: it worked, but the camera view needed love — no way to see that things were scanning, and the capture animation was poor.

What changes

  • Running list under the video. A Scanned · N strip directly beneath the viewfinder, newest three first, then + N more below. Before, the list sat below a 60vh square, i.e. off-screen on a phone while scanning. Check a bin shows Found · x of y the same way. Only a freshly read row slides in; repaints don't replay it.
  • A real read signal. Quick white shutter flash, the frame snaps green, a pill names the piece on the video, beep + navigator.vibrate where supported. Already scanned → amber pill/frame; a QR that isn't an Inventory label → red shake. prefers-reduced-motion respected.
  • Bug fix. The old flash added a bare hit class to the viewfinder — which is the Stock list's tap-target rule (.hit{display:flex;padding…}), so every read briefly re-laid-out the camera box. Classes are now cam--ok/dup/bad.
  • The drawer holds still. paintDrawer replaced the whole overlay on every repaint, which replayed the kit's bottom-sheet slide-in on every label read (measured live: the sheet jumped ~500 px and came back). An open drawer on the same side is now updated in place; this helps every drawer, not just Put away.
  • Fits a phone sheet. Viewfinder 4:3, max 34vh, frame a centred square; while the camera is on, the instruction moves onto the video. Measured at 390×844: video + strip + list header all inside the sheet.
  • A piece you just scanned and are still holding in view stays quiet (no repeat amber every 2.5 s); a different already-scanned piece goes amber.

Live check (merchantAgent, branch installed)

Real console through the hub at 390×844, Chromium fake camera playing two real item labels (NH-SH-HARROWS, NH-SH-TORMENT): both read → green + pill + Scanned list; re-shown → amber; 80 samples at 150 ms show the sheet no longer moves. Nothing was moved into a bin; the tray was cleared after.

Tests

487 pass (ruff clean). New: feed ordering/cap/escape/animate-only-new under node; no hit class in camera code; all three outcomes signalled; the feed is painted by all three drawers that own the camera.

Draft: UI — needs Josh's on-phone check before merge.

🤖 Generated with Claude Code

mabry1985 and others added 5 commits November 10, 2026 20:46
…d a real shutter (0.17.0)

- Put away: a Scanned strip right under the video, newest three first with a count, so each read
  is visibly in without scrolling past the viewfinder. Check a bin shows Found the same way.
- A read flashes a quick white shutter, snaps the frame green and names the piece in a pill on the
  video (plus a short vibrate where supported). Already scanned is amber, a foreign QR is red.
- Fix: the old success flash added a bare `hit` class, which is the Stock list's tap-target rule
  (display:flex + padding), so every read briefly re-laid-out the viewfinder. Classes are cam--*.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…strip; no amber for the label still in view

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…no longer slides in again on every read

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mabry1985
mabry1985 marked this pull request as ready for review November 11, 2026 05:00
protoreview[bot]
protoreview Bot previously requested changes Nov 11, 2026

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA panel review — FAIL

code-review-structural · head 32d2b19bd1a6 · formal

All four findings were confirmed by the verifier with no changes to severity or substance. The one thing to fix before merge is the camHit logic error at view.py:2064: holding an already-added label in view fires a spurious red "Not added" signal every 2.5 s, contradicting both the code comment and the PR description. The two minor regressions (focus-trap escape in the in-place repaint path, and reduced feedback for strays in Check a bin) are worth addressing but are not merge-blockers. No panel disagreement; no coverage gaps.

Findings

Severity Location Finding Verified
🟠 major view.py:2064 In Put away, holding the piece just read in view makes the final else fire a red 'Not added' error signal every dedupe window, although the code comment says… confirmed
🟡 minor view.py:2451 The new in-place paintDrawer path returns before the old focus handling; pressing a button inside the drawer destroys the focused element and leaves focus on… confirmed
🟡 minor view.py:2053 In Check a bin, a freshly read stray or unknown label used to beep and flash; it now gets only the silent amber "dup" signal, which is documented as "Already s… confirmed
⚪ nit pyproject.toml:1 Missing [build-system] table in pyproject.toml; pip falls back to setuptools implicitly, which can cause issues in strict or minimal CI environments. confirmed
findings JSON (machine-readable)
[
  {
    "file": "view.py",
    "line": 2064,
    "severity": "major",
    "category": "correctness",
    "claim": "In Put away, holding the piece just read in view makes the final `else` fire a red 'Not added' error signal every dedupe window, although the code comment says it should say nothing. Flagged by both correctness and removed-behavior review.",
    "evidence": "else if (had && CAM.lastItem !== lab.id) { camSignal(\"dup\", ...); ... CAM.lastItem = lab.id; }\n      // had, and it's the piece just read: it's still in view, so say nothing\n      else camSignal(\"bad\", PA.note || \"Not added\");  \u2014 when had is true and CAM.lastItem === lab.id the first two branches are skipped and this else runs; paApply has just set PA.note = \"\" so it shows 'Not added'. CAM_DEDUPE_MS = 2500, so a held label re-triggers it every 2.5s.",
    "verdict": "confirmed",
    "note": "Read view.py:2060-2064 at head: the else branch fires camSignal(\"bad\", PA.note || \"Not added\"). Read paApply at line 2141: for an already-listed item it sets PA.note = \"\" (falsy), so the signal shows 'Not added'. The comment on line 2063 says 'say nothing' and the PR description says 'stays quiet', but the code fires a red error signal. CAM_DEDUPE_MS=2500 (line 1880) gates re-fires.",
    "scope": "in-diff"
  },
  {
    "file": "view.py",
    "line": 2451,
    "severity": "minor",
    "category": "removed-behavior",
    "claim": "The new in-place `paintDrawer` path returns before the old focus handling; pressing a button inside the drawer destroys the focused element and leaves focus on `<body>`, so keyboard focus can escape the `aria-modal` drawer.",
    "evidence": "The old rebuild path ended with `if (!top $(\"#overlay-root .pl-drawer\").focus();`. The new early path (`scroll.innerHTML = body; ... scroll.scrollTop = top; return;`) skips it. The Tab trap only acts when `document.activeElement` is the first or last control, or the box (`document.activeElement === first || document.activeElement === box`). With focus on `<body>`, Tab and Shift+Tab are not intercepted, so focus can move to the page behind the `aria-modal` drawer.",
    "verdict": "confirmed",
    "note": "Read paintDrawer at line 421: in-place path does scroll.innerHTML = body then return; without refocusing. Read focus trap at line 2451: intercepts only when activeElement is first/last/box. With focus on <body> after innerHTML replacement, neither condition matches and focus escapes the aria-modal drawer.",
    "line_original": 436,
    "line_corrected": true
  },
  {
    "file": "view.py",
    "line": 2053,
    "severity": "minor",
    "category": "removed-behavior",
    "claim": "In Check a bin, a freshly read stray or unknown label used to beep and flash; it now gets only the silent amber \"dup\" signal, which is documented as \"Already scanned\" but here means \"doesn't belong here\".",
    "evidence": "Old: `if (bcApply(parseLabel(text), text)) { camBeep(); camFlash(); }`. New: `else if (fresh) camSignal(BC.found.has(lab.id) ? \"ok\" : \"dup\", ...)`. `bcApply` returns `fresh` for the `elsewhere`, `loose`, `sold` and `unknown` kinds, and none of those add to `BC.found`, so they all take the silent \"dup\" path.",
    "verdict": "confirmed",
    "note": "Diff shows removed line: `if (bcApply(parseLabel(text), text)) { camBeep(); camFlash(); }`. Read bcApply at line 2253: strays (elsewhere/loose/sold) set fresh=true but don't add to BC.found. Read camSignal at line 1934: only kind==='ok' calls camBeep(). So strays get amber visual but no beep \u2014 a reduction from the old beep+flash.",
    "line_original": 2051,
    "line_corrected": true
  },
  {
    "file": "pyproject.toml",
    "line": 1,
    "severity": "nit",
    "category": "conventions",
    "claim": "Missing [build-system] table in pyproject.toml; pip falls back to setuptools implicitly, which can cause issues in strict or minimal CI environments.",
    "evidence": "The project has a [project] table but no [build-system] table. Per PEP 518, pip falls back to setuptools when no build-system is declared, so the package will still build. However, this is an implicit default that can cause issues in strict environments (e.g., reproducible-build tooling, some CI images that lack setuptools pre-installed, or package managers like uv that require explicit build-system).",
    "source": "protopatch",
    "verdict": "confirmed",
    "note": "Read pyproject.toml at head: has [project], [tool.ruff], [tool.pytest.ini_options] but no [build-system]. Pre-existing condition (PR only bumps version); valid nit."
  }
]

…e drawer, strays beep in Check a bin

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

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA panel review — PASS

code-review-structural · head 771b496aab33 · formal

No findings were raised, so there was nothing to verify. The panel confirmed all three round-1 defects (the "Not added" false positive at view.py:2064, the silent stray beep at view.py:2053, and the focus escape at view.py:2451) are fixed in the residual diff. No new defects surfaced. No coverage gaps.

Prior requests

Prior finding Disposition Why
✅ view.py:2064 fixed The residual diff removes the else-branch that fired the red 'Not added' signal when a piece was already in view; the panel confirmed the fix across all five f…

Findings

Severity Location Finding Verified
⚪ nit pyproject.toml:1 Missing [build-system] table in pyproject.toml; pip falls back to setuptools implicitly, which can cause issues in strict or minimal CI environments. confirmed
findings JSON (machine-readable)
[
  {
    "file": "pyproject.toml",
    "line": 1,
    "severity": "nit",
    "category": "conventions",
    "claim": "Missing [build-system] table in pyproject.toml; pip falls back to setuptools implicitly, which can cause issues in strict or minimal CI environments.",
    "evidence": "The project has a [project] table but no [build-system] table. Per PEP 518, pip falls back to setuptools when no build-system is declared, so the package will still build. However, this is an implicit default that can cause issues in strict environments (e.g., reproducible-build tooling, some CI images that lack setuptools pre-installed, or package managers like uv that require explicit build-system).",
    "source": "protopatch",
    "verdict": "confirmed",
    "note": "Read pyproject.toml at head: has [project], [tool.ruff], [tool.pytest.ini_options] but no [build-system]. Pre-existing condition (PR only bumps version); valid nit. \u2014 carried unchanged: this file is byte-identical to the round that raised it (incremental, #313)",
    "carried": true,
    "carried_by": "incremental",
    "since": "32d2b19bd1a6d68c6430d2f1314268ff2496a527"
  }
]

Incremental re-review (#313): 2 of 7 file(s) changed since head 32d2b19bd1a6 (or depend on a change) and were reviewed. 5 unchanged file(s) were not re-read. 1 finding(s) on them are carried forward unchanged.
Comment @vera review for a full re-review.


Addressed since the last round (1 minor/nit): view.py:2053 — no longer raised, and the PR changed the code around them since they were raised.

@protoreview
protoreview Bot dismissed their stale review November 11, 2026 05:14

Superseded — a later head cleared the QA panel (see the newest verdict).

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promoting the PASS verdict for head 771b496aab33: all checks terminal-green, zero unresolved review threads. (approve-on-green)

Open findings carried by this approval — non-blocking, but they did not go away:

  • nit pyproject.toml:1 — Missing [build-system] table in pyproject.toml; pip falls back to setuptools implicitly, which can cause issues in strict or minimal CI environments.

Approving a WARN does not resolve its findings (issue #22).

@mabry1985
mabry1985 merged commit 56c5dc6 into main Nov 11, 2026
3 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