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 πŸ“–

feat: fullview dashboard with full-bleed amber header

Luis Ortiz0c07303d2624
diff --git a/entrypoints/fullview/index.html b/entrypoints/fullview/index.html
new file mode 100644
index 0000000..f1b0fc7
--- /dev/null
+++ b/entrypoints/fullview/index.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Mimik β€” Guide</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="./index.tsx"></script>
+ </body>
+</html>
diff --git a/entrypoints/fullview/index.tsx b/entrypoints/fullview/index.tsx
new file mode 100644
index 0000000..a9cd635
--- /dev/null
+++ b/entrypoints/fullview/index.tsx
@@ -0,0 +1,6 @@
+import React from 'react';
+import ReactDOM from 'react-dom/client';
+import FullViewApp from '../../src/fullview/App';
+import '../../src/sidepanel/index.css';
+
+ReactDOM.createRoot(document.getElementById('root')!).render(<FullViewApp />);
diff --git a/src/fullview/App.tsx b/src/fullview/App.tsx
index a29030f..b02ede2 100644
--- a/src/fullview/App.tsx
+++ b/src/fullview/App.tsx
@@ -1,17 +1,20 @@
import { useState, useCallback } from 'react';
import { useRoute } from './router';
-import Sidebar from './Sidebar';
+import TopNav from './TopNav';
import LibraryContent from './LibraryContent';
import GuideContent from './GuideContent';
+import GuideOutline from './GuideOutline';
import type { Step } from '../shared/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);
@@ -27,31 +30,50 @@ export default function FullViewApp() {
}, []);
return (
- <div className="min-h-screen bg-gray-50">
- <Sidebar
+ <div className="min-h-screen flex flex-col" style={{ background: '#FAFAF8' }}>
+ <TopNav
route={route}
guideCounts={counts}
- guideSteps={route.page === 'guide' ? guideSteps : undefined}
- guideDomain={guideDomain}
- guideFavicon={guideFavicon}
- activeStepId={activeStepId}
- onStepClick={handleStepClick}
+ guideTitle={route.page === 'guide' ? guideTitle : undefined}
+ search={search}
+ onSearchChange={setSearch}
/>
- <main className="ml-60 p-8">
- {route.page === 'library' && (
- <LibraryContent category={route.category} onCountsChange={setCounts} />
- )}
- {route.page === 'guide' && (
- <div className="max-w-3xl">
- <GuideContent
- guideId={route.guideId}
- onStepsLoaded={handleStepsLoaded}
- scrollToStepId={scrollToStepId}
- onActiveStepChange={setActiveStepId}
- />
- </div>
- )}
- </main>
+
+ {route.page === 'library' && (
+ <main className="flex-1 p-8 max-w-6xl mx-auto w-full">
+ <LibraryContent
+ category={route.category}
+ onCountsChange={setCounts}
+ searchQuery={search}
+ />
+ </main>
+ )}
+
+ {route.page === 'guide' && (
+ <div className="flex-1 flex">
+ {/* Step outline panel */}
+ <GuideOutline
+ steps={guideSteps}
+ domain={guideDomain}
+ favicon={guideFavicon}
+ activeStepId={activeStepId}
+ onStepClick={handleStepClick}
+ />
+
+ {/* Guide content */}
+ <main className="flex-1 p-8 overflow-y-auto">
+ <div className="max-w-3xl">
+ <GuideContent
+ guideId={route.guideId}
+ onStepsLoaded={handleStepsLoaded}
+ scrollToStepId={scrollToStepId}
+ onActiveStepChange={setActiveStepId}
+ onTitleChange={setGuideTitle}
+ />
+ </div>
+ </main>
+ </div>
+ )}
</div>
);
}
diff --git a/src/fullview/GuideContent.tsx b/src/fullview/GuideContent.tsx
index 6dbff64..f48da4d 100644
--- a/src/fullview/GuideContent.tsx
+++ b/src/fullview/GuideContent.tsx
@@ -11,6 +11,7 @@ interface GuideContentProps {
onStepsLoaded: (steps: Step[], domain: string, favicon: string) => void;
scrollToStepId: string | null;
onActiveStepChange: (stepId: string | null) => void;
+ onTitleChange?: (title: string) => void;
}
interface GuideData {
@@ -26,7 +27,7 @@ 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, onStepsLoaded, scrollToStepId, onActiveStepChange }: GuideContentProps) {
+export default function GuideContent({ guideId, onStepsLoaded, scrollToStepId, onActiveStepChange, onTitleChange }: GuideContentProps) {
const [data, setData] = useState<GuideData | null>(null);
const [loading, setLoading] = useState(true);
const [title, setTitle] = useState('');
@@ -41,11 +42,12 @@ export default function GuideContent({ guideId, onStepsLoaded, scrollToStepId, o
setData(result);
setTitle(result.guide.title);
document.title = `${result.guide.title} β€” Mimik`;
+ onTitleChange?.(result.guide.title);
const firstUrl = result.steps[0]?.url || '';
onStepsLoaded(result.steps, extractDomain(firstUrl), getFaviconUrl(firstUrl));
}
setLoading(false);
- }, [guideId, onStepsLoaded]);
+ }, [guideId, onStepsLoaded, onTitleChange]);
useEffect(() => { loadGuide(); }, [loadGuide]);
@@ -137,7 +139,7 @@ export default function GuideContent({ guideId, onStepsLoaded, scrollToStepId, o
{/* Title */}
<input
- className="text-3xl font-bold bg-transparent border-b-2 border-transparent hover:border-gray-300 focus:border-blue-500 focus:outline-none w-full mb-6"
+ className="text-3xl font-bold bg-transparent border-b-2 border-transparent hover:border-gray-300 focus:border-amber-500 focus:outline-none w-full mb-6"
value={title}
onChange={(e) => setTitle(e.target.value)}
onBlur={handleTitleBlur}
@@ -163,7 +165,7 @@ export default function GuideContent({ guideId, onStepsLoaded, scrollToStepId, o
data-step-id={step.id}
>
{dragOverIndex === idx && dragIndex !== null && dragIndex !== idx && (
- <div className="h-1 bg-blue-500 rounded-full mx-4 mb-2" />
+ <div className="h-1 bg-amber-500 rounded-full mx-4 mb-2" />
)}
<StepCard
step={step}
diff --git a/src/fullview/GuideOutline.tsx b/src/fullview/GuideOutline.tsx
new file mode 100644
index 0000000..1d65d45
--- /dev/null
+++ b/src/fullview/GuideOutline.tsx
@@ -0,0 +1,57 @@
+import type { Step } from '../shared/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/fullview/LibraryContent.tsx b/src/fullview/LibraryContent.tsx
index 9406cb9..5176a7c 100644
--- a/src/fullview/LibraryContent.tsx
+++ b/src/fullview/LibraryContent.tsx
@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback } from 'react';
-import { LayoutGrid, LayoutList, Star, Trash2, RotateCcw, Search, FileText } from 'lucide-react';
+import { LayoutGrid, LayoutList, Star, Trash2, RotateCcw, FileText } from 'lucide-react';
import { getGuides, getStarredGuides, getTrashedGuides, softDeleteGuide, permanentlyDeleteGuide, restoreGuide, toggleStar, getFirstScreenshot } from '../shared/guide-service';
import type { Guide, Screenshot } from '../shared/types';
import { navigate } from './router';
@@ -8,17 +8,17 @@ import ZoomScreenshot from '../sidepanel/ZoomScreenshot';
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' });
}
-export default function LibraryContent({ category, onCountsChange }: LibraryContentProps) {
+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);
- const [search, setSearch] = useState('');
const [display, setDisplay] = useState<'list' | 'grid'>(() =>
(localStorage.getItem('mimik-display') as 'list' | 'grid') || 'list'
);
@@ -50,8 +50,8 @@ export default function LibraryContent({ category, onCountsChange }: LibraryCont
localStorage.setItem('mimik-display', next);
};
- const filtered = search
- ? guides.filter(g => g.title.toLowerCase().includes(search.toLowerCase()))
+ const filtered = searchQuery
+ ? guides.filter(g => g.title.toLowerCase().includes(searchQuery.toLowerCase()))
: guides;
const handleStar = async (e: React.MouseEvent, id: string) => {
@@ -90,26 +90,17 @@ export default function LibraryContent({ category, onCountsChange }: LibraryCont
<div>
{/* Header */}
<div className="flex items-center justify-between mb-6">
- <h2 className="text-2xl font-bold text-gray-900">{titles[category]}</h2>
- <div className="flex items-center gap-2">
- <div className="relative">
- <Search size={16} className="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400" />
- <input
- type="text"
- placeholder="Search guides..."
- value={search}
- onChange={(e) => setSearch(e.target.value)}
- className="pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:border-blue-500 w-56"
- />
- </div>
- <button
- onClick={toggleDisplay}
- className="p-2 rounded-lg border border-gray-200 text-gray-500 hover:bg-gray-50"
- title={display === 'list' ? 'Grid view' : 'List view'}
- >
- {display === 'list' ? <LayoutGrid size={16} /> : <LayoutList size={16} />}
- </button>
- </div>
+ <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'}
+ >
+ {display === 'list' ? <LayoutGrid size={16} /> : <LayoutList size={16} />}
+ </button>
</div>
{loading ? (
diff --git a/src/fullview/TopNav.tsx b/src/fullview/TopNav.tsx
new file mode 100644
index 0000000..53f9cb4
--- /dev/null
+++ b/src/fullview/TopNav.tsx
@@ -0,0 +1,112 @@
+import { FileText, Star, Trash2, ArrowLeft, Search } from 'lucide-react';
+import type { Route } from './router';
+import { navigate } from './router';
+
+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)}>
+ <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>
+ );
+}
+
+interface TopNavProps {
+ route: Route;
+ guideCounts: { all: number; starred: number; trash: number };
+ guideTitle?: string;
+ search: string;
+ onSearchChange: (value: string) => void;
+}
+
+export default function TopNav({ route, guideCounts, guideTitle, search, onSearchChange }: 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 },
+ ];
+
+ return (
+ <header
+ className="flex items-center gap-5 px-7 h-14 flex-shrink-0"
+ style={{ background: 'linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%)' }}
+ >
+ {/* Brand β€” click to go home */}
+ <button
+ onClick={() => navigate({ page: 'library', category: 'all' })}
+ className="flex items-center gap-2.5 mr-4 cursor-pointer"
+ >
+ <MascotIcon size={26} />
+ <span className="text-[16px] font-bold tracking-tight" style={{ color: '#451a03' }}>Mimik</span>
+ </button>
+
+ {route.page === 'guide' ? (
+ /* Guide mode: back button + guide title */
+ <>
+ <button
+ onClick={() => navigate({ page: 'library', category: 'all' })}
+ className="flex items-center gap-1.5 text-[13px] font-medium rounded-md px-3 py-1.5 transition-colors"
+ style={{ color: '#78350F' }}
+ onMouseEnter={(e) => { e.currentTarget.style.background = 'rgba(255,255,255,0.3)'; }}
+ onMouseLeave={(e) => { e.currentTarget.style.background = 'transparent'; }}
+ >
+ <ArrowLeft size={15} />
+ All Guides
+ </button>
+ {guideTitle && (
+ <>
+ <span style={{ color: '#92400E' }} className="text-xs">&gt;</span>
+ <span className="text-[13px] font-medium truncate max-w-xs" style={{ color: '#451a03' }}>
+ {guideTitle}
+ </span>
+ </>
+ )}
+ </>
+ ) : (
+ /* Library mode: nav items */
+ 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="flex items-center gap-2 text-[13px] px-3 py-1.5 rounded-md transition-colors"
+ style={{
+ color: active ? '#451a03' : '#78350F',
+ background: active ? 'rgba(255,255,255,0.4)' : 'transparent',
+ fontWeight: active ? 600 : 500,
+ }}
+ onMouseEnter={(e) => { if (!active) e.currentTarget.style.background = 'rgba(255,255,255,0.2)'; }}
+ onMouseLeave={(e) => { if (!active) e.currentTarget.style.background = 'transparent'; }}
+ >
+ <item.icon size={15} />
+ {item.label}
+ {item.count > 0 && (
+ <span className="text-[11px] ml-0.5" style={{ color: '#92400E' }}>{item.count}</span>
+ )}
+ </button>
+ );
+ })
+ )}
+
+ {/* Search β€” right side */}
+ <div className="ml-auto relative">
+ <Search size={14} className="absolute left-3 top-1/2 -translate-y-1/2" style={{ color: '#92400E' }} />
+ <input
+ type="text"
+ placeholder="Search guides..."
+ value={search}
+ onChange={(e) => onSearchChange(e.target.value)}
+ className="pl-9 pr-3 py-1.5 text-[13px] rounded-lg border-none outline-none w-52"
+ style={{ background: 'rgba(255,255,255,0.4)', color: '#451a03' }}
+ onFocus={(e) => { e.target.style.background = 'rgba(255,255,255,0.6)'; }}
+ onBlur={(e) => { e.target.style.background = 'rgba(255,255,255,0.4)'; }}
+ />
+ </div>
+ </header>
+ );
+}