fix: clean up export page warnings and notes display
- Remove "N notes" indicator from the top bar - Hide terminated agent messages entirely instead of showing as notes - Style warnings as a rounded box with side borders and more margin Co-Authored-By: Paperclip <noreply@paperclip.ing> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
068441b01b
commit
45df62652b
1 changed files with 5 additions and 33 deletions
|
|
@ -18,7 +18,6 @@ import {
|
||||||
FileText,
|
FileText,
|
||||||
Folder,
|
Folder,
|
||||||
FolderOpen,
|
FolderOpen,
|
||||||
Info,
|
|
||||||
Package,
|
Package,
|
||||||
Search,
|
Search,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
@ -596,19 +595,10 @@ export function CompanyExport() {
|
||||||
const totalFiles = useMemo(() => countFiles(tree), [tree]);
|
const totalFiles = useMemo(() => countFiles(tree), [tree]);
|
||||||
const selectedCount = checkedFiles.size;
|
const selectedCount = checkedFiles.size;
|
||||||
|
|
||||||
// Separate info notes (terminated agents) from real warnings
|
// Filter out terminated agent messages — they don't need to be shown
|
||||||
const { notes, warnings } = useMemo(() => {
|
const warnings = useMemo(() => {
|
||||||
if (!exportData) return { notes: [] as string[], warnings: [] as string[] };
|
if (!exportData) return [] as string[];
|
||||||
const notes: string[] = [];
|
return exportData.warnings.filter((w) => !/terminated agent/i.test(w));
|
||||||
const warnings: string[] = [];
|
|
||||||
for (const w of exportData.warnings) {
|
|
||||||
if (/terminated agent/i.test(w)) {
|
|
||||||
notes.push(w);
|
|
||||||
} else {
|
|
||||||
warnings.push(w);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return { notes, warnings };
|
|
||||||
}, [exportData]);
|
}, [exportData]);
|
||||||
|
|
||||||
function handleToggleDir(path: string) {
|
function handleToggleDir(path: string) {
|
||||||
|
|
@ -725,12 +715,6 @@ export function CompanyExport() {
|
||||||
{warnings.length} warning{warnings.length === 1 ? "" : "s"}
|
{warnings.length} warning{warnings.length === 1 ? "" : "s"}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{notes.length > 0 && (
|
|
||||||
<span className="text-muted-foreground flex items-center gap-1">
|
|
||||||
<Info className="h-3 w-3" />
|
|
||||||
{notes.length} note{notes.length === 1 ? "" : "s"}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|
@ -743,21 +727,9 @@ export function CompanyExport() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Notes (informational, e.g. terminated agents) */}
|
|
||||||
{notes.length > 0 && (
|
|
||||||
<div className="border-b border-border px-5 py-2 flex items-start gap-2">
|
|
||||||
<Info className="h-3.5 w-3.5 mt-0.5 shrink-0 text-muted-foreground" />
|
|
||||||
<div>
|
|
||||||
{notes.map((n) => (
|
|
||||||
<div key={n} className="text-xs text-muted-foreground">{n}</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Warnings */}
|
{/* Warnings */}
|
||||||
{warnings.length > 0 && (
|
{warnings.length > 0 && (
|
||||||
<div className="border-b border-amber-500/20 bg-amber-500/5 px-5 py-2">
|
<div className="mx-5 mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3">
|
||||||
{warnings.map((w) => (
|
{warnings.map((w) => (
|
||||||
<div key={w} className="text-xs text-amber-500">{w}</div>
|
<div key={w} className="text-xs text-amber-500">{w}</div>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue