fix(scan): repair pre-existing tsc errors so the build is green
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>
This commit is contained in:
@@ -8,6 +8,7 @@ export interface ScanTopControlsModel {
|
||||
canStartAutoScan: boolean;
|
||||
canStartManualScan: boolean;
|
||||
canCaptureSingle: boolean;
|
||||
autoScanRunning: boolean;
|
||||
handleSourceChange: (event: ChangeEvent<HTMLSelectElement>) => void;
|
||||
selectGenshinSource: () => void;
|
||||
openSettings: () => void;
|
||||
@@ -41,7 +42,7 @@ export function useScanTopControlsModel({
|
||||
bridgeReady,
|
||||
isScanning,
|
||||
controller,
|
||||
}: ScanTopControlsSectionProps): ScanTopControlsModel {
|
||||
}: Omit<ScanTopControlsSectionProps, "refreshCaptureSources">): ScanTopControlsModel {
|
||||
const {
|
||||
setSettingsOpen,
|
||||
setDiagnosticsOpen,
|
||||
@@ -116,6 +117,7 @@ export function useScanTopControlsModel({
|
||||
canStartAutoScan: hasSourceSelected && !isScanning && !autoScanRunning && canAutoScan && !requiresAdminForAutoScan,
|
||||
canStartManualScan: hasSourceSelected && !isScanning && !autoScanRunning && canCaptureSource,
|
||||
canCaptureSingle: hasSourceSelected && !isScanning && !autoScanRunning && canCaptureSource,
|
||||
autoScanRunning,
|
||||
handleSourceChange,
|
||||
selectGenshinSource,
|
||||
openSettings,
|
||||
|
||||
Reference in New Issue
Block a user