Files
backnotprop__plannotator/packages/ui/components/sidebar/CountBadge.tsx
Michael Ramos ede10fef9c 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.
2026-03-30 21:39:00 -07:00

13 lines
508 B
TypeScript

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 }) => (
<span
className={`flex-shrink-0 min-w-[18px] h-[18px] px-1 rounded flex items-center justify-center text-[10px] font-mono leading-none ${
active ? 'text-primary bg-primary/15' : 'text-muted-foreground bg-muted/70'
} ${className ?? ''}`}
>
{count}
</span>
);