Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

fix(ui): list state setters as hook dependencies and mark the key checks that run once

Luis Ortiz2c4b56ef9585
diff --git a/packages/ui/src/ai/components/ProviderKeyRow.tsx b/packages/ui/src/ai/components/ProviderKeyRow.tsx
index dccaef3..67fd282 100644
--- a/packages/ui/src/ai/components/ProviderKeyRow.tsx
+++ b/packages/ui/src/ai/components/ProviderKeyRow.tsx
@@ -21,6 +21,7 @@ export function ProviderKeyRow({ provider, value, onChange, validate, bare = fal
const keyCheck = useKeyCheck(validate);
const { check, reset } = keyCheck;
+ // biome-ignore lint/correctness/useExhaustiveDependencies: checks the saved key once, when the screen opens
useEffect(() => {
if (value.trim()) void check(provider, value.trim());
}, []);
diff --git a/packages/ui/src/ai/components/ServerSettings.tsx b/packages/ui/src/ai/components/ServerSettings.tsx
index 6d9bb10..b918e7b 100644
--- a/packages/ui/src/ai/components/ServerSettings.tsx
+++ b/packages/ui/src/ai/components/ServerSettings.tsx
@@ -25,6 +25,7 @@ export function ServerSettings({ server, onChange, validate }: ServerSettingsPro
if (next.url.trim()) void check(next.protocol, next.apiKey.trim(), next.url.trim());
};
+ // biome-ignore lint/correctness/useExhaustiveDependencies: checks the saved key once, when the screen opens
useEffect(() => {
probe(server);
}, []);
diff --git a/packages/ui/src/annotation/components/AnnotationEditor.tsx b/packages/ui/src/annotation/components/AnnotationEditor.tsx
index 5e79a06..c009a6f 100644
--- a/packages/ui/src/annotation/components/AnnotationEditor.tsx
+++ b/packages/ui/src/annotation/components/AnnotationEditor.tsx
@@ -286,7 +286,7 @@ export function AnnotationEditor({ screenshot, tool, onDone, onCancel }: Annotat
}
const b = annotationBounds(sel);
gesture.setAnchor({ x: b.x + b.width / 2, y: b.y + b.height });
- }, [selectedId]);
+ }, [selectedId, gesture.setAnchor]);
useEffect(() => {
localStorage.get(['targetColor']).then((result) => {
diff --git a/packages/ui/src/guide/components/GuideContent.tsx b/packages/ui/src/guide/components/GuideContent.tsx
index c85998d..d3b2c21 100644
--- a/packages/ui/src/guide/components/GuideContent.tsx
+++ b/packages/ui/src/guide/components/GuideContent.tsx
@@ -117,7 +117,7 @@ export function GuideContent({ guideId, initialStepId, initialTool, onCaptureMor
.catch((err) => logger.error(' Transcript lookup failed', err));
setDataVersion((version) => version + 1);
setLoading(false);
- }, [guideId, setGuideTitle, setGuideStepCount, setHasTranscript]);
+ }, [guideId, setGuideTitle, setGuideStepCount, setHasTranscript, desc.set]);
useEffect(() => {
loadGuide();
@@ -130,7 +130,7 @@ export function GuideContent({ guideId, initialStepId, initialTool, onCaptureMor
useEffect(() => {
readAiCredentials().then((keys) => desc.setHasApiKey(keys !== null));
- }, []);
+ }, [desc.setHasApiKey]);
const handleTitleBlur = useCallback(async () => {
const next = sanitizeGuideTitle(title);