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(desktop): stop the guide zoom control blanking the window

Luis Ortiz43c952c0f521
diff --git a/AGENTS.md b/AGENTS.md
index ffb60a7..88f4818 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -613,6 +613,12 @@ already at the wanted level, so the pass writes only what changes.
`exportData` guard, so the control appears exactly when the rest of the guide toolbar does. The
extension passes nothing.
+The control is a plain `SelectTrigger`, never `asChild` around a `Button`. `SelectTrigger` renders
+its own chevron beside whatever children it is given, so with `asChild` the `Slot` receives two
+children and throws `React.Children.only`, which unmounts the whole renderer β€” a blank window with
+the guide's name still in the title bar, and nothing in the console of the app itself. `Button` is
+not a `forwardRef` either. Anywhere a Radix trigger needs to look like a button, style the trigger.
+
`zoomLevel` in capture settings overrides the automatic choice; `null` means derive it. Main cannot
value-import core, so `settings.ts` carries its own three-line `snapZoom` rather than the one in
`record.ts` β€” the same constraint that keeps `clamp` local in `capture/screenshot.ts`. The renderer
diff --git a/apps/desktop/src/renderer/GuideZoom.tsx b/apps/desktop/src/renderer/GuideZoom.tsx
index d981ed9..e9c17bf 100644
--- a/apps/desktop/src/renderer/GuideZoom.tsx
+++ b/apps/desktop/src/renderer/GuideZoom.tsx
@@ -1,7 +1,6 @@
import { i18n } from '@mimik/core/env';
import { getGuide, updateScreenshotEdits } from '@mimik/core/guides/service';
import { MAX_ZOOM, MIN_ZOOM, rezoomEdits, ZOOM_STEP } from '@mimik/core/screenshot/record';
-import { Button } from '@mimik/ui/components/ui/button';
import { Select, SelectContent, SelectItem, SelectTrigger } from '@mimik/ui/components/ui/select';
import { ZoomIn } from 'lucide-react';
import { useState } from 'react';
@@ -34,13 +33,10 @@ export default function GuideZoom({ guideId, onDone }: { guideId: string; onDone
<Select disabled={busy} onValueChange={apply}>
<SelectTrigger
aria-label={i18n.t('desktop_zoomLevel')}
- className="h-8 w-auto gap-1.5 rounded-lg border-border bg-card px-3 text-[13px] font-medium hover:bg-secondary"
- asChild
+ className="h-8 w-auto gap-1.5 rounded-lg border-border bg-card px-3 text-[13px] font-medium text-foreground hover:bg-secondary hover:text-accent"
>
- <Button size="sm" variant="ghost">
- <ZoomIn size={14} />
- {i18n.t('desktop_zoomGuide')}
- </Button>
+ <ZoomIn size={14} />
+ {i18n.t('desktop_zoomGuide')}
</SelectTrigger>
<SelectContent>
<SelectItem value="auto">{i18n.t('desktop_zoomAuto')}</SelectItem>