Auto-scan aborted immediately with "Genshin konnte nicht in den Vordergrund
geholt werden". Root cause: the focus call runs in the background input/capture
helper process, and Windows' foreground lock silently refuses SetForegroundWindow
from a process that is neither foreground nor the last input source. When the user
clicks "Auto-Scan starten" the Electron window is foreground, so the helper's plain
SetForegroundWindow is dropped and focus stays false.
Fix (both the C# sidecar and the PowerShell fallback): before SetForegroundWindow,
attach our thread's input queue to the target (and current-foreground) window
thread with AttachThreadInput and clear SPI_..FOREGROUNDLOCKTIMEOUT, then restore.
This is the same technique Inventory Kamera and other reliable automators use; it
is what our helper was missing after the old ALT-tap workaround was removed on the
wrong assumption that equal integrity level is sufficient (that only covers UIPI
input injection, not foreground changes).
Sidecar recompiled + republished; electron build green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Completes the GOOD interop point end-to-end (the conversion engine landed earlier
in goodInterop.ts). No new IPC needed - reuses the existing artifacts:load /
artifacts:saveMany / good:export bridge.
- Scan controller gains exportGoodFromStore (loadArtifacts -> storedArtifactsToGood
-> exportGood) and importGoodArtifacts (saveMany + snapshot refresh), plus a
canGoodInterop flag.
- DiagnosticsView adds a GOOD Interop card: export the scan store as GOOD, or
import a GOOD file. The file is read in the renderer via a file input +
goodDatabaseToStoredArtifacts, so no file-dialog IPC is required.
Verified in the browser preview after a clean restart: the Diagnose view renders
all cards (Status, Last scan, GOOD Interop, Automation log, Crops/OCR), the
Scan<->Diagnose switch works with no console errors (the earlier hook-order
warnings were stale-HMR artifacts from deleting files mid-session). 120 tests +
build green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reworks the UI so the Scan tab shows only core actions and all developer /
diagnostic surfaces live in one dedicated view.
- New "Diagnose" nav view. ScanView stays mounted for scan|diagnose (the scan
controller state persists across the switch) and renders either the clean
workspace or the new DiagnosticsView by mode.
- DiagnosticsView consolidates runtime/rights, grid detection, learning + data
staleness, fingerprint, auto-scan counters, the automation log, the dev-output
toggle, the Demo-Daten action, and the raw crops/OCR/confidence dump. Reuses
the existing diagnostics/details model hooks.
- Scan workspace decluttered: removed the Scanner Diagnose button and the Details
button, dropped the rules/grid/mode dev fields from the result brief and capture
meta, shortened the topbar headline, and moved Demo-Daten out of the topbar.
- Removed the now-dead ScanDiagnosticsModal / ScanDetailsModal components (their
content moved into the view); metrics grid hidden on the Diagnose view.
- Added dev:web script + .claude/launch.json for browser preview.
Verified in the browser preview (both views render, no console errors); 120
tests + build green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Task #5 building blocks, each a pure + unit-tested module:
- goodInterop.ts: GOOD (Genshin Optimizer / Inventory Kamera / Akasha) import and
export for scanned StoredArtifactRecords - slot/stat/set key maps both ways,
substat string <-> { key, value }, main-value reconstruction on import
(ADR-003). Export is lossless; import is best-effort (GOOD lacks piece names).
- artifactMerge.ts: rescan-merge (ADR-006 follow-up). Level-independent identity
(set + slot + main + substat NAME set) collapses leveled re-scan duplicates,
keeping the higher-level/stronger record and summing timesSeen. Conservative:
differing substat lineups never merge.
- dataPackageStatus.ts: warns when the genshin-db package is older than ~45 days
(a patch cycle) so new sets/characters aren't silently missed; surfaced in the
Scanner Diagnose data-package line. Adds dataGeneratedAt to genshinData.
- lockDetection.ts: EXPERIMENTAL read-only lock-status heuristic (gold-pixel
ratio in a top-right icon crop). Pure + tested but not wired into capture; crop
position and threshold need calibration against a reference 16:9 screenshot.
120 tests + build green. Remaining wiring (needs UI / live calibration): GOOD
import/export buttons and live lock detection.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The scan feature had 16 tsc errors from refactor drift; npm run build failed.
- modals/hooks/* are five levels deep but imported ../../../../lib (four);
corrected to ../../../../../lib.
- useScanDiagnosticsModalModel / useScanReviewQueueModalModel picked
saveReviewSample / canSaveReviewSample / loadReviewQueue from the modal Props,
but the components wire those through from controller.*; source them from the
controller type instead (fixes the downstream unknown-type errors).
- useScanResultCardModel let its field-row tuple array widen to
(string | ParsedField)[][]; annotate it Array<[string, ParsedField]> like the
sibling hook.
- ScanTopControlsModel was missing autoScanRunning (destructured by the
component); add it. useScanTopControlsModel does not use refreshCaptureSources,
so its input is Omit<...,"refreshCaptureSources">.
tsc, vite build, and the electron build all pass; 74 tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Import the existing Electron + React + TypeScript app as the version-control
baseline before the scanner rework (C# input/capture sidecar, resolution-anchored
layout profiles, OCR preprocessing, eval harness, rescan-merge, GOOD interop).
Housekeeping in this commit:
- Remove orphaned temp_inputhelper_block.ts (duplicate of the input-helper script).
- Ignore .claude/scheduled_tasks.lock local session state.
- Add .gitattributes to normalize line endings (LF in repo).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>