From ede10fef9c46eaaa881bd402bb720a7d472d6568 Mon Sep 17 00:00:00 2001 From: Michael Ramos Date: Mon, 30 Mar 2026 21:39:00 -0700 Subject: [PATCH] feat(ui): cross-file annotation visibility and adaptive navigation (#444) - Shared CountBadge component replacing heavy TOC accent circles - Per-file annotation count badges in FileBrowser and VaultBrowser - Folder aggregate counts from descendant files - Summary header showing total annotations across files - Dot indicators on Files/Vault sidebar tabs when annotations exist - Adaptive back button text (file list / file / message / plan) - Cross-file annotation indicator in right panel with flash highlight - Fix directory prefix matching bug (startsWith without trailing slash) - Move flash animation CSS to shared theme stylesheet For provenance purposes, this commit was AI assisted. --- packages/editor/App.tsx | 102 +++++++++++++++++- packages/ui/components/AnnotationPanel.tsx | 13 +++ packages/ui/components/TableOfContents.tsx | 12 +-- packages/ui/components/Viewer.tsx | 4 +- packages/ui/components/sidebar/CountBadge.tsx | 12 +++ .../ui/components/sidebar/FileBrowser.tsx | 51 ++++++++- .../components/sidebar/SidebarContainer.tsx | 30 +++++- .../ui/components/sidebar/SidebarTabs.tsx | 14 ++- .../ui/components/sidebar/VaultBrowser.tsx | 45 +++++++- packages/ui/theme.css | 14 +++ 10 files changed, 278 insertions(+), 19 deletions(-) create mode 100644 packages/ui/components/sidebar/CountBadge.tsx diff --git a/packages/editor/App.tsx b/packages/editor/App.tsx index d72cbc5..2d7e16c 100644 --- a/packages/editor/App.tsx +++ b/packages/editor/App.tsx @@ -286,6 +286,95 @@ const App: React.FC = () => { archive.clearSelection(); }, [linkedDocHook, vaultBrowser, fileBrowser, archive]); + // Derive annotation counts per file from linked doc cache (includes active doc's live state) + const allAnnotationCounts = useMemo(() => { + const counts = new Map(); + for (const [fp, cached] of linkedDocHook.getDocAnnotations()) { + const count = cached.annotations.length + cached.globalAttachments.length; + if (count > 0) counts.set(fp, count); + } + return counts; + }, [linkedDocHook.getDocAnnotations, annotations, globalAttachments]); + + // FileBrowser counts: only files under file browser directories + const fileAnnotationCounts = useMemo(() => { + if (fileBrowserDirs.length === 0) return allAnnotationCounts; + const counts = new Map(); + for (const [fp, count] of allAnnotationCounts) { + if (fileBrowserDirs.some(dir => fp.startsWith(dir + '/'))) { + counts.set(fp, count); + } + } + return counts; + }, [allAnnotationCounts, fileBrowserDirs]); + + // VaultBrowser uses relative paths — strip vaultPath prefix for lookup + const vaultAnnotationCounts = useMemo(() => { + if (!vaultPath) return new Map(); + const prefix = vaultPath.endsWith('/') ? vaultPath : vaultPath + '/'; + const counts = new Map(); + for (const [fp, count] of allAnnotationCounts) { + if (fp.startsWith(prefix)) { + counts.set(fp.slice(prefix.length), count); + } + } + return counts; + }, [allAnnotationCounts, vaultPath]); + + const hasFileAnnotations = fileAnnotationCounts.size > 0; + const hasVaultAnnotations = vaultAnnotationCounts.size > 0; + + // Annotations in other files (not the current view) — for the right panel "+N" indicator + const otherFileAnnotations = useMemo(() => { + const currentFile = linkedDocHook.filepath; + let count = 0; + let files = 0; + for (const [fp, n] of allAnnotationCounts) { + if (fp !== currentFile) { + count += n; + files++; + } + } + return count > 0 ? { count, files } : undefined; + }, [allAnnotationCounts, linkedDocHook.filepath]); + + // Flash highlight for annotated files in the sidebar + const [highlightedFiles, setHighlightedFiles] = useState | undefined>(); + const flashTimerRef = React.useRef>(); + const handleFlashAnnotatedFiles = React.useCallback(() => { + const filePaths = new Set(allAnnotationCounts.keys()); + if (filePaths.size === 0) return; + // Open sidebar to the relevant tab so the flash is visible + if (!sidebar.isOpen || (sidebar.activeTab !== 'files' && sidebar.activeTab !== 'vault')) { + sidebar.open(hasVaultAnnotations && !hasFileAnnotations ? 'vault' : 'files'); + } + // Cancel any pending clear from a previous flash + if (flashTimerRef.current) clearTimeout(flashTimerRef.current); + // Clear first so re-triggering restarts the CSS animation + setHighlightedFiles(undefined); + requestAnimationFrame(() => { + setHighlightedFiles(filePaths); + flashTimerRef.current = setTimeout(() => setHighlightedFiles(undefined), 1200); + }); + }, [allAnnotationCounts, sidebar, hasVaultAnnotations, hasFileAnnotations]); + + // Derive vault-relative highlighted files for VaultBrowser + const vaultHighlightedFiles = useMemo(() => { + if (!highlightedFiles || !vaultPath) return undefined; + const prefix = vaultPath.endsWith('/') ? vaultPath : vaultPath + '/'; + const relative = new Set(); + for (const fp of highlightedFiles) { + if (fp.startsWith(prefix)) relative.add(fp.slice(prefix.length)); + } + return relative.size > 0 ? relative : undefined; + }, [highlightedFiles, vaultPath]); + + // Context-aware back label for linked doc navigation + const backLabel = annotateSource === 'folder' ? 'file list' + : annotateSource === 'file' ? 'file' + : annotateSource === 'message' ? 'message' + : 'plan'; + const handleVaultFetchTree = React.useCallback(() => { vaultBrowser.fetchTree(vaultPath); }, [vaultBrowser, vaultPath]); @@ -1421,6 +1510,8 @@ const App: React.FC = () => { hasDiff={planDiff.hasPreviousVersion} showFilesTab={showFilesTab && !archive.archiveMode} showVaultTab={showVaultTab} + hasFileAnnotations={hasFileAnnotations} + hasVaultAnnotations={hasVaultAnnotations} className="hidden lg:flex" /> )} @@ -1442,15 +1533,22 @@ const App: React.FC = () => { onTocNavigate={handleTocNavigate} linkedDocFilepath={linkedDocHook.filepath} onLinkedDocBack={linkedDocHook.isActive ? handleLinkedDocBack : undefined} + backLabel={backLabel} showFilesTab={showFilesTab && !archive.archiveMode} + fileAnnotationCounts={fileAnnotationCounts} + highlightedFiles={highlightedFiles} fileBrowser={fileBrowser} onFilesSelectFile={handleFileBrowserSelect} onFilesFetchAll={() => fileBrowser.fetchAll(fileBrowserDirs)} showVaultTab={showVaultTab && !archive.archiveMode} vaultPath={vaultPath} vaultBrowser={vaultBrowser} + vaultAnnotationCounts={vaultAnnotationCounts} + vaultHighlightedFiles={vaultHighlightedFiles} onVaultSelectFile={handleVaultFileSelect} onVaultFetchTree={handleVaultFetchTree} + hasFileAnnotations={hasFileAnnotations} + hasVaultAnnotations={hasVaultAnnotations} versionInfo={versionInfo} versions={planDiff.versions} selectedBaseVersion={planDiff.diffBaseVersion} @@ -1555,7 +1653,7 @@ const App: React.FC = () => { showDemoBadge={!isApiMode && !isLoadingShared && !isSharedSession} maxWidth={planMaxWidth} onOpenLinkedDoc={handleOpenLinkedDoc} - linkedDocInfo={linkedDocHook.isActive ? { filepath: linkedDocHook.filepath!, onBack: handleLinkedDocBack, label: vaultBrowser.activeFile ? 'Vault File' : fileBrowser.activeFile ? 'File' : undefined } : null} + linkedDocInfo={linkedDocHook.isActive ? { filepath: linkedDocHook.filepath!, onBack: handleLinkedDocBack, label: vaultBrowser.activeFile ? 'Vault File' : fileBrowser.activeFile ? 'File' : undefined, backLabel } : null} imageBaseDir={imageBaseDir} copyLabel={annotateSource === 'message' ? 'Copy message' : annotateSource === 'file' || annotateSource === 'folder' ? 'Copy file' : undefined} archiveInfo={archive.currentInfo} @@ -1587,6 +1685,8 @@ const App: React.FC = () => { onQuickCopy={async () => { await navigator.clipboard.writeText(wrapFeedbackForAgent(annotationsOutput)); }} + otherFileAnnotations={otherFileAnnotations} + onOtherFileAnnotationsClick={handleFlashAnnotatedFiles} /> diff --git a/packages/ui/components/AnnotationPanel.tsx b/packages/ui/components/AnnotationPanel.tsx index 384a941..7eda1d8 100644 --- a/packages/ui/components/AnnotationPanel.tsx +++ b/packages/ui/components/AnnotationPanel.tsx @@ -20,6 +20,8 @@ interface PanelProps { onDeleteEditorAnnotation?: (id: string) => void; onClose?: () => void; onQuickCopy?: () => Promise; + otherFileAnnotations?: { count: number; files: number }; + onOtherFileAnnotationsClick?: () => void; } export const AnnotationPanel: React.FC = ({ @@ -37,6 +39,8 @@ export const AnnotationPanel: React.FC = ({ onDeleteEditorAnnotation, onClose, onQuickCopy, + otherFileAnnotations, + onOtherFileAnnotationsClick, }) => { const isMobile = useIsMobile(); const [copied, setCopied] = useState(false); @@ -97,6 +101,15 @@ export const AnnotationPanel: React.FC = ({ )} + {otherFileAnnotations && otherFileAnnotations.count > 0 && ( + + )} {/* List */} diff --git a/packages/ui/components/TableOfContents.tsx b/packages/ui/components/TableOfContents.tsx index 92f3ffd..d135582 100644 --- a/packages/ui/components/TableOfContents.tsx +++ b/packages/ui/components/TableOfContents.tsx @@ -5,6 +5,7 @@ import { getAnnotationCountBySection, type TocItem, } from '../utils/annotationHelpers'; +import { CountBadge } from './sidebar/CountBadge'; interface TableOfContentsProps { blocks: Block[]; @@ -15,6 +16,7 @@ interface TableOfContentsProps { style?: React.CSSProperties; linkedDocFilepath?: string | null; onLinkedDocBack?: () => void; + backLabel?: string; } interface TocItemProps { @@ -88,12 +90,7 @@ function TocItemComponent({ {item.content} {item.annotationCount > 0 && ( - - {item.annotationCount} - + )} @@ -148,6 +145,7 @@ export function TableOfContents({ style, linkedDocFilepath, onLinkedDocBack, + backLabel, }: TableOfContentsProps) { // Calculate annotation counts per section const annotationCounts = useMemo( @@ -213,7 +211,7 @@ export function TableOfContents({ - Back to plan + Back to {backLabel || 'plan'} )} diff --git a/packages/ui/components/Viewer.tsx b/packages/ui/components/Viewer.tsx index a371b73..0daa426 100644 --- a/packages/ui/components/Viewer.tsx +++ b/packages/ui/components/Viewer.tsx @@ -56,7 +56,7 @@ interface ViewerProps { stickyActions?: boolean; onOpenLinkedDoc?: (path: string) => void; imageBaseDir?: string; - linkedDocInfo?: { filepath: string; onBack: () => void; label?: string } | null; + linkedDocInfo?: { filepath: string; onBack: () => void; label?: string; backLabel?: string } | null; // Plan diff props planDiffStats?: { additions: number; deletions: number; modifications: number } | null; isPlanDiffActive?: boolean; @@ -499,7 +499,7 @@ export const Viewer = forwardRef(({ - plan + {linkedDocInfo.backLabel || 'plan'} {linkedDocInfo.label || 'Linked File'} diff --git a/packages/ui/components/sidebar/CountBadge.tsx b/packages/ui/components/sidebar/CountBadge.tsx new file mode 100644 index 0000000..6db7239 --- /dev/null +++ b/packages/ui/components/sidebar/CountBadge.tsx @@ -0,0 +1,12 @@ +import React from "react"; + +/** Compact annotation count badge for sidebar file trees and TOC */ +export const CountBadge: React.FC<{ count: number; active?: boolean; className?: string }> = ({ count, active, className }) => ( + + {count} + +); diff --git a/packages/ui/components/sidebar/FileBrowser.tsx b/packages/ui/components/sidebar/FileBrowser.tsx index b277612..e08bee3 100644 --- a/packages/ui/components/sidebar/FileBrowser.tsx +++ b/packages/ui/components/sidebar/FileBrowser.tsx @@ -8,6 +8,7 @@ import React from "react"; import type { VaultNode } from "../../types"; import type { DirState } from "../../hooks/useFileBrowser"; +import { CountBadge } from "./CountBadge"; interface FileBrowserProps { dirs: DirState[]; @@ -18,6 +19,24 @@ interface FileBrowserProps { onSelectFile: (absolutePath: string, dirPath: string) => void; activeFile: string | null; onFetchAll: () => void; + annotationCounts?: Map; + highlightedFiles?: Set; +} + +/** Recursively sum annotation counts for all descendant files of a folder node */ +function getAggregateCount( + node: VaultNode, + dirPath: string, + counts: Map +): number { + if (node.type === "file") { + return counts.get(`${dirPath}/${node.path}`) ?? 0; + } + let total = 0; + for (const child of node.children ?? []) { + total += getAggregateCount(child, dirPath, counts); + } + return total; } const TreeNode: React.FC<{ @@ -28,7 +47,9 @@ const TreeNode: React.FC<{ onToggleFolder: (key: string) => void; onSelectFile: (absolutePath: string, dirPath: string) => void; activeFile: string | null; -}> = ({ node, depth, dirPath, expandedFolders, onToggleFolder, onSelectFile, activeFile }) => { + annotationCounts?: Map; + highlightedFiles?: Set; +}> = ({ node, depth, dirPath, expandedFolders, onToggleFolder, onSelectFile, activeFile, annotationCounts, highlightedFiles }) => { const folderKey = `${dirPath}:${node.path}`; const absolutePath = `${dirPath}/${node.path}`; const isExpanded = expandedFolders.has(folderKey); @@ -36,6 +57,7 @@ const TreeNode: React.FC<{ const paddingLeft = 8 + depth * 14; if (node.type === "folder") { + const aggregateCount = annotationCounts ? getAggregateCount(node, dirPath, annotationCounts) : 0; return ( <> {isExpanded && node.children?.map((child) => ( ))} @@ -74,6 +99,8 @@ const TreeNode: React.FC<{ } const displayName = node.name.replace(/\.mdx?$/i, ""); + const fileCount = annotationCounts?.get(absolutePath) ?? 0; + const isHighlighted = highlightedFiles?.has(absolutePath); return ( ); }; @@ -100,7 +128,9 @@ const DirSection: React.FC<{ onSelectFile: (absolutePath: string, dirPath: string) => void; activeFile: string | null; onRetry: () => void; -}> = ({ dir, expandedFolders, onToggleFolder, onSelectFile, activeFile, onRetry }) => { + annotationCounts?: Map; + highlightedFiles?: Set; +}> = ({ dir, expandedFolders, onToggleFolder, onSelectFile, activeFile, onRetry, annotationCounts, highlightedFiles }) => { if (dir.isLoading) { return (
@@ -143,6 +173,8 @@ const DirSection: React.FC<{ onToggleFolder={onToggleFolder} onSelectFile={onSelectFile} activeFile={activeFile} + annotationCounts={annotationCounts} + highlightedFiles={highlightedFiles} /> ))}
@@ -158,6 +190,8 @@ export const FileBrowser: React.FC = ({ onSelectFile, activeFile, onFetchAll, + annotationCounts, + highlightedFiles, }) => { if (dirs.length === 0) { return ( @@ -167,8 +201,17 @@ export const FileBrowser: React.FC = ({ ); } + // Summary header + const totalCount = annotationCounts ? Array.from(annotationCounts.values()).reduce((s, c) => s + c, 0) : 0; + const fileCount = annotationCounts?.size ?? 0; + return (
+ {totalCount > 0 && ( +
+ {totalCount} annotation{totalCount === 1 ? '' : 's'} in {fileCount} file{fileCount === 1 ? '' : 's'} +
+ )} {dirs.map((dir) => { const isCollapsed = collapsedDirs.has(dir.path); return ( @@ -199,6 +242,8 @@ export const FileBrowser: React.FC = ({ onSelectFile={onSelectFile} activeFile={activeFile} onRetry={onFetchAll} + annotationCounts={annotationCounts} + highlightedFiles={highlightedFiles} /> )}
diff --git a/packages/ui/components/sidebar/SidebarContainer.tsx b/packages/ui/components/sidebar/SidebarContainer.tsx index 0f012a2..3389b54 100644 --- a/packages/ui/components/sidebar/SidebarContainer.tsx +++ b/packages/ui/components/sidebar/SidebarContainer.tsx @@ -29,8 +29,11 @@ interface SidebarContainerProps { onTocNavigate: (blockId: string) => void; linkedDocFilepath?: string | null; onLinkedDocBack?: () => void; + backLabel?: string; // File Browser props showFilesTab?: boolean; + fileAnnotationCounts?: Map; + highlightedFiles?: Set; fileBrowser?: UseFileBrowserReturn; onFilesSelectFile?: (absolutePath: string, dirPath: string) => void; onFilesFetchAll?: () => void; @@ -38,6 +41,8 @@ interface SidebarContainerProps { showVaultTab?: boolean; vaultPath?: string; vaultBrowser?: UseVaultBrowserReturn; + vaultAnnotationCounts?: Map; + vaultHighlightedFiles?: Set; onVaultSelectFile?: (relativePath: string) => void; onVaultFetchTree?: () => void; // Version Browser props @@ -52,6 +57,9 @@ interface SidebarContainerProps { isSelectingVersion: boolean; fetchingVersion: number | null; onFetchVersions: () => void; + // Annotation indicators + hasFileAnnotations?: boolean; + hasVaultAnnotations?: boolean; // Archive Browser props showArchiveTab?: boolean; archivePlans: ArchivedPlan[]; @@ -71,13 +79,18 @@ export const SidebarContainer: React.FC = ({ onTocNavigate, linkedDocFilepath, onLinkedDocBack, + backLabel, showFilesTab, + fileAnnotationCounts, + highlightedFiles, fileBrowser, onFilesSelectFile, onFilesFetchAll, showVaultTab, vaultPath, vaultBrowser, + vaultAnnotationCounts, + vaultHighlightedFiles, onVaultSelectFile, onVaultFetchTree, versionInfo, @@ -91,6 +104,8 @@ export const SidebarContainer: React.FC = ({ isSelectingVersion, fetchingVersion, onFetchVersions, + hasFileAnnotations, + hasVaultAnnotations, showArchiveTab, archivePlans, selectedArchiveFile, @@ -164,6 +179,7 @@ export const SidebarContainer: React.FC = ({ } label="Files" + badge={hasFileAnnotations} /> )} {showVaultTab && ( @@ -186,6 +202,7 @@ export const SidebarContainer: React.FC = ({ } label="Vault" + badge={hasVaultAnnotations} /> )} {showArchiveTab && ( @@ -243,6 +260,7 @@ export const SidebarContainer: React.FC = ({ className="overflow-y-auto" linkedDocFilepath={linkedDocFilepath} onLinkedDocBack={onLinkedDocBack} + backLabel={backLabel} /> )} {activeTab === "versions" && ( @@ -270,6 +288,8 @@ export const SidebarContainer: React.FC = ({ onSelectFile={onFilesSelectFile ?? (() => {})} activeFile={fileBrowser.activeFile} onFetchAll={onFilesFetchAll ?? (() => {})} + annotationCounts={fileAnnotationCounts} + highlightedFiles={highlightedFiles} /> )} {activeTab === "vault" && showVaultTab && vaultPath && vaultBrowser && ( @@ -283,6 +303,8 @@ export const SidebarContainer: React.FC = ({ onSelectFile={onVaultSelectFile ?? (() => {})} activeFile={vaultBrowser.activeFile} onFetchTree={onVaultFetchTree ?? (() => {})} + annotationCounts={vaultAnnotationCounts} + highlightedFiles={vaultHighlightedFiles} /> )} {activeTab === "archive" && showArchiveTab && ( @@ -303,10 +325,11 @@ const TabButton: React.FC<{ onClick: () => void; icon: React.ReactNode; label: string; -}> = ({ active, onClick, icon, label }) => ( + badge?: boolean; +}> = ({ active, onClick, icon, label, badge }) => ( ); diff --git a/packages/ui/components/sidebar/SidebarTabs.tsx b/packages/ui/components/sidebar/SidebarTabs.tsx index 60a9cff..e52c8cf 100644 --- a/packages/ui/components/sidebar/SidebarTabs.tsx +++ b/packages/ui/components/sidebar/SidebarTabs.tsx @@ -14,6 +14,8 @@ interface SidebarTabsProps { hasDiff: boolean; showFilesTab?: boolean; showVaultTab?: boolean; + hasFileAnnotations?: boolean; + hasVaultAnnotations?: boolean; className?: string; } @@ -23,6 +25,8 @@ export const SidebarTabs: React.FC = ({ hasDiff, showFilesTab, showVaultTab, + hasFileAnnotations, + hasVaultAnnotations, className, }) => { return ( @@ -79,7 +83,7 @@ export const SidebarTabs: React.FC = ({ {showFilesTab && ( )} @@ -102,7 +109,7 @@ export const SidebarTabs: React.FC = ({ {showVaultTab && ( )} diff --git a/packages/ui/components/sidebar/VaultBrowser.tsx b/packages/ui/components/sidebar/VaultBrowser.tsx index fb3ed94..b2a1206 100644 --- a/packages/ui/components/sidebar/VaultBrowser.tsx +++ b/packages/ui/components/sidebar/VaultBrowser.tsx @@ -7,6 +7,7 @@ import React from "react"; import type { VaultNode } from "../../types"; +import { CountBadge } from "./CountBadge"; interface VaultBrowserProps { vaultPath: string; @@ -18,6 +19,23 @@ interface VaultBrowserProps { onSelectFile: (relativePath: string) => void; activeFile: string | null; onFetchTree: () => void; + annotationCounts?: Map; + highlightedFiles?: Set; +} + +/** Recursively sum annotation counts for all descendant files of a folder node */ +function getAggregateCount( + node: VaultNode, + counts: Map +): number { + if (node.type === "file") { + return counts.get(node.path) ?? 0; + } + let total = 0; + for (const child of node.children ?? []) { + total += getAggregateCount(child, counts); + } + return total; } const TreeNode: React.FC<{ @@ -27,12 +45,15 @@ const TreeNode: React.FC<{ onToggleFolder: (path: string) => void; onSelectFile: (path: string) => void; activeFile: string | null; -}> = ({ node, depth, expandedFolders, onToggleFolder, onSelectFile, activeFile }) => { + annotationCounts?: Map; + highlightedFiles?: Set; +}> = ({ node, depth, expandedFolders, onToggleFolder, onSelectFile, activeFile, annotationCounts, highlightedFiles }) => { const isExpanded = expandedFolders.has(node.path); const isActive = node.type === "file" && node.path === activeFile; const paddingLeft = 8 + depth * 14; if (node.type === "folder") { + const aggregateCount = annotationCounts ? getAggregateCount(node, annotationCounts) : 0; return ( <> {isExpanded && node.children?.map((child) => ( ))} @@ -71,6 +95,8 @@ const TreeNode: React.FC<{ // File node const displayName = node.name.replace(/\.md$/i, ""); + const fileCount = annotationCounts?.get(node.path) ?? 0; + const isHighlighted = highlightedFiles?.has(node.path); return ( ); }; @@ -100,6 +127,8 @@ export const VaultBrowser: React.FC = ({ onSelectFile, activeFile, onFetchTree, + annotationCounts, + highlightedFiles, }) => { const vaultName = vaultPath.split("/").pop() || "Vault"; @@ -125,6 +154,10 @@ export const VaultBrowser: React.FC = ({ ); } + // Summary header + const totalCount = annotationCounts ? Array.from(annotationCounts.values()).reduce((s, c) => s + c, 0) : 0; + const fileCount = annotationCounts?.size ?? 0; + return (
{/* Header */} @@ -134,6 +167,12 @@ export const VaultBrowser: React.FC = ({
+ {totalCount > 0 && ( +
+ {totalCount} annotation{totalCount === 1 ? '' : 's'} in {fileCount} file{fileCount === 1 ? '' : 's'} +
+ )} + {/* Tree */}
{tree.length === 0 ? ( @@ -150,6 +189,8 @@ export const VaultBrowser: React.FC = ({ onToggleFolder={onToggleFolder} onSelectFile={onSelectFile} activeFile={activeFile} + annotationCounts={annotationCounts} + highlightedFiles={highlightedFiles} /> )) )} diff --git a/packages/ui/theme.css b/packages/ui/theme.css index 3b96e97..16838ec 100644 --- a/packages/ui/theme.css +++ b/packages/ui/theme.css @@ -116,3 +116,17 @@ body { outline: 2px solid var(--ring); outline-offset: 2px; } + +/* Flash highlight for annotated files in sidebar */ +.file-annotation-flash { + animation: file-flash 1.2s ease-out; +} + +@keyframes file-flash { + 0% { background: transparent; } + 10% { background: var(--muted); } + 30% { background: transparent; } + 45% { background: var(--muted); } + 65% { background: transparent; } + 100% { background: transparent; } +} -- knotmirror 0.0.1