chore: initialize repository baseline
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>
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import { useCallback } from "react";
|
||||
import type { CaptureOptions, CaptureResult } from "../../../types/global";
|
||||
import { captureSelectedSourceAction, exportCurrentGoodAction, loadStoredArtifactSnapshotAction, refreshCaptureSourcesAction, runDemoScanAction, showOverlayAction } from "../services/appControllerService";
|
||||
import type { AppControllerContext } from "../services/appControllerService";
|
||||
|
||||
interface AppControllerActionsInput {
|
||||
appControllerContext: AppControllerContext;
|
||||
}
|
||||
|
||||
export interface AppControllerActionsResult {
|
||||
loadStoredArtifactSnapshot: () => Promise<void>;
|
||||
refreshCaptureSources: () => Promise<void>;
|
||||
captureSelectedSource: (delayMs?: number, focusGenshin?: boolean, options?: CaptureOptions) => Promise<CaptureResult | null>;
|
||||
runDemoScan: () => Promise<void>;
|
||||
exportCurrentGood: () => Promise<void>;
|
||||
showOverlay: () => Promise<void>;
|
||||
}
|
||||
|
||||
export function useAppControllerActions({
|
||||
appControllerContext,
|
||||
}: AppControllerActionsInput): AppControllerActionsResult {
|
||||
const loadStoredArtifactSnapshot = useCallback(async () => {
|
||||
await loadStoredArtifactSnapshotAction(appControllerContext);
|
||||
}, [appControllerContext]);
|
||||
|
||||
const refreshCaptureSources = useCallback(async () => {
|
||||
await refreshCaptureSourcesAction(appControllerContext);
|
||||
}, [appControllerContext]);
|
||||
|
||||
const captureSelectedSource = useCallback(async (delayMs = 0, focusGenshin = false, options?: CaptureOptions) => {
|
||||
return captureSelectedSourceAction(appControllerContext, delayMs, focusGenshin, options);
|
||||
}, [appControllerContext]);
|
||||
|
||||
const runDemoScan = useCallback(async () => {
|
||||
await runDemoScanAction(appControllerContext, captureSelectedSource);
|
||||
}, [appControllerContext, captureSelectedSource]);
|
||||
|
||||
const exportCurrentGood = useCallback(async () => {
|
||||
await exportCurrentGoodAction(appControllerContext);
|
||||
}, [appControllerContext]);
|
||||
|
||||
const showOverlay = useCallback(async () => {
|
||||
await showOverlayAction(appControllerContext);
|
||||
}, [appControllerContext]);
|
||||
|
||||
return {
|
||||
loadStoredArtifactSnapshot,
|
||||
refreshCaptureSources,
|
||||
captureSelectedSource,
|
||||
runDemoScan,
|
||||
exportCurrentGood,
|
||||
showOverlay,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user