π¬ 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
refactor: replace prop drilling with zustand store and restructure fullview
Luis Ortiz43d76b71c375
diff --git a/src/stores/fullview.ts b/src/stores/fullview.tsnew file mode 100644index 0000000..9d84fbe--- /dev/null+++ b/src/stores/fullview.ts@@ -0,0 +1,51 @@+import { create } from 'zustand';+import type { Guide, Step, Screenshot } from '@/core/guides/types';++interface GuideExportData {+ guideId: string;+ guide: Guide;+ steps: Step[];+ screenshots: Map<string, Screenshot>;+}++interface FullviewStore {+ // Library+ counts: { all: number; starred: number; trash: number };+ setCounts: (counts: { all: number; starred: number; trash: number }) => void;++ // Search modal+ searchOpen: boolean;+ setSearchOpen: (open: boolean) => void;+ toggleSearch: () => void;++ // Guide view+ guideTitle: string;+ setGuideTitle: (title: string) => void;+ guideExportData: GuideExportData | null;+ setGuideExportData: (data: GuideExportData | null) => void;+ scrollToStepId: string | null;+ scrollToStep: (stepId: string) => void;+ activeStepId: string | null;+ setActiveStepId: (id: string | null) => void;+}++export const useFullviewStore = create<FullviewStore>((set) => ({+ counts: { all: 0, starred: 0, trash: 0 },+ setCounts: (counts) => set({ counts }),++ searchOpen: false,+ setSearchOpen: (searchOpen) => set({ searchOpen }),+ toggleSearch: () => set((s) => ({ searchOpen: !s.searchOpen })),++ guideTitle: '',+ setGuideTitle: (guideTitle) => set({ guideTitle }),+ guideExportData: null,+ setGuideExportData: (guideExportData) => set({ guideExportData }),+ scrollToStepId: null,+ scrollToStep: (stepId) => {+ set({ scrollToStepId: stepId });+ setTimeout(() => set({ scrollToStepId: null }), 100);+ },+ activeStepId: null,+ setActiveStepId: (activeStepId) => set({ activeStepId }),+}));diff --git a/src/ui/fullview/App.tsx b/src/ui/fullview/App.tsxindex 0e51931..7f16c43 100644--- a/src/ui/fullview/App.tsx+++ b/src/ui/fullview/App.tsx@@ -1,81 +1,41 @@-import { useState, useCallback, useEffect } from 'react';+import { useEffect } from 'react';import { useRoute } from './router';+import { useFullviewStore } from '@/stores/fullview';import TopNav from './TopNav';import LibraryContent from './LibraryContent';import GuideContent from './GuideContent';import SearchModal from './SearchModal';-import type { Step, Guide, Screenshot } from '@/core/guides/types';export default function FullViewApp() {const route = useRoute();- const [counts, setCounts] = useState({ all: 0, starred: 0, trash: 0 });- const [search, setSearch] = useState('');-- const [guideSteps, setGuideSteps] = useState<Step[]>([]);- const [guideDomain, setGuideDomain] = useState('');- const [guideFavicon, setGuideFavicon] = useState('');- const [guideTitle, setGuideTitle] = useState('');- const [activeStepId, setActiveStepId] = useState<string | null>(null);- const [scrollToStepId, setScrollToStepId] = useState<string | null>(null);- const [guideExportData, setGuideExportData] = useState<{ guideId: string; guide: Guide; steps: Step[]; screenshots: Map<string, Screenshot> } | null>(null);- const [searchOpen, setSearchOpen] = useState(false);+ const toggleSearch = useFullviewStore((s) => s.toggleSearch);useEffect(() => {const handler = (e: KeyboardEvent) => {if ((e.metaKey || e.ctrlKey) && e.key === 'k') {e.preventDefault();- setSearchOpen(prev => !prev);+ toggleSearch();}};window.addEventListener('keydown', handler);return () => window.removeEventListener('keydown', handler);- }, []);-- const handleStepsLoaded = useCallback((steps: Step[], domain: string, favicon: string) => {- setGuideSteps(steps);- setGuideDomain(domain);- setGuideFavicon(favicon);- }, []);-- const handleStepClick = useCallback((stepId: string) => {- setScrollToStepId(stepId);- setTimeout(() => setScrollToStepId(null), 100);- }, []);+ }, [toggleSearch]);return (- <div className="min-h-screen flex flex-col" style={{ background: '#FAFAF8' }}>- <TopNav- route={route}- guideCounts={counts}- guideTitle={route.page === 'guide' ? guideTitle : undefined}- guideData={route.page === 'guide' ? guideExportData ?? undefined : undefined}- search={search}- onSearchChange={setSearch}- onSearchClick={() => setSearchOpen(true)}- />- <SearchModal open={searchOpen} onClose={() => setSearchOpen(false)} />+ <div className="min-h-screen flex flex-col bg-background">+ <TopNav route={route} />+ <SearchModal />{route.page === 'library' && (<main className="flex-1 p-8 max-w-6xl mx-auto w-full">- <LibraryContent- category={route.category}- onCountsChange={setCounts}- searchQuery={search}- />+ <LibraryContent category={route.category} /></main>)}{route.page === 'guide' && (<main className="flex-1 py-10 px-6"><div className="max-w-[720px] mx-auto">- <GuideContent- guideId={route.guideId}- onStepsLoaded={handleStepsLoaded}- scrollToStepId={scrollToStepId}- onActiveStepChange={setActiveStepId}- onTitleChange={setGuideTitle}- onGuideDataLoaded={setGuideExportData}- />+ <GuideContent guideId={route.guideId} /></div></main>)}diff --git a/src/ui/fullview/GuideContent.tsx b/src/ui/fullview/GuideContent.tsxindex ad3401c..6174952 100644--- a/src/ui/fullview/GuideContent.tsx+++ b/src/ui/fullview/GuideContent.tsx@@ -1,16 +1,14 @@-import { useState, useEffect, useCallback, useRef } from 'react';-import { getGuide, updateGuideTitle, updateStepDescription, deleteStep, reorderSteps, updateScreenshotBlob } from '@/core/guides/service';+import { useState, useEffect, useCallback } from 'react';+import { getGuide, updateGuideTitle, updateStepDescription, deleteStep, updateScreenshotBlob } from '@/core/guides/service';import type { Guide, Step, Screenshot } from '@/core/guides/types';-import StepCard from '@/ui/sidepanel/StepCard';+import { useFullviewStore } from '@/stores/fullview';+import { extractDomain } from '@/lib/utils';+import { Input } from '@/ui/components/ui/input';+import GuideStepList from './components/GuideStepList';import BlurCanvas from '@/ui/sidepanel/BlurCanvas';interface GuideContentProps {guideId: string;- onStepsLoaded: (steps: Step[], domain: string, favicon: string) => void;- scrollToStepId: string | null;- onActiveStepChange: (stepId: string | null) => void;- onTitleChange?: (title: string) => void;- onGuideDataLoaded?: (data: { guideId: string; guide: Guide; steps: Step[]; screenshots: Map<string, Screenshot> }) => void;}interface GuideData {@@ -19,21 +17,14 @@ interface GuideData {screenshots: Map<string, Screenshot>;}-function extractDomain(url: string): string {- try { return new URL(url).hostname.replace(/^www\./, ''); } catch { return ''; }-}-function getFaviconUrl(url: string): string {- try { return `https://www.google.com/s2/favicons?domain=${new URL(url).hostname}&sz=32`; } catch { return ''; }-}+export default function GuideContent({ guideId }: GuideContentProps) {+ const setGuideTitle = useFullviewStore((s) => s.setGuideTitle);+ const setGuideExportData = useFullviewStore((s) => s.setGuideExportData);-export default function GuideContent({ guideId, onStepsLoaded, scrollToStepId, onActiveStepChange, onTitleChange, onGuideDataLoaded }: GuideContentProps) {const [data, setData] = useState<GuideData | null>(null);const [loading, setLoading] = useState(true);const [title, setTitle] = useState('');- const [dragIndex, setDragIndex] = useState<number | null>(null);- const [dragOverIndex, setDragOverIndex] = useState<number | null>(null);const [blurringStepId, setBlurringStepId] = useState<string | null>(null);- const stepRefs = useRef<Map<string, HTMLDivElement>>(new Map());const loadGuide = useCallback(async () => {const result = await getGuide(guideId);@@ -41,51 +32,26 @@ export default function GuideContent({ guideId, onStepsLoaded, scrollToStepId, osetData(result);setTitle(result.guide.title);document.title = `${result.guide.title} β Mimik`;- onTitleChange?.(result.guide.title);- onGuideDataLoaded?.({ guideId, guide: result.guide, steps: result.steps, screenshots: result.screenshots });- const firstUrl = result.steps[0]?.url || '';- onStepsLoaded(result.steps, extractDomain(firstUrl), getFaviconUrl(firstUrl));+ setGuideTitle(result.guide.title);+ setGuideExportData({ guideId, ...result });}setLoading(false);- }, [guideId, onStepsLoaded, onTitleChange]);+ }, [guideId, setGuideTitle, setGuideExportData]);useEffect(() => { loadGuide(); }, [loadGuide]);- useEffect(() => {- if (scrollToStepId) {- const el = stepRefs.current.get(scrollToStepId);- el?.scrollIntoView({ behavior: 'smooth', block: 'center' });- }- }, [scrollToStepId]);-- useEffect(() => {- if (!data) return;- const observer = new IntersectionObserver(- (entries) => {- for (const entry of entries) {- if (entry.isIntersecting) {- onActiveStepChange(entry.target.getAttribute('data-step-id'));- }- }- },- { threshold: 0.5 }- );- stepRefs.current.forEach(el => observer.observe(el));- return () => observer.disconnect();- }, [data, onActiveStepChange]);-const handleTitleBlur = useCallback(async () => {if (!data || title === data.guide.title) return;await updateGuideTitle(guideId, title);- setData(prev => prev ? { ...prev, guide: { ...prev.guide, title } } : prev);+ setData((prev) => prev ? { ...prev, guide: { ...prev.guide, title } } : prev);document.title = `${title} β Mimik`;}, [data, guideId, title]);const handleDescriptionChange = useCallback(async (stepId: string, description: string) => {await updateStepDescription(stepId, description);- setData(prev => {+ setData((prev) => {if (!prev) return prev;- return { ...prev, steps: prev.steps.map(s => s.id === stepId ? { ...s, description } : s) };+ return { ...prev, steps: prev.steps.map((s) => s.id === stepId ? { ...s, description } : s) };});}, []);@@ -96,25 +62,23 @@ export default function GuideContent({ guideId, onStepsLoaded, scrollToStepId, oconst handleBlurSave = useCallback(async (blob: Blob) => {if (!blurringStepId || !data) return;- const blurScreenshot = data.screenshots.get(blurringStepId);- if (!blurScreenshot) return;- await updateScreenshotBlob(blurScreenshot.id, blob);- setData(prev => {+ const screenshot = data.screenshots.get(blurringStepId);+ if (!screenshot) return;+ await updateScreenshotBlob(screenshot.id, blob);+ setData((prev) => {if (!prev) return prev;const newScreenshots = new Map(prev.screenshots);- newScreenshots.set(blurringStepId, { ...blurScreenshot, blob });+ newScreenshots.set(blurringStepId, { ...screenshot, blob });return { ...prev, screenshots: newScreenshots };});setBlurringStepId(null);}, [blurringStepId, data]);- if (loading) return <p className="text-sm text-gray-400 py-12 text-center">Loading...</p>;- if (!data) return <p className="text-sm text-red-500 py-12 text-center">Guide not found.</p>;+ if (loading) return <p className="text-sm py-12 text-center text-warm">Loading...</p>;+ if (!data) return <p className="text-sm py-12 text-center text-warm">Guide not found.</p>;+ const domain = extractDomain(data.steps[0]?.url || '');const blurScreenshot = blurringStepId ? data.screenshots.get(blurringStepId) : undefined;- const siteUrl = data.steps[0]?.url || '';- const domain = extractDomain(siteUrl);- const favicon = getFaviconUrl(siteUrl);return (<div>@@ -122,65 +86,28 @@ export default function GuideContent({ guideId, onStepsLoaded, scrollToStepId, o<BlurCanvas screenshot={blurScreenshot} onSave={handleBlurSave} onCancel={() => setBlurringStepId(null)} />)}- {/* Title */}<input- className="text-[32px] font-extrabold bg-transparent border-b-2 border-transparent hover:border-gray-200 focus:outline-none w-full"- style={{ color: '#451a03' }}value={title}- onChange={(e) => { setTitle(e.target.value); onTitleChange?.(e.target.value); }}+ onChange={(e) => { setTitle(e.target.value); setGuideTitle(e.target.value); }}onBlur={handleTitleBlur}- onFocus={(e) => { e.target.style.borderColor = '#F59E0B'; }}- onBlurCapture={(e) => { e.target.style.borderColor = 'transparent'; }}+ className="text-[32px] font-extrabold bg-transparent border-b-2 border-transparent hover:border-border focus:outline-none focus:border-accent w-full p-0 h-auto text-foreground"/>- {/* Meta */}- <p className="text-xs mt-1 mb-8" style={{ color: '#92400E' }}>- Created {new Date(data.guide.createdAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })} Β· {data.steps.length} step{data.steps.length !== 1 ? 's' : ''}{domain ? ` Β· ${domain}` : ''}+ <p className="text-xs mt-1 mb-8 text-muted-foreground">+ Created {new Date(data.guide.createdAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}+ {' Β· '}{data.steps.length} step{data.steps.length !== 1 ? 's' : ''}+ {domain ? ` Β· ${domain}` : ''}</p>- {/* Steps */}- {data.steps.length === 0 ? (- <p className="text-sm text-gray-500 text-center py-12">No steps in this guide.</p>- ) : (- <div className="space-y-6">- {data.steps.map((step, idx) => (- <div- key={step.id}- ref={(el) => { if (el) stepRefs.current.set(step.id, el); else stepRefs.current.delete(step.id); }}- data-step-id={step.id}- >- {dragOverIndex === idx && dragIndex !== null && dragIndex !== idx && (- <div className="h-1 bg-amber-500 rounded-full mx-4 mb-2" />- )}- <StepCard- step={step}- screenshot={data.screenshots.get(step.id)}- onDescriptionChange={handleDescriptionChange}- onDelete={handleDeleteStep}- onBlur={(stepId) => setBlurringStepId(stepId)}- dragHandleProps={{- onDragStart: (e: React.DragEvent) => { setDragIndex(idx); e.dataTransfer.effectAllowed = 'move'; },- onDragOver: (e: React.DragEvent) => { e.preventDefault(); setDragOverIndex(idx); },- onDragEnd: () => {- if (dragIndex !== null && dragOverIndex !== null && dragIndex !== dragOverIndex) {- setData(prev => {- if (!prev) return prev;- const newSteps = [...prev.steps];- const [moved] = newSteps.splice(dragIndex, 1);- newSteps.splice(dragOverIndex, 0, moved);- reorderSteps(guideId, newSteps.map(s => s.id));- return { ...prev, steps: newSteps };- });- }- setDragIndex(null);- setDragOverIndex(null);- },- }}- />- </div>- ))}- </div>- )}+ <GuideStepList+ guideId={guideId}+ steps={data.steps}+ screenshots={data.screenshots}+ onDescriptionChange={handleDescriptionChange}+ onDelete={handleDeleteStep}+ onBlur={(stepId) => setBlurringStepId(stepId)}+ onReorder={(newSteps) => setData((prev) => prev ? { ...prev, steps: newSteps } : prev)}+ /></div>);}diff --git a/src/ui/fullview/GuideOutline.tsx b/src/ui/fullview/GuideOutline.tsxdeleted file mode 100644index d84dc00..0000000--- a/src/ui/fullview/GuideOutline.tsx+++ /dev/null@@ -1,57 +0,0 @@-import type { Step } from '@/core/guides/types';--interface GuideOutlineProps {- steps: Step[];- domain: string;- favicon: string;- activeStepId: string | null;- onStepClick: (stepId: string) => void;-}--export default function GuideOutline({ steps, domain, favicon, activeStepId, onStepClick }: GuideOutlineProps) {- if (steps.length === 0) return null;-- return (- <aside className="w-56 flex-shrink-0 overflow-y-auto p-4" style={{ background: '#fff', borderRight: '1px solid #F0EBE3' }}>- {/* Site info */}- <div className="flex items-center gap-2 pb-3 mb-3" style={{ borderBottom: '1px solid #F0EBE3' }}>- {favicon && (- <img- src={favicon}- alt=""- className="w-5 h-5 rounded"- onError={(e) => { (e.target as HTMLImageElement).style.display = 'none'; }}- />- )}- <span className="text-[12px] font-medium truncate" style={{ color: '#451a03' }}>{domain || 'Guide'}</span>- <span className="text-[10px] ml-auto" style={{ color: '#B5A48B' }}>{steps.length} steps</span>- </div>-- {/* Step outline */}- <nav className="flex flex-col gap-0.5">- {steps.map(step => {- const active = activeStepId === step.id;- return (- <button- key={step.id}- onClick={() => onStepClick(step.id)}- className="w-full text-left px-2.5 py-1.5 rounded-md text-[11px] flex items-center gap-2 transition-colors"- style={{- background: active ? '#FEF3C7' : 'transparent',- color: active ? '#D97706' : '#6B5D40',- fontWeight: active ? 600 : 400,- }}- onMouseEnter={(e) => { if (!active) e.currentTarget.style.background = '#FAFAF8'; }}- onMouseLeave={(e) => { if (!active) e.currentTarget.style.background = active ? '#FEF3C7' : 'transparent'; }}- >- <span className="w-4 text-right flex-shrink-0" style={{ color: active ? '#D97706' : '#B5A48B' }}>- {step.index + 1}.- </span>- <span className="truncate">{step.description}</span>- </button>- );- })}- </nav>- </aside>- );-}diff --git a/src/ui/fullview/LibraryContent.tsx b/src/ui/fullview/LibraryContent.tsxindex 3ade233..3ed05fa 100644--- a/src/ui/fullview/LibraryContent.tsx+++ b/src/ui/fullview/LibraryContent.tsx@@ -1,21 +1,26 @@import { useState, useEffect, useCallback } from 'react';-import { LayoutGrid, LayoutList, Star, Trash2, RotateCcw, FileText } from 'lucide-react';+import { LayoutGrid, LayoutList, FileText } from 'lucide-react';import { getGuides, getStarredGuides, getTrashedGuides, softDeleteGuide, permanentlyDeleteGuide, restoreGuide, toggleStar, getFirstScreenshot } from '@/core/guides/service';import type { Guide, Screenshot } from '@/core/guides/types';-import { navigate } from './router';-import ZoomScreenshot from '@/ui/sidepanel/ZoomScreenshot';+import { useFullviewStore } from '@/stores/fullview';+import { Button } from '@/ui/components/ui/button';+import GuideListView from './components/GuideListView';+import GuideGridView from './components/GuideGridView';interface LibraryContentProps {category: 'all' | 'starred' | 'trash';- onCountsChange: (counts: { all: number; starred: number; trash: number }) => void;- searchQuery?: string;}-function formatDate(ts: number): string {- return new Date(ts).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });-}+const titles: Record<string, string> = { all: 'All Guides', starred: 'Starred', trash: 'Trash' };+const emptyMessages: Record<string, string> = {+ all: 'No guides yet. Start a capture from the Mimik extension.',+ starred: 'No starred guides. Star a guide to find it quickly.',+ trash: 'Trash is empty.',+};++export default function LibraryContent({ category }: LibraryContentProps) {+ const setCounts = useFullviewStore((s) => s.setCounts);-export default function LibraryContent({ category, onCountsChange, searchQuery = '' }: LibraryContentProps) {const [guides, setGuides] = useState<Guide[]>([]);const [thumbnails, setThumbnails] = useState<Map<string, Screenshot>>(new Map());const [loading, setLoading] = useState(true);@@ -25,10 +30,8 @@ export default function LibraryContent({ category, onCountsChange, searchQuery =const loadGuides = useCallback(async () => {setLoading(true);- const [all, starred, trashed] = await Promise.all([- getGuides(), getStarredGuides(), getTrashedGuides(),- ]);- onCountsChange({ all: all.length, starred: starred.length, trash: trashed.length });+ const [all, starred, trashed] = await Promise.all([getGuides(), getStarredGuides(), getTrashedGuides()]);+ setCounts({ all: all.length, starred: starred.length, trash: trashed.length });const current = category === 'starred' ? starred : category === 'trash' ? trashed : all;setGuides(current);@@ -40,7 +43,7 @@ export default function LibraryContent({ category, onCountsChange, searchQuery =}setThumbnails(thumbMap);setLoading(false);- }, [category, onCountsChange]);+ }, [category, setCounts]);useEffect(() => { loadGuides(); }, [loadGuides]);@@ -50,143 +53,42 @@ export default function LibraryContent({ category, onCountsChange, searchQuery =localStorage.setItem('mimik-display', next);};- const filtered = searchQuery- ? guides.filter(g => g.title.toLowerCase().includes(searchQuery.toLowerCase()))- : guides;-- const handleStar = async (e: React.MouseEvent, id: string) => {- e.stopPropagation();- await toggleStar(id);- await loadGuides();- };-- const handleTrash = async (e: React.MouseEvent, id: string) => {- e.stopPropagation();- await softDeleteGuide(id);- await loadGuides();- };-- const handleRestore = async (e: React.MouseEvent, id: string) => {- e.stopPropagation();- await restoreGuide(id);- await loadGuides();- };-+ const handleStar = async (e: React.MouseEvent, id: string) => { e.stopPropagation(); await toggleStar(id); await loadGuides(); };+ const handleTrash = async (e: React.MouseEvent, id: string) => { e.stopPropagation(); await softDeleteGuide(id); await loadGuides(); };+ const handleRestore = async (e: React.MouseEvent, id: string) => { e.stopPropagation(); await restoreGuide(id); await loadGuides(); };const handlePermanentDelete = async (e: React.MouseEvent, id: string) => {e.stopPropagation();if (!window.confirm('Permanently delete this guide? This cannot be undone.')) return;- await permanentlyDeleteGuide(id);- await loadGuides();- };-- const titles: Record<string, string> = { all: 'All Guides', starred: 'Starred', trash: 'Trash' };- const emptyMessages: Record<string, string> = {- all: 'No guides yet. Start a capture from the Mimik extension.',- starred: 'No starred guides. Star a guide to find it quickly.',- trash: 'Trash is empty.',+ await permanentlyDeleteGuide(id); await loadGuides();};return (<div>- {/* Header */}<div className="flex items-center justify-between mb-6">- <h2 className="text-2xl font-bold" style={{ color: '#451a03' }}>{titles[category]}</h2>- <button- onClick={toggleDisplay}- className="p-2 rounded-lg transition-colors"- style={{ border: '1px solid #E8E2DA', color: '#6B5D40' }}- onMouseEnter={(e) => { e.currentTarget.style.background = '#FEF3C7'; }}- onMouseLeave={(e) => { e.currentTarget.style.background = 'transparent'; }}- title={display === 'list' ? 'Grid view' : 'List view'}- >+ <h2 className="text-2xl font-bold text-foreground">{titles[category]}</h2>+ <Button variant="outline" size="icon-sm" onClick={toggleDisplay} title={display === 'list' ? 'Grid view' : 'List view'}>{display === 'list' ? <LayoutGrid size={16} /> : <LayoutList size={16} />}- </button>+ </Button></div>{loading ? (- <p className="text-sm text-gray-400 py-12 text-center">Loading...</p>- ) : filtered.length === 0 ? (+ <p className="text-sm py-12 text-center text-warm">Loading...</p>+ ) : guides.length === 0 ? (<div className="text-center py-20">- <FileText size={40} className="mx-auto text-gray-300 mb-3" />- <p className="text-lg text-gray-500">{searchQuery ? 'No matching guides' : emptyMessages[category]}</p>+ <FileText size={40} className="mx-auto mb-3 text-border" />+ <p className="text-lg text-muted-foreground">{emptyMessages[category]}</p></div>) : display === 'list' ? (- <div className="border border-gray-200 rounded-xl overflow-hidden bg-white">- {filtered.map((guide, idx) => (- <div- key={guide.id}- onClick={() => navigate({ page: 'guide', guideId: guide.id })}- className={`flex items-center px-5 py-3.5 cursor-pointer hover:bg-gray-50 transition-colors group ${- idx < filtered.length - 1 ? 'border-b border-gray-100' : ''- }`}- >- <div className="flex-1 min-w-0">- <p className="text-sm font-medium text-gray-900 truncate">{guide.title}</p>- <p className="text-xs text-gray-400 mt-0.5">- {guide.stepIds.length} step{guide.stepIds.length !== 1 ? 's' : ''} · {formatDate(guide.updatedAt)}- </p>- </div>- <div className="flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">- {category !== 'trash' ? (- <>- <button onClick={(e) => handleStar(e, guide.id)}- className={`p-1.5 rounded-lg hover:bg-gray-100 ${guide.starred ? 'text-yellow-500' : 'text-gray-300 hover:text-yellow-500'}`}- title={guide.starred ? 'Unstar' : 'Star'}>- <Star size={14} fill={guide.starred ? 'currentColor' : 'none'} />- </button>- <button onClick={(e) => handleTrash(e, guide.id)}- className="p-1.5 rounded-lg text-gray-300 hover:text-red-500 hover:bg-red-50"- title="Move to trash">- <Trash2 size={14} />- </button>- </>- ) : (- <>- <button onClick={(e) => handleRestore(e, guide.id)}- className="p-1.5 rounded-lg text-gray-300 hover:text-green-600 hover:bg-green-50"- title="Restore">- <RotateCcw size={14} />- </button>- <button onClick={(e) => handlePermanentDelete(e, guide.id)}- className="p-1.5 rounded-lg text-gray-300 hover:text-red-500 hover:bg-red-50"- title="Delete permanently">- <Trash2 size={14} />- </button>- </>- )}- </div>- </div>- ))}- </div>+ <GuideListView+ guides={guides}+ category={category}+ onStar={handleStar}+ onTrash={handleTrash}+ onRestore={handleRestore}+ onPermanentDelete={handlePermanentDelete}+ />) : (- <div className="grid grid-cols-2 lg:grid-cols-3 gap-4">- {filtered.map(guide => {- const thumb = thumbnails.get(guide.id);- return (- <div- key={guide.id}- onClick={() => navigate({ page: 'guide', guideId: guide.id })}- className="border border-gray-200 rounded-xl bg-white overflow-hidden cursor-pointer hover:shadow-md transition-shadow group"- >- <div className="h-36 bg-gray-100 overflow-hidden">- {thumb ? (- <ZoomScreenshot screenshot={thumb} alt={guide.title} className="!rounded-none !border-0" />- ) : (- <div className="w-full h-full flex items-center justify-center text-gray-300">- <FileText size={32} />- </div>- )}- </div>- <div className="p-3">- <p className="text-sm font-medium text-gray-900 truncate">{guide.title}</p>- <p className="text-xs text-gray-400 mt-0.5">- {guide.stepIds.length} step{guide.stepIds.length !== 1 ? 's' : ''} · {formatDate(guide.updatedAt)}- </p>- </div>- </div>- );- })}- </div>+ <GuideGridView guides={guides} thumbnails={thumbnails} />)}</div>);diff --git a/src/ui/fullview/SearchModal.tsx b/src/ui/fullview/SearchModal.tsxindex a8e11e9..28679df 100644--- a/src/ui/fullview/SearchModal.tsx+++ b/src/ui/fullview/SearchModal.tsx@@ -1,46 +1,32 @@-import { useState, useEffect, useRef, useCallback } from "react";-import { Search, X } from "lucide-react";-import { getGuides, getFirstStepUrl } from "@/core/guides/service";-import type { Guide } from "@/core/guides/types";-import { navigate } from "./router";+import { useState, useEffect, useRef, useCallback } from 'react';+import { Search, X } from 'lucide-react';+import { Dialog, DialogOverlay, DialogPortal } from '@/ui/components/ui/dialog';+import { Input } from '@/ui/components/ui/input';+import { getGuides, getFirstStepUrl } from '@/core/guides/service';+import type { Guide } from '@/core/guides/types';+import { useFullviewStore } from '@/stores/fullview';+import { getFaviconUrl } from '@/lib/utils';+import { navigate } from './router';+import SearchResults from './components/SearchResults';+import KeyboardHints from './components/KeyboardHints';-interface SearchModalProps {- open: boolean;- onClose: () => void;-}+interface GuideResult { guide: Guide; favicon: string }-function getFaviconUrl(url: string): string {- try {- return `https://www.google.com/s2/favicons?domain=${new URL(url).hostname}&sz=32`;- } catch {- return "";- }-}+export default function SearchModal() {+ const open = useFullviewStore((s) => s.searchOpen);+ const setSearchOpen = useFullviewStore((s) => s.setSearchOpen);-function formatDate(ts: number): string {- return new Date(ts).toLocaleDateString("en-US", {- month: "short",- day: "numeric",- });-}--interface GuideResult {- guide: Guide;- favicon: string;-}--export default function SearchModal({ open, onClose }: SearchModalProps) {- const [query, setQuery] = useState("");+ const [query, setQuery] = useState('');const [results, setResults] = useState<GuideResult[]>([]);const [selected, setSelected] = useState(0);const inputRef = useRef<HTMLInputElement>(null);const loadResults = useCallback(async () => {const guides = await getGuides();- const withFavicons: GuideResult[] = await Promise.all(+ const withFavicons = await Promise.all(guides.map(async (guide) => {const url = await getFirstStepUrl(guide.id);- return { guide, favicon: url ? getFaviconUrl(url) : "" };+ return { guide, favicon: url ? getFaviconUrl(url) : '' };}),);setResults(withFavicons);@@ -48,7 +34,7 @@ export default function SearchModal({ open, onClose }: SearchModalProps) {useEffect(() => {if (open) {- setQuery("");+ setQuery('');setSelected(0);loadResults();setTimeout(() => inputRef.current?.focus(), 50);@@ -56,202 +42,58 @@ export default function SearchModal({ open, onClose }: SearchModalProps) {}, [open, loadResults]);const filtered = query- ? results.filter((r) =>- r.guide.title.toLowerCase().includes(query.toLowerCase()),- )+ ? results.filter((r) => r.guide.title.toLowerCase().includes(query.toLowerCase())): results;- const handleSelect = useCallback(- (guideId: string) => {- onClose();- navigate({ page: "guide", guideId });- },- [onClose],- );-- const handleKeyDown = useCallback(- (e: React.KeyboardEvent) => {- if (e.key === "ArrowDown") {- e.preventDefault();- setSelected((s) => Math.min(s + 1, filtered.length - 1));- } else if (e.key === "ArrowUp") {- e.preventDefault();- setSelected((s) => Math.max(s - 1, 0));- } else if (e.key === "Enter") {- e.preventDefault();- if (filtered[selected]) {- handleSelect(filtered[selected].guide.id);- }- } else if (e.key === "Escape") {- onClose();- }- },- [filtered, selected, handleSelect, onClose],- );+ const handleSelect = useCallback((guideId: string) => {+ setSearchOpen(false);+ navigate({ page: 'guide', guideId });+ }, [setSearchOpen]);- if (!open) return null;+ const handleKeyDown = useCallback((e: React.KeyboardEvent) => {+ if (e.key === 'ArrowDown') { e.preventDefault(); setSelected((s) => Math.min(s + 1, filtered.length - 1)); }+ else if (e.key === 'ArrowUp') { e.preventDefault(); setSelected((s) => Math.max(s - 1, 0)); }+ else if (e.key === 'Enter') { e.preventDefault(); if (filtered[selected]) handleSelect(filtered[selected].guide.id); }+ }, [filtered, selected, handleSelect]);return (- <div- className="fixed inset-0 z-50 flex items-center justify-center"- style={{- backdropFilter: "blur(4px)",- WebkitBackdropFilter: "blur(8px)",- background: "rgba(255,255,255,0.1)",- }}- onClick={onClose}- >- <div- className="w-full max-w-[640px] rounded-xl overflow-hidden"- style={{- background: "#fff",- boxShadow: "0 8px 40px rgba(69,26,3,0.15)",- }}- onClick={(e) => e.stopPropagation()}- onKeyDown={handleKeyDown}- >- {/* Input */}- <div- className="flex items-center gap-3 px-4 py-3"- style={{ borderBottom: "1px solid #E8E2DA" }}- >- <Search size={18} style={{ color: "#F59E0B", flexShrink: 0 }} />- <input- ref={inputRef}- type="text"- placeholder="Search guides..."- value={query}- onChange={(e) => {- setQuery(e.target.value);- setSelected(0);- }}- className="flex-1 text-[15px] font-medium outline-none border-0 bg-transparent p-0"- style={{ color: "#451a03", fontFamily: "inherit" }}- />- {query && (- <button- onClick={() => setQuery("")}- className="p-0.5 rounded"- style={{ color: "#B45309" }}- >- <X size={14} />- </button>- )}- </div>-- {/* Results */}- <div className="max-h-[320px] overflow-y-auto py-1">- {filtered.length === 0 ? (- <div className="py-8 text-center">- <p className="text-sm" style={{ color: "#B45309" }}>- {query ? "No matching guides" : "No guides yet"}- </p>- </div>- ) : (- filtered.map((r, i) => (- <div- key={r.guide.id}- className="flex items-center gap-3 px-4 py-2.5 cursor-pointer transition-colors"- style={- i === selected- ? {- background: "#451a03",- borderRadius: "8px",- margin: "0 6px",- padding: "10px 12px",- }- : {}- }- onClick={() => handleSelect(r.guide.id)}- onMouseEnter={() => setSelected(i)}- >- <div- className="w-5 h-5 rounded flex items-center justify-center text-[8px] font-bold flex-shrink-0 overflow-hidden"- style={- i === selected- ? {- background: "rgba(253,230,138,0.15)",- border: "1px solid rgba(253,230,138,0.2)",- color: "#FDE68A",- }- : {- background: "#FEF3C7",- border: "1px solid #E8E2DA",- color: "#92400E",- }- }- >- {r.favicon ? (- <img- src={r.favicon}- alt=""- className="w-3.5 h-3.5"- onError={(e) => {- (e.target as HTMLImageElement).style.display = "none";- }}- />- ) : (- r.guide.title.charAt(0).toUpperCase()- )}- </div>- <div className="flex-1 min-w-0">- <p- className="text-[13px] font-medium truncate"- style={{ color: i === selected ? "#FDE68A" : "#451a03" }}- >- {r.guide.title}- </p>- <p- className="text-[10px] mt-0.5"- style={{- color:- i === selected ? "rgba(253,230,138,0.6)" : "#B45309",- }}- >- {r.guide.stepIds.length} step- {r.guide.stepIds.length !== 1 ? "s" : ""} Β·{" "}- {formatDate(r.guide.updatedAt)}- </p>- </div>- </div>- ))- )}- </div>-- {/* Hints */}- <div- className="flex items-center gap-3 px-4 py-2"- style={{ borderTop: "1px solid #E8E2DA" }}- >- <span- className="text-[9px] font-semibold px-1.5 py-0.5 rounded"- style={{ background: "#FDE68A", color: "#92400E" }}+ <Dialog open={open} onOpenChange={setSearchOpen}>+ <DialogPortal>+ <DialogOverlay className="!bg-transparent backdrop-blur-sm" />+ <div className="fixed inset-0 z-50 flex items-center justify-center" onClick={() => setSearchOpen(false)}>+ <div+ className="w-full max-w-[640px] rounded-xl overflow-hidden bg-card shadow-lg"+ onClick={(e) => e.stopPropagation()}+ onKeyDown={handleKeyDown}>- ββ- </span>- <span className="text-[10px]" style={{ color: "#B45309" }}>- navigate- </span>- <span- className="text-[9px] font-semibold px-1.5 py-0.5 rounded"- style={{ background: "#FDE68A", color: "#92400E" }}- >- β΅- </span>- <span className="text-[10px]" style={{ color: "#B45309" }}>- open- </span>- <span- className="text-[9px] font-semibold px-1.5 py-0.5 rounded"- style={{ background: "#FDE68A", color: "#92400E" }}- >- esc- </span>- <span className="text-[10px]" style={{ color: "#B45309" }}>- close- </span>+ <div className="flex items-center gap-3 px-4 py-3 border-b border-border">+ <Search size={18} className="text-accent shrink-0" />+ <Input+ ref={inputRef}+ placeholder="Search guides..."+ value={query}+ onChange={(e) => { setQuery(e.target.value); setSelected(0); }}+ className="flex-1 text-[15px] font-medium border-0 bg-transparent p-0 shadow-none focus-visible:ring-0 h-auto text-foreground"+ />+ {query && (+ <button onClick={() => setQuery('')} className="p-0.5 rounded text-warm">+ <X size={14} />+ </button>+ )}+ </div>+ <div className="max-h-[320px] overflow-y-auto py-1">+ <SearchResults+ results={filtered}+ query={query}+ selected={selected}+ onSelect={handleSelect}+ onHover={setSelected}+ />+ </div>+ <KeyboardHints />+ </div></div>- </div>- </div>+ </DialogPortal>+ </Dialog>);}diff --git a/src/ui/fullview/Sidebar.tsx b/src/ui/fullview/Sidebar.tsxdeleted file mode 100644index 183dbc7..0000000--- a/src/ui/fullview/Sidebar.tsx+++ /dev/null@@ -1,94 +0,0 @@-import { FileText, Star, Trash2, ArrowLeft } from 'lucide-react';-import type { Route } from './router';-import { navigate } from './router';-import type { Step } from '@/core/guides/types';--interface SidebarProps {- route: Route;- guideCounts: { all: number; starred: number; trash: number };- guideSteps?: Step[];- guideDomain?: string;- guideFavicon?: string;- activeStepId?: string | null;- onStepClick?: (stepId: string) => void;-}--export default function Sidebar({- route, guideCounts, guideSteps, guideDomain, guideFavicon, activeStepId, onStepClick,-}: SidebarProps) {- if (route.page === 'guide' && guideSteps) {- return (- <aside className="w-60 h-screen flex flex-col border-r border-gray-200 bg-white fixed left-0 top-0">- <div className="p-4 border-b border-gray-100">- <button- onClick={() => navigate({ page: 'library', category: 'all' })}- className="flex items-center gap-1.5 text-sm text-gray-500 hover:text-gray-700"- >- <ArrowLeft size={16} />- Back to Library- </button>- </div>- <div className="px-4 pt-4 pb-2 flex items-center gap-2">- {guideFavicon && (- <img src={guideFavicon} alt="" className="w-5 h-5 rounded"- onError={(e) => { (e.target as HTMLImageElement).style.display = 'none'; }} />- )}- <span className="text-sm font-medium text-gray-700 truncate">{guideDomain || 'Guide'}</span>- <span className="text-xs text-gray-400 ml-auto">{guideSteps.length} steps</span>- </div>- <nav className="flex-1 overflow-y-auto px-2 py-2">- {guideSteps.map(step => (- <button- key={step.id}- onClick={() => onStepClick?.(step.id)}- className={`w-full text-left px-3 py-1.5 rounded-md text-sm flex items-center gap-2 transition-colors ${- activeStepId === step.id- ? 'bg-amber-50 text-amber-700'- : 'text-gray-600 hover:bg-gray-50'- }`}- >- <span className="text-xs font-medium text-gray-400 w-4 text-right flex-shrink-0">- {step.index + 1}.- </span>- <span className="truncate">{step.description}</span>- </button>- ))}- </nav>- </aside>- );- }-- const navItems: { key: 'all' | 'starred' | 'trash'; label: string; icon: typeof FileText; count: number }[] = [- { key: 'all', label: 'All Guides', icon: FileText, count: guideCounts.all },- { key: 'starred', label: 'Starred', icon: Star, count: guideCounts.starred },- { key: 'trash', label: 'Trash', icon: Trash2, count: guideCounts.trash },- ];-- return (- <aside className="w-60 h-screen flex flex-col border-r border-gray-200 bg-white fixed left-0 top-0">- <div className="p-5 pb-3">- <h1 className="text-lg font-bold text-gray-900 tracking-tight">Mimik</h1>- </div>- <nav className="flex-1 px-3 py-2">- {navItems.map(item => {- const active = route.page === 'library' && route.category === item.key;- return (- <button- key={item.key}- onClick={() => navigate({ page: 'library', category: item.key })}- className={`w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-colors mb-0.5 ${- active ? 'bg-gray-100 text-gray-900 font-medium' : 'text-gray-600 hover:bg-gray-50'- }`}- >- <item.icon size={16} className={active ? 'text-gray-700' : 'text-gray-400'} />- <span className="flex-1 text-left">{item.label}</span>- {item.count > 0 && (- <span className="text-xs text-gray-400">{item.count}</span>- )}- </button>- );- })}- </nav>- </aside>- );-}diff --git a/src/ui/fullview/TopNav.tsx b/src/ui/fullview/TopNav.tsxindex cb6807b..8c0d79b 100644--- a/src/ui/fullview/TopNav.tsx+++ b/src/ui/fullview/TopNav.tsx@@ -1,168 +1,61 @@-import {- FileText,- Star,- Trash2,- ArrowLeft,- Search,- ChevronRight,-} from "lucide-react";-import type { Route } from "./router";-import { navigate } from "./router";-import type { Guide, Step, Screenshot } from "@/core/guides/types";-import ExportMenu from "@/ui/sidepanel/ExportMenu";--function MascotIcon({ size = 22 }: { size?: number }) {- return (- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="20 50 160 120"- width={size}- height={Math.round((size * 120) / 160)}- style={{ display: "block", flexShrink: 0 }}- >- <rect x="30" y="95" width="140" height="68" rx="5" fill="#451a03" />- <path- d="M30 95 L30 80 Q30 60, 100 60 Q170 60, 170 80 L170 95 Z"- fill="#572508"- />- <rect x="30" y="93" width="140" height="3" fill="#FDE68A" />- <path- d="M68 122 Q76 112 84 122"- stroke="#FDE68A"- strokeWidth="5"- fill="none"- strokeLinecap="round"- />- <path- d="M116 122 Q124 112 132 122"- stroke="#FDE68A"- strokeWidth="5"- fill="none"- strokeLinecap="round"- />- <path- d="M84 138 Q100 148 116 138"- stroke="#FDE68A"- strokeWidth="3.5"- fill="none"- strokeLinecap="round"- />- </svg>- );-}+import { FileText, Star, Trash2, Search, ChevronRight } from 'lucide-react';+import type { Route } from './router';+import { navigate } from './router';+import { useFullviewStore } from '@/stores/fullview';+import { Button } from '@/ui/components/ui/button';+import ExportMenu from '@/ui/sidepanel/ExportMenu';+import MascotIcon from './components/MascotIcon';interface TopNavProps {route: Route;- guideCounts: { all: number; starred: number; trash: number };- guideTitle?: string;- guideData?: {- guideId: string;- guide: Guide;- steps: Step[];- screenshots: Map<string, Screenshot>;- };- search: string;- onSearchChange: (value: string) => void;- onSearchClick?: () => void;}-export default function TopNav({- route,- guideCounts,- guideTitle,- guideData,- search,- onSearchChange,- onSearchClick,-}: TopNavProps) {- const navItems: {- key: "all" | "starred" | "trash";- label: string;- icon: typeof FileText;- count: number;- }[] = [- { key: "all", label: "All Guides", icon: FileText, count: guideCounts.all },- {- key: "starred",- label: "Starred",- icon: Star,- count: guideCounts.starred,- },- { key: "trash", label: "Trash", icon: Trash2, count: guideCounts.trash },- ];+const navItems = [+ { key: 'all' as const, label: 'All Guides', icon: FileText },+ { key: 'starred' as const, label: 'Starred', icon: Star },+ { key: 'trash' as const, label: 'Trash', icon: Trash2 },+];++export default function TopNav({ route }: TopNavProps) {+ const counts = useFullviewStore((s) => s.counts);+ const guideTitle = useFullviewStore((s) => s.guideTitle);+ const exportData = useFullviewStore((s) => s.guideExportData);+ const setSearchOpen = useFullviewStore((s) => s.setSearchOpen);return (- <header- className="flex items-center gap-5 px-7 h-16 flex-shrink-0"- style={{- background: "linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%)",- }}- >- {/* Brand β click to go home */}+ <header className="flex items-center gap-5 px-7 h-16 shrink-0 bg-gradient-to-br from-amber to-amber-light">+ {/* Brand */}<button- onClick={() => navigate({ page: "library", category: "all" })}+ onClick={() => navigate({ page: 'library', category: 'all' })}className="flex items-center gap-2 mr-4 cursor-pointer h-full">- <div className="mb-1">- <MascotIcon size={22} />- </div>- <span- className="text-[15px] font-bold tracking-tight"- style={{ color: "#451a03" }}- >- Mimik- </span>+ <div className="mb-1"><MascotIcon size={22} /></div>+ <span className="text-[15px] font-bold tracking-tight text-foreground">Mimik</span></button>- {route.page === "guide" ? (- <>- {guideTitle && (- <>- <ChevronRight- size={14}- style={{ color: "#451a03", opacity: 0.25 }}- />- <span- className="text-[13px] font-medium truncate max-w-sm"- style={{ color: "#451a03" }}- >- {guideTitle}- </span>- </>- )}- </>+ {route.page === 'guide' ? (+ guideTitle && (+ <>+ <ChevronRight size={14} className="text-foreground opacity-25" />+ <span className="text-[13px] font-medium truncate max-w-sm text-foreground">{guideTitle}</span>+ </>+ )) : (navItems.map((item) => {- const active =- route.page === "library" && route.category === item.key;+ const active = route.page === 'library' && route.category === item.key;+ const count = counts[item.key];return (<buttonkey={item.key}- onClick={() => navigate({ page: "library", category: item.key })}- className="flex items-center gap-1.5 text-[13px] h-8 px-3 rounded-md transition-all"- style={{- color: active ? "#FDE68A" : "#78350F",- background: active ? "#451a03" : "transparent",- fontWeight: active ? 600 : 500,- }}- onMouseEnter={(e) => {- if (!active)- e.currentTarget.style.background = "rgba(69,26,3,0.1)";- }}- onMouseLeave={(e) => {- if (!active) e.currentTarget.style.background = "transparent";- }}+ onClick={() => navigate({ page: 'library', category: item.key })}+ className={`flex items-center gap-1.5 text-[13px] h-8 px-3 rounded-md transition-all+ ${active ? 'bg-primary text-primary-foreground font-semibold' : 'text-brown font-medium hover:bg-foreground/10'}`}><item.icon size={13.5} />{item.label}- {item.count > 0 && (- <span- className="text-[11px] ml-0.5"- style={{- color: active ? "rgba(253,230,138,0.7)" : "#92400E",- }}- >- {item.count}+ {count > 0 && (+ <span className={`text-[11px] ml-0.5 ${active ? 'text-primary-foreground/70' : 'text-amber-dark'}`}>+ {count}</span>)}</button>@@ -172,29 +65,21 @@ export default function TopNav({{/* Right side */}<div className="ml-auto flex items-center gap-3">- <button- onClick={onSearchClick}- className="flex items-center gap-2 px-3 h-8 rounded-lg w-52 cursor-pointer"- style={{ background: "rgba(255,255,255,0.4)", border: 0 }}+ <Button+ variant="ghost"+ onClick={() => setSearchOpen(true)}+ className="flex items-center gap-2 px-3 h-8 rounded-lg w-52 cursor-pointer bg-white/40 border-0 hover:bg-white/60">- <Search- size={14}- className="flex-shrink-0"- style={{ color: "#92400E" }}- />- <span className="text-[12px] flex-1 text-left" style={{ color: "#92400E" }}>- Search guides...- </span>- <span className="text-[9px] font-semibold px-1.5 py-0.5 rounded" style={{ background: "rgba(69,26,3,0.1)", color: "#92400E" }}>- βK- </span>- </button>- {guideData && (+ <Search size={14} className="shrink-0 text-amber-dark" />+ <span className="text-[12px] flex-1 text-left text-amber-dark">Search guides...</span>+ <span className="text-[9px] font-semibold px-1.5 py-0.5 rounded bg-foreground/10 text-amber-dark">βK</span>+ </Button>+ {route.page === 'guide' && exportData && (<ExportMenu- guideId={guideData.guideId}- guide={guideData.guide}- steps={guideData.steps}- screenshots={guideData.screenshots}+ guideId={exportData.guideId}+ guide={exportData.guide}+ steps={exportData.steps}+ screenshots={exportData.screenshots}/>)}</div>diff --git a/src/ui/fullview/components/GuideGridView.tsx b/src/ui/fullview/components/GuideGridView.tsxnew file mode 100644index 0000000..0cf113d--- /dev/null+++ b/src/ui/fullview/components/GuideGridView.tsx@@ -0,0 +1,52 @@+import type { Guide, Screenshot } from '@/core/guides/types';+import { formatDate } from '@/lib/utils';+import { navigate } from '../router';+import ZoomScreenshot from '@/ui/sidepanel/ZoomScreenshot';++function MimikEyes() {+ return (+ <div className="w-full h-full flex items-center justify-center bg-primary">+ <svg width="120" height="50" viewBox="0 0 120 50" fill="none">+ <path d="M15 30 Q27 14 39 30" stroke="#FDE68A" strokeWidth="5" strokeLinecap="round" fill="none" />+ <path d="M81 30 Q93 14 105 30" stroke="#FDE68A" strokeWidth="5" strokeLinecap="round" fill="none" />+ <path d="M39 44 Q60 54 81 44" stroke="#FDE68A" strokeWidth="3.5" strokeLinecap="round" fill="none" />+ </svg>+ </div>+ );+}++interface GuideGridViewProps {+ guides: Guide[];+ thumbnails: Map<string, Screenshot>;+}++export default function GuideGridView({ guides, thumbnails }: GuideGridViewProps) {+ return (+ <div className="grid grid-cols-2 lg:grid-cols-3 gap-4">+ {guides.map((guide) => {+ const thumb = thumbnails.get(guide.id);+ return (+ <div+ key={guide.id}+ onClick={() => navigate({ page: 'guide', guideId: guide.id })}+ className="rounded-xl bg-card overflow-hidden cursor-pointer hover:shadow-md transition-shadow border border-border"+ >+ <div className="h-36 overflow-hidden">+ {thumb ? (+ <ZoomScreenshot screenshot={thumb} alt={guide.title} className="!rounded-none !border-0" />+ ) : (+ <MimikEyes />+ )}+ </div>+ <div className="p-3">+ <p className="text-sm font-medium truncate text-foreground">{guide.title}</p>+ <p className="text-xs mt-0.5 text-muted-foreground">+ {guide.stepIds.length} step{guide.stepIds.length !== 1 ? 's' : ''} · {formatDate(guide.updatedAt)}+ </p>+ </div>+ </div>+ );+ })}+ </div>+ );+}diff --git a/src/ui/fullview/components/GuideListView.tsx b/src/ui/fullview/components/GuideListView.tsxnew file mode 100644index 0000000..b20adeb--- /dev/null+++ b/src/ui/fullview/components/GuideListView.tsx@@ -0,0 +1,74 @@+import { Star, Trash2, RotateCcw } from 'lucide-react';+import type { Guide } from '@/core/guides/types';+import { formatDate } from '@/lib/utils';+import { navigate } from '../router';++interface GuideListViewProps {+ guides: Guide[];+ category: 'all' | 'starred' | 'trash';+ onStar: (e: React.MouseEvent, id: string) => void;+ onTrash: (e: React.MouseEvent, id: string) => void;+ onRestore: (e: React.MouseEvent, id: string) => void;+ onPermanentDelete: (e: React.MouseEvent, id: string) => void;+}++export default function GuideListView({+ guides, category, onStar, onTrash, onRestore, onPermanentDelete,+}: GuideListViewProps) {+ return (+ <div className="rounded-xl overflow-hidden bg-card border border-border">+ {guides.map((guide, idx) => (+ <div+ key={guide.id}+ onClick={() => navigate({ page: 'guide', guideId: guide.id })}+ className="flex items-center px-5 py-3.5 cursor-pointer transition-colors group hover:bg-secondary"+ style={{ borderBottom: idx < guides.length - 1 ? '1px solid var(--color-border)' : undefined }}+ >+ <div className="flex-1 min-w-0">+ <p className="text-sm font-medium truncate text-foreground">{guide.title}</p>+ <p className="text-xs mt-0.5 text-muted-foreground">+ {guide.stepIds.length} step{guide.stepIds.length !== 1 ? 's' : ''} · {formatDate(guide.updatedAt)}+ </p>+ </div>+ <div className="flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">+ {category !== 'trash' ? (+ <>+ <button+ onClick={(e) => onStar(e, guide.id)}+ className="p-1.5 rounded-lg transition-colors text-warm hover:text-accent"+ title={guide.starred ? 'Unstar' : 'Star'}+ >+ <Star size={14} fill={guide.starred ? 'currentColor' : 'none'} />+ </button>+ <button+ onClick={(e) => onTrash(e, guide.id)}+ className="p-1.5 rounded-lg transition-colors text-warm hover:text-red-600"+ title="Move to trash"+ >+ <Trash2 size={14} />+ </button>+ </>+ ) : (+ <>+ <button+ onClick={(e) => onRestore(e, guide.id)}+ className="p-1.5 rounded-lg transition-colors text-warm hover:text-green-600"+ title="Restore"+ >+ <RotateCcw size={14} />+ </button>+ <button+ onClick={(e) => onPermanentDelete(e, guide.id)}+ className="p-1.5 rounded-lg transition-colors text-warm hover:text-red-600"+ title="Delete permanently"+ >+ <Trash2 size={14} />+ </button>+ </>+ )}+ </div>+ </div>+ ))}+ </div>+ );+}diff --git a/src/ui/fullview/components/GuideStepList.tsx b/src/ui/fullview/components/GuideStepList.tsxnew file mode 100644index 0000000..81a0b25--- /dev/null+++ b/src/ui/fullview/components/GuideStepList.tsx@@ -0,0 +1,93 @@+import { useRef, useEffect, useState } from 'react';+import type { Step, Screenshot } from '@/core/guides/types';+import { reorderSteps } from '@/core/guides/service';+import { useFullviewStore } from '@/stores/fullview';+import StepCard from '@/ui/sidepanel/StepCard';++interface GuideStepListProps {+ guideId: string;+ steps: Step[];+ screenshots: Map<string, Screenshot>;+ onDescriptionChange: (stepId: string, description: string) => void;+ onDelete: (stepId: string) => void;+ onBlur: (stepId: string) => void;+ onReorder: (newSteps: Step[]) => void;+}++export default function GuideStepList({+ guideId, steps, screenshots,+ onDescriptionChange, onDelete, onBlur, onReorder,+}: GuideStepListProps) {+ const scrollToStepId = useFullviewStore((s) => s.scrollToStepId);+ const setActiveStepId = useFullviewStore((s) => s.setActiveStepId);++ const [dragIndex, setDragIndex] = useState<number | null>(null);+ const [dragOverIndex, setDragOverIndex] = useState<number | null>(null);+ const stepRefs = useRef<Map<string, HTMLDivElement>>(new Map());++ useEffect(() => {+ if (scrollToStepId) {+ stepRefs.current.get(scrollToStepId)?.scrollIntoView({ behavior: 'smooth', block: 'center' });+ }+ }, [scrollToStepId]);++ useEffect(() => {+ if (steps.length === 0) return;+ const observer = new IntersectionObserver(+ (entries) => {+ for (const entry of entries) {+ if (entry.isIntersecting) {+ setActiveStepId(entry.target.getAttribute('data-step-id'));+ }+ }+ },+ { threshold: 0.5 },+ );+ stepRefs.current.forEach((el) => observer.observe(el));+ return () => observer.disconnect();+ }, [steps, setActiveStepId]);++ const handleDragEnd = () => {+ if (dragIndex !== null && dragOverIndex !== null && dragIndex !== dragOverIndex) {+ const newSteps = [...steps];+ const [moved] = newSteps.splice(dragIndex, 1);+ newSteps.splice(dragOverIndex, 0, moved);+ reorderSteps(guideId, newSteps.map((s) => s.id));+ onReorder(newSteps);+ }+ setDragIndex(null);+ setDragOverIndex(null);+ };++ if (steps.length === 0) {+ return <p className="text-sm text-center py-12 text-warm">No steps in this guide.</p>;+ }++ return (+ <div className="space-y-6">+ {steps.map((step, idx) => (+ <div+ key={step.id}+ ref={(el) => { if (el) stepRefs.current.set(step.id, el); else stepRefs.current.delete(step.id); }}+ data-step-id={step.id}+ >+ {dragOverIndex === idx && dragIndex !== null && dragIndex !== idx && (+ <div className="h-1 bg-accent rounded-full mx-4 mb-2" />+ )}+ <StepCard+ step={step}+ screenshot={screenshots.get(step.id)}+ onDescriptionChange={onDescriptionChange}+ onDelete={onDelete}+ onBlur={onBlur}+ dragHandleProps={{+ onDragStart: (e: React.DragEvent) => { setDragIndex(idx); e.dataTransfer.effectAllowed = 'move'; },+ onDragOver: (e: React.DragEvent) => { e.preventDefault(); setDragOverIndex(idx); },+ onDragEnd: handleDragEnd,+ }}+ />+ </div>+ ))}+ </div>+ );+}diff --git a/src/ui/fullview/components/KeyboardHints.tsx b/src/ui/fullview/components/KeyboardHints.tsxnew file mode 100644index 0000000..b820250--- /dev/null+++ b/src/ui/fullview/components/KeyboardHints.tsx@@ -0,0 +1,20 @@+const hints = [+ { key: 'ββ', label: 'navigate' },+ { key: 'β΅', label: 'open' },+ { key: 'esc', label: 'close' },+];++export default function KeyboardHints() {+ return (+ <div className="flex items-center gap-3 px-4 py-2 border-t border-border">+ {hints.map((h) => (+ <span key={h.key} className="contents">+ <span className="text-[9px] font-semibold px-1.5 py-0.5 rounded bg-gold text-muted-foreground">+ {h.key}+ </span>+ <span className="text-[10px] text-warm">{h.label}</span>+ </span>+ ))}+ </div>+ );+}diff --git a/src/ui/fullview/components/MascotIcon.tsx b/src/ui/fullview/components/MascotIcon.tsxnew file mode 100644index 0000000..e208c07--- /dev/null+++ b/src/ui/fullview/components/MascotIcon.tsx@@ -0,0 +1,18 @@+export default function MascotIcon({ size = 22 }: { size?: number }) {+ return (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="20 50 160 120"+ width={size}+ height={Math.round((size * 120) / 160)}+ className="block shrink-0"+ >+ <rect x="30" y="95" width="140" height="68" rx="5" className="fill-primary" />+ <path d="M30 95 L30 80 Q30 60, 100 60 Q170 60, 170 80 L170 95 Z" className="fill-brown-dark" />+ <rect x="30" y="93" width="140" height="3" className="fill-gold" />+ <path d="M68 122 Q76 112 84 122" className="stroke-gold" strokeWidth="5" fill="none" strokeLinecap="round" />+ <path d="M116 122 Q124 112 132 122" className="stroke-gold" strokeWidth="5" fill="none" strokeLinecap="round" />+ <path d="M84 138 Q100 148 116 138" className="stroke-gold" strokeWidth="3.5" fill="none" strokeLinecap="round" />+ </svg>+ );+}diff --git a/src/ui/fullview/components/SearchResults.tsx b/src/ui/fullview/components/SearchResults.tsxnew file mode 100644index 0000000..9a4b47c--- /dev/null+++ b/src/ui/fullview/components/SearchResults.tsx@@ -0,0 +1,77 @@+import type { Guide } from '@/core/guides/types';+import { formatDateShort } from '@/lib/utils';++interface GuideResult {+ guide: Guide;+ favicon: string;+}++interface SearchResultsProps {+ results: GuideResult[];+ query: string;+ selected: number;+ onSelect: (guideId: string) => void;+ onHover: (index: number) => void;+}++export default function SearchResults({ results, query, selected, onSelect, onHover }: SearchResultsProps) {+ if (results.length === 0) {+ return (+ <div className="py-8 text-center">+ <p className="text-sm text-warm">{query ? 'No matching guides' : 'No guides yet'}</p>+ </div>+ );+ }++ return (+ <>+ {results.map((r, i) => (+ <div+ key={r.guide.id}+ className="flex items-center gap-3 cursor-pointer transition-colors"+ style={+ i === selected+ ? { background: 'var(--color-primary)', borderRadius: '8px', margin: '0 6px', padding: '10px 12px' }+ : { padding: '10px 16px' }+ }+ onClick={() => onSelect(r.guide.id)}+ onMouseEnter={() => onHover(i)}+ >+ <div+ className="w-5 h-5 rounded flex items-center justify-center text-[8px] font-bold shrink-0 overflow-hidden"+ style={+ i === selected+ ? { background: 'rgba(253,230,138,0.15)', border: '1px solid rgba(253,230,138,0.2)', color: 'var(--color-gold)' }+ : { background: 'var(--color-secondary)', border: '1px solid var(--color-border)', color: 'var(--color-muted-foreground)' }+ }+ >+ {r.favicon ? (+ <img+ src={r.favicon}+ alt=""+ className="w-3.5 h-3.5"+ onError={(e) => { (e.target as HTMLImageElement).style.display = 'none'; }}+ />+ ) : (+ r.guide.title.charAt(0).toUpperCase()+ )}+ </div>+ <div className="flex-1 min-w-0">+ <p+ className="text-[13px] font-medium truncate"+ style={{ color: i === selected ? 'var(--color-gold)' : 'var(--color-foreground)' }}+ >+ {r.guide.title}+ </p>+ <p+ className="text-[10px] mt-0.5"+ style={{ color: i === selected ? 'rgba(253,230,138,0.6)' : 'var(--color-warm)' }}+ >+ {r.guide.stepIds.length} step{r.guide.stepIds.length !== 1 ? 's' : ''} Β· {formatDateShort(r.guide.updatedAt)}+ </p>+ </div>+ </div>+ ))}+ </>+ );+}