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

refactor: redesign sidepanel library list and search input

Luis Ortizfffd81694b13
diff --git a/src/ui/components/ui/input.tsx b/src/ui/components/ui/input.tsx
index b6256c4..f92d954 100644
--- a/src/ui/components/ui/input.tsx
+++ b/src/ui/components/ui/input.tsx
@@ -9,7 +9,7 @@ function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
data-slot="input"
className={cn(
'h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30',
- 'focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50',
+ 'focus-visible:border-ring focus-visible:ring-0',
'aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40',
className,
)}
diff --git a/src/ui/sidepanel/App.tsx b/src/ui/sidepanel/App.tsx
index 94530aa..10176bc 100644
--- a/src/ui/sidepanel/App.tsx
+++ b/src/ui/sidepanel/App.tsx
@@ -137,8 +137,13 @@ export default function App() {
<div className="absolute -top-12 -right-8 w-44 h-44 rounded-full opacity-15 blur-[40px] bg-gradient-to-br from-gold to-white" />
<div className="relative flex items-center justify-between mb-6">
+ <span className="text-[17px] font-bold tracking-tight text-foreground">Mimik</span>
<div className="flex items-center gap-2">
- <span className="text-[17px] font-bold tracking-tight text-foreground">Mimik</span>
+ <span
+ className={`text-[10px] font-medium px-2.5 py-0.5 rounded-full ${isAlive ? 'text-foreground bg-white/30' : 'text-brown/50 bg-white/15'}`}
+ >
+ {isAlive ? 'Connected' : 'Connecting...'}
+ </span>
<button
onClick={() => setView({ name: 'settings' })}
className="w-7 h-7 rounded-lg flex items-center justify-center text-foreground/60 hover:text-foreground hover:bg-white/20 transition-colors"
@@ -146,11 +151,6 @@ export default function App() {
<Settings size={15} />
</button>
</div>
- <span
- className={`text-[10px] font-medium px-2.5 py-0.5 rounded-full ${isAlive ? 'text-foreground bg-white/30' : 'text-brown/50 bg-white/15'}`}
- >
- {isAlive ? 'Connected' : 'Connecting...'}
- </span>
</div>
<div className="relative text-center mb-5">
@@ -180,7 +180,7 @@ export default function App() {
placeholder="Search guides..."
value={search}
onChange={(e) => setSearch(e.target.value)}
- className="w-full pl-10 pr-3"
+ className="w-full pl-10 pr-3 rounded-xl border-[#ede8e0] bg-white !text-[13px]"
/>
</div>
diff --git a/src/ui/sidepanel/LibraryView.tsx b/src/ui/sidepanel/LibraryView.tsx
index 76fd87c..b304ae8 100644
--- a/src/ui/sidepanel/LibraryView.tsx
+++ b/src/ui/sidepanel/LibraryView.tsx
@@ -107,56 +107,63 @@ export default function LibraryView({ onOpen, searchQuery = '' }: LibraryViewPro
}
return (
- <div className="flex flex-col gap-2 pb-4">
- {filtered.map((guide) => (
- <div
- key={guide.id}
- className="flex items-center gap-3 px-3.5 py-3 rounded-lg cursor-pointer group transition-all border border-gold hover:border-accent hover:shadow-sm"
- onClick={() => onOpen(guide.id)}
- >
- <div className="w-8 h-8 rounded-lg flex items-center justify-center shrink-0 overflow-hidden text-xs font-semibold bg-gold border border-amber-light text-brown">
- {guide.favicon ? (
- <img
- src={guide.favicon}
- alt=""
- className="w-5 h-5"
- onError={(e) => {
- const el = e.target as HTMLImageElement;
- el.style.display = 'none';
- el.parentElement!.textContent = guide.title.charAt(0).toUpperCase();
- }}
- />
- ) : (
- guide.title.charAt(0).toUpperCase()
- )}
- </div>
+ <div className="flex flex-col gap-2 px-1 pb-4">
+ {filtered.map((guide) => {
+ const isEmpty = guide.stepIds.length === 0;
+ return (
+ <div
+ key={guide.id}
+ className="flex items-start gap-3 px-3.5 py-2.5 rounded-xl cursor-pointer group transition-all bg-white border border-[#ede8e0] hover:border-amber hover:shadow-sm"
+ onClick={() => onOpen(guide.id)}
+ >
+ <div className="w-7 h-7 mt-0.5 rounded-full flex items-center justify-center shrink-0 overflow-hidden">
+ {guide.favicon ? (
+ <img
+ src={guide.favicon}
+ alt=""
+ className="w-5 h-5"
+ onError={(e) => {
+ const el = e.target as HTMLImageElement;
+ el.style.display = 'none';
+ }}
+ />
+ ) : (
+ <div className="w-full h-full rounded-full border-[1.5px] border-dashed border-border" />
+ )}
+ </div>
- <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-warm">
- {guide.stepIds.length} step{guide.stepIds.length !== 1 ? 's' : ''} &middot;{' '}
- {formatRelativeTime(guide.updatedAt)}
- </p>
- </div>
+ <div className="flex-1 min-w-0">
+ <p className={`text-[13px] font-medium truncate ${isEmpty ? 'text-[#b8a48e]' : 'text-foreground'}`}>
+ {guide.title}
+ </p>
+ <p className="text-[10px] mt-0.5 text-[#b8a48e]">{formatRelativeTime(guide.updatedAt)}</p>
+ </div>
- <div className="flex items-center gap-0.5 ml-1 shrink-0">
- <button
- onClick={(e) => handleStar(e, guide.id)}
- className={`p-1.5 rounded-lg transition-all hover:text-accent ${guide.starred ? 'opacity-100 text-accent' : 'opacity-0 group-hover:opacity-100 text-border'}`}
- title={guide.starred ? 'Unstar' : 'Star'}
- >
- <Star size={14} fill={guide.starred ? 'currentColor' : 'none'} />
- </button>
- <button
- onClick={(e) => handleDelete(e, guide.id)}
- className="p-1.5 rounded-lg opacity-0 group-hover:opacity-100 transition-all text-border hover:text-red-500"
- title="Move to trash"
- >
- <Trash2 size={14} />
- </button>
+ {guide.stepIds.length > 0 && (
+ <span className="text-[9px] font-semibold text-muted-foreground bg-secondary px-2 py-1 rounded-full shrink-0 leading-none mt-0.5">
+ {guide.stepIds.length} step{guide.stepIds.length !== 1 ? 's' : ''}
+ </span>
+ )}
+
+ <div className="flex items-center gap-0.5 shrink-0">
+ <button
+ onClick={(e) => handleStar(e, guide.id)}
+ className={`p-1.5 rounded-lg transition-all hover:text-accent ${guide.starred ? 'opacity-100 text-accent' : 'opacity-0 group-hover:opacity-100 text-border'}`}
+ title={guide.starred ? 'Unstar' : 'Star'}
+ >
+ <Star size={13} fill={guide.starred ? 'currentColor' : 'none'} />
+ </button>
+ <button
+ onClick={(e) => handleDelete(e, guide.id)}
+ className="p-1.5 rounded-lg opacity-0 group-hover:opacity-100 transition-all text-border hover:text-red-500"
+ title="Move to trash"
+ >
+ <Trash2 size={13} />
+ </button>
+ </div>
</div>
- </div>
- ))}
+ );
+ })}
</div>
);
}