π¬ A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots π
TypeScript browser-extensionchrome-extensiondocumentationfirefox-extensionguide-generatorlocal-firstmanifest-v3privacy-firstproductivityreactscreenshotstep-by-step-guidetutorialtypescriptworkflowwxt
feat(desktop): mount the shared dashboard header and router
Luis Ortizbdcc3f079170
diff --git a/AGENTS.md b/AGENTS.mdindex e89be0c..20f342d 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -609,10 +609,26 @@ because the products differ: the extension records a tab, has no capture mode towide and has to pick between three framings first. Forcing those two shells together makes both worse.Divergence inside the guide is a bug; divergence in how you reach it is not.-The window opens on `HomeScreen`, not on the fullview dashboard. The extension's side panel already-established the shape and the desktop follows it rather than inventing a second one: the mascot, the-question, one primary control, then a search field and the library. `sidepanel_heroTitle` and its-neighbours are reused verbatim, so the two surfaces stay worded the same.+The header is the exception that proves it. `TopNav` is the extension's own dashboard header, moved+into `packages/ui` and mounted by both surfaces, because a header is navigation rather than capture+and there was nothing about it worth diverging on. The desktop had grown its own `TopBar` β a text+wordmark, a gear, and a green "Ready to record" pill β and every part of that was worse: the mascot+is the mark everywhere else, and a pill that only ever says the app is idle is chrome that is never+news. It went, along with the second bar under it, which halved the chrome from 116 px to 64.++`TopNav` takes only a `Route` and reads the rest from `useFullview`, which `GuideContent` already+fills, so the guide title, the step count and the export data arrive with no desktop wiring at all.+Its one desktop-only prop is `onSettings`: the extension has a browser options page and the desktop+does not, so the gear exists here and only on the library route. Moving it brought `SearchModal`,+`ExportPreviewModal`, `VideoStepPlayer` and two search components with it β each needed exactly two+import rewrites, `#imports` to `@mimik/core/env` and `@/core/*` to `@mimik/core/*`, because nothing+in them was ever extension-specific beyond how WXT resolves a module.++Below the header the window opens on `HomeScreen`, not on the fullview dashboard. The extension's+side panel already established that shape and the desktop follows it rather than inventing a second+one: the mascot, the question, one primary control, then a search field and the library.+`sidepanel_heroTitle` and its neighbours are reused verbatim, so the two surfaces stay worded the+same.Pressing Start Capture opens `CaptureSheet` rather than arming immediately. The sheet is where thecapture mode is chosen, because the mode decides what every screenshot in the guide will frame and@@ -635,8 +651,11 @@ letter and tint from a hash without a second query. A desktop guide has no web aonly identity available. Star and delete are always visible rather than revealed on hover, matchingthe side panel; the fullview list hides them until hover and that reads as inert in a window this wide.-Starred and Trash have no route on desktop yet. `LibraryContent` supports both and the home screen-does not reach them.+Routing is `@mimik/ui/fullview/router`, not a hand-rolled `hashchange` listener. The desktop had one+matching `#guide/<id>`, which is the same scheme the shared router already parses, so adopting it+cost nothing and bought Starred and Trash the routes the header needs. `HomeScreen` serves the `all`+category and `LibraryContent` serves the other two, because the hero and Start Capture belong on the+screen you land on and nowhere else.## Capture Settingsdiff --git a/apps/desktop/src/renderer/App.tsx b/apps/desktop/src/renderer/App.tsxindex 280e820..4cec8a3 100644--- a/apps/desktop/src/renderer/App.tsx+++ b/apps/desktop/src/renderer/App.tsx@@ -1,58 +1,52 @@import { TooltipProvider } from '@mimik/ui/components/ui/tooltip';import GuideContent from '@mimik/ui/fullview/GuideContent';+import LibraryContent from '@mimik/ui/fullview/LibraryContent';+import { navigate, useRoute } from '@mimik/ui/fullview/router';+import SearchModal from '@mimik/ui/fullview/SearchModal';+import TopNav from '@mimik/ui/fullview/TopNav';import { useEffect, useState } from 'react';import CaptureSheet from './CaptureSheet';import HomeScreen from './HomeScreen';import SettingsPanel from './SettingsPanel';-import TopBar from './TopBar';export default function App() {- const [guideId, setGuideId] = useState<string | null>(null);+ const route = useRoute();const [settingsOpen, setSettingsOpen] = useState(false);const [sheetOpen, setSheetOpen] = useState(false);- useEffect(() => {- const onHash = () => {- const match = window.location.hash.match(/^#guide\/(.+)$/);- setGuideId(match ? match[1] : null);- };- onHash();- window.addEventListener('hashchange', onHash);- return () => window.removeEventListener('hashchange', onHash);- }, []);-useEffect(() => {window.mimik.capture.onCommand((command, _state, _region, id) => {- if (command === 'stop' && id) {- setSettingsOpen(false);- setSheetOpen(false);- window.location.hash = `#guide/${id}`;- }+ if (command !== 'stop' || !id) return;+ setSettingsOpen(false);+ setSheetOpen(false);+ navigate({ page: 'guide', guideId: id });});}, []);+ const library = route.page === 'library';+return (<TooltipProvider><div className="min-h-screen flex flex-col bg-background">- <TopBar onSettings={() => setSettingsOpen(true)} />+ <TopNav route={route} onSettings={library ? () => setSettingsOpen(true) : undefined} />{settingsOpen ? (<main className="flex-1"><SettingsPanel onClose={() => setSettingsOpen(false)} /></main>- ) : guideId ? (+ ) : route.page === 'guide' ? (<main className="flex-1 py-10 px-6">- <div className="mx-auto max-w-[720px]">- <GuideContent guideId={guideId} />+ <div className="mx-auto max-w-[780px]">+ <GuideContent guideId={route.guideId} initialStepId={route.stepId} initialTool={route.tool} /></div></main>+ ) : route.category === 'all' ? (+ <HomeScreen onOpen={(id) => navigate({ page: 'guide', guideId: id })} onStart={() => setSheetOpen(true)} />) : (- <HomeScreen- onOpen={(id) => {- window.location.hash = `#guide/${id}`;- }}- onStart={() => setSheetOpen(true)}- />+ <main className="flex-1 py-8 px-6">+ <LibraryContent category={route.category} />+ </main>)}+ <SearchModal />{sheetOpen && <CaptureSheet onClose={() => setSheetOpen(false)} />}</div></TooltipProvider>diff --git a/apps/desktop/src/renderer/TopBar.tsx b/apps/desktop/src/renderer/TopBar.tsxdeleted file mode 100644index 51e5479..0000000--- a/apps/desktop/src/renderer/TopBar.tsx+++ /dev/null@@ -1,24 +0,0 @@-import { i18n } from '@mimik/core/env';-import { Settings } from 'lucide-react';--export default function TopBar({ onSettings }: { onSettings(): void }) {- return (- <header className="flex items-center gap-3.5 border-b border-border bg-card px-7 py-3">- <span className="mr-auto text-[17px] font-semibold tracking-tight text-foreground">{i18n.t('app_name')}</span>-- <span className="flex items-center gap-1.5 text-xs font-medium text-muted-foreground">- <span className="size-[7px] rounded-full bg-success" aria-hidden="true" />- {i18n.t('desktop_readyToRecord')}- </span>-- <button- type="button"- aria-label={i18n.t('settings_title')}- onClick={onSettings}- className="flex size-[34px] items-center justify-center rounded-[9px] text-muted-foreground transition-colors hover:bg-secondary hover:text-accent"- >- <Settings size={17} />- </button>- </header>- );-}diff --git a/apps/desktop/tsconfig.json b/apps/desktop/tsconfig.jsonindex 2c2a8cb..d044165 100644--- a/apps/desktop/tsconfig.json+++ b/apps/desktop/tsconfig.json@@ -33,6 +33,7 @@"include": ["src/**/*","scripts/**/*",- "electron.vite.config.ts"+ "electron.vite.config.ts",+ "../../packages/*/src/**/*.d.ts"]}diff --git a/src/types/gifenc.d.ts b/packages/core/src/export/gifenc.d.tssimilarity index 100%rename from src/types/gifenc.d.tsrename to packages/core/src/export/gifenc.d.tsdiff --git a/src/ui/fullview/ExportPreviewModal.tsx b/packages/ui/src/fullview/ExportPreviewModal.tsxsimilarity index 96%rename from src/ui/fullview/ExportPreviewModal.tsxrename to packages/ui/src/fullview/ExportPreviewModal.tsxindex 016ec4f..ba06e10 100644--- a/src/ui/fullview/ExportPreviewModal.tsx+++ b/packages/ui/src/fullview/ExportPreviewModal.tsx@@ -2,9 +2,9 @@ import { Button } from '@mimik/ui/components/ui/button';import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@mimik/ui/components/ui/dialog';import { FileCode, FileDown, FileImage, FileText, Loader2, Video } from 'lucide-react';import { lazy, Suspense, useEffect, useRef, useState } from 'react';-import { i18n } from '#imports';-import { downloadBlob, downloadText, safeFilename } from '@/core/export/download';-import { exportGuideAsHTML } from '@/core/export/html-export';+import { i18n } from '@mimik/core/env';+import { downloadBlob, downloadText, safeFilename } from '@mimik/core/export/download';+import { exportGuideAsHTML } from '@mimik/core/export/html-export';import {DEFAULT_EXPORT_OPTIONS,type ExportOptions,@@ -13,14 +13,14 @@ import {loadExportOptions,saveExportOptions,VIDEO_RESOLUTIONS,-} from '@/core/export/options';-import { exportGuideAsPDF } from '@/core/export/pdf-export';-import { paginatePreview, withPreviewStyles } from '@/core/export/preview';-import type { VideoChapter } from '@/core/export/video-export';-import { canExportVideo, STEP_SECONDS } from '@/core/export/video-support';-import type { Guide, Screenshot, Step } from '@/core/guides/types';+} from '@mimik/core/export/options';+import { exportGuideAsPDF } from '@mimik/core/export/pdf-export';+import { paginatePreview, withPreviewStyles } from '@mimik/core/export/preview';+import type { VideoChapter } from '@mimik/core/export/video-export';+import { canExportVideo, STEP_SECONDS } from '@mimik/core/export/video-support';+import type { Guide, Screenshot, Step } from '@mimik/core/guides/types';-const VideoStepPlayer = lazy(() => import('@/ui/fullview/VideoStepPlayer'));+const VideoStepPlayer = lazy(() => import('./VideoStepPlayer'));const VIDEO_AUTOPLAY_STEP_LIMIT = 25;const IMAGE_SCALES: ImageScale[] = ['small', 'medium', 'large'];diff --git a/src/ui/fullview/SearchModal.tsx b/packages/ui/src/fullview/SearchModal.tsxsimilarity index 96%rename from src/ui/fullview/SearchModal.tsxrename to packages/ui/src/fullview/SearchModal.tsxindex bbd9047..1c0dcb0 100644--- a/src/ui/fullview/SearchModal.tsx+++ b/packages/ui/src/fullview/SearchModal.tsx@@ -4,9 +4,9 @@ import { navigate } from '@mimik/ui/fullview/router';import { useFullview } from '@mimik/ui/stores/fullview';import { Search, X } from 'lucide-react';import { useCallback, useEffect, useRef, useState } from 'react';-import { i18n } from '#imports';-import { getGuideDomain, getGuides } from '@/core/guides/service';-import type { Guide } from '@/core/guides/types';+import { i18n } from '@mimik/core/env';+import { getGuideDomain, getGuides } from '@mimik/core/guides/service';+import type { Guide } from '@mimik/core/guides/types';import KeyboardHints from './components/KeyboardHints';import SearchResults from './components/SearchResults';diff --git a/src/ui/fullview/TopNav.tsx b/packages/ui/src/fullview/TopNav.tsxsimilarity index 91%rename from src/ui/fullview/TopNav.tsxrename to packages/ui/src/fullview/TopNav.tsxindex 445f4f5..fd37b51 100644--- a/src/ui/fullview/TopNav.tsx+++ b/packages/ui/src/fullview/TopNav.tsx@@ -4,14 +4,26 @@ import { navigate } from '@mimik/ui/fullview/router';import { logger } from '@mimik/ui/lib/logger';import MascotIcon from '@mimik/ui/shared/MascotIcon';import { useFullview } from '@mimik/ui/stores/fullview';-import { Check, ChevronRight, Download, FileText, History, Pencil, Search, Star, Trash2 } from 'lucide-react';+import {+ Check,+ ChevronRight,+ Download,+ FileText,+ History,+ Pencil,+ Search,+ SlidersHorizontal,+ Star,+ Trash2,+} from 'lucide-react';import { useState } from 'react';-import { i18n } from '#imports';-import { createSnapshot } from '@/core/guides/service';+import { i18n } from '@mimik/core/env';+import { createSnapshot } from '@mimik/core/guides/service';import ExportPreviewModal from './ExportPreviewModal';interface TopNavProps {route: Route;+ onSettings?: () => void;}const navItems = [@@ -22,7 +34,7 @@ const navItems = [const NAV_CONTROL = 'h-8 rounded-lg border border-border bg-card text-foreground hover:bg-secondary hover:text-accent';-export default function TopNav({ route }: TopNavProps) {+export default function TopNav({ route, onSettings }: TopNavProps) {const {counts,guideTitle,@@ -130,6 +142,11 @@ export default function TopNav({ route }: TopNavProps) {βK</span></Button>+ {onSettings && (+ <Button size="sm" variant="ghost" onClick={onSettings} aria-label={i18n.t('settings_title')} className={NAV_CONTROL}>+ <SlidersHorizontal size={14} />+ </Button>+ )}{route.page === 'guide' && exportData && (<><Button size="sm" variant="ghost" onClick={() => toggleEditing(exportData.guideId)} className={NAV_CONTROL}>diff --git a/src/ui/fullview/VideoStepPlayer.tsx b/packages/ui/src/fullview/VideoStepPlayer.tsxsimilarity index 96%rename from src/ui/fullview/VideoStepPlayer.tsxrename to packages/ui/src/fullview/VideoStepPlayer.tsxindex 4e931d3..ef7e8af 100644--- a/src/ui/fullview/VideoStepPlayer.tsx+++ b/packages/ui/src/fullview/VideoStepPlayer.tsx@@ -8,9 +8,9 @@ import {} from '@vidstack/react';import { ChevronLeft, ChevronRight, Maximize, Minimize, Pause, Play } from 'lucide-react';import { useEffect, useRef } from 'react';-import { i18n } from '#imports';-import type { StepKind, VideoChapter } from '@/core/export/video-export';-import { FRAME_FILL } from '@/core/export/video-support';+import { i18n } from '@mimik/core/env';+import type { StepKind, VideoChapter } from '@mimik/core/export/video-export';+import { FRAME_FILL } from '@mimik/core/export/video-support';const RATES = [1, 1.25, 1.5, 2];diff --git a/src/ui/fullview/components/KeyboardHints.tsx b/packages/ui/src/fullview/components/KeyboardHints.tsxsimilarity index 100%rename from src/ui/fullview/components/KeyboardHints.tsxrename to packages/ui/src/fullview/components/KeyboardHints.tsxdiff --git a/src/ui/fullview/components/SearchResults.tsx b/packages/ui/src/fullview/components/SearchResults.tsxsimilarity index 100%rename from src/ui/fullview/components/SearchResults.tsxrename to packages/ui/src/fullview/components/SearchResults.tsxdiff --git a/src/ui/fullview/App.tsx b/src/ui/fullview/App.tsxindex 3b2dd04..ab963c4 100644--- a/src/ui/fullview/App.tsx+++ b/src/ui/fullview/App.tsx@@ -2,12 +2,12 @@ import { TooltipProvider } from '@mimik/ui/components/ui/tooltip';import GuideContent from '@mimik/ui/fullview/GuideContent';import LibraryContent from '@mimik/ui/fullview/LibraryContent';import { useRoute } from '@mimik/ui/fullview/router';+import SearchModal from '@mimik/ui/fullview/SearchModal';+import TopNav from '@mimik/ui/fullview/TopNav';import { useFullview } from '@mimik/ui/stores/fullview';import { useEffect } from 'react';import UpdateNotice from '@/ui/shared/UpdateNotice';import VoiceNotice from './components/VoiceNotice';-import SearchModal from './SearchModal';-import TopNav from './TopNav';export default function FullViewApp() {const route = useRoute();diff --git a/src/ui/fullview/__tests__/ExportPreviewModal.test.tsx b/src/ui/fullview/__tests__/ExportPreviewModal.test.tsxindex 81073f3..16939ce 100644--- a/src/ui/fullview/__tests__/ExportPreviewModal.test.tsx+++ b/src/ui/fullview/__tests__/ExportPreviewModal.test.tsx@@ -21,7 +21,7 @@ vi.mock('@/core/export/options', async (importOriginal) => ({saveExportOptions: async () => {},}));-import ExportPreviewModal from '@/ui/fullview/ExportPreviewModal';+import ExportPreviewModal from '@mimik/ui/fullview/ExportPreviewModal';const guide: Guide = {id: 'guide-1',