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: auto-scroll to latest step and strip AI quote wrapping

Luis Ortiz9d9babf73302
diff --git a/src/core/capture/ai/description.ts b/src/core/capture/ai/description.ts
index 7b37cd7..18446fe 100644
--- a/src/core/capture/ai/description.ts
+++ b/src/core/capture/ai/description.ts
@@ -17,7 +17,7 @@ export async function getAIDescription(
prompt: STEP_DESCRIPTION_PROMPT.replace('{{context}}', serializeDOMContext(domContext)),
maxOutputTokens: 50,
});
- return text.trim() || null;
+ return text.trim().replace(/^"|"$/g, '') || null;
} catch (err) {
logger.error('AI description failed, using fallback', err);
return null;
diff --git a/src/core/capture/ai/title.ts b/src/core/capture/ai/title.ts
index b8c3e08..b22c36b 100644
--- a/src/core/capture/ai/title.ts
+++ b/src/core/capture/ai/title.ts
@@ -19,7 +19,7 @@ export async function generateGuideTitle(
prompt: GUIDE_TITLE_PROMPT.replace('{{steps}}', formatted),
maxOutputTokens: 30,
});
- return text.trim() || null;
+ return text.trim().replace(/^"|"$/g, '') || null;
} catch (err) {
logger.error('Guide title generation failed', err);
return null;
diff --git a/src/ui/sidepanel/RecordingView.tsx b/src/ui/sidepanel/RecordingView.tsx
index 863eec3..c3148bf 100644
--- a/src/ui/sidepanel/RecordingView.tsx
+++ b/src/ui/sidepanel/RecordingView.tsx
@@ -59,15 +59,12 @@ export default function RecordingView({ guideId, onStop }: RecordingViewProps) {
}, []);
useEffect(() => {
+ if (steps.length === 0) return;
const scroll = () => bottomRef.current?.scrollIntoView({ behavior: 'smooth' });
scroll();
- const t1 = setTimeout(scroll, 300);
- const t2 = setTimeout(scroll, 800);
- return () => {
- clearTimeout(t1);
- clearTimeout(t2);
- };
- }, []);
+ const t = setTimeout(scroll, 300);
+ return () => clearTimeout(t);
+ }, [steps.length]);
useEffect(() => {
getActiveTab().then((tab) => {