From d4c984d83683104f3d0234f44f30b2dcc32b61b7 Mon Sep 17 00:00:00 2001 From: hallelx2 Date: Fri, 3 Jul 2026 13:04:35 +0100 Subject: [PATCH] fix(dashboard): readable summary color + surface delete errors - MarkdownSummary: summary paragraphs were text-muted-foreground (too faint on white cards); use text-foreground/75 for a readable dark gray. Also drop a misleading text-secondary wrapper in the section tree (text-secondary maps to the light shadcn secondary, not dark ink). - Delete handlers (list + detail): stop swallowing failures silently; surface the HTTP status + error so a failed delete is visible instead of appearing to do nothing. --- .../dashboard/documents/[docId]/page.tsx | 17 +++++++++++++---- .../(dashboard)/dashboard/documents/page.tsx | 13 +++++++++++-- apps/web/components/ui/markdown.tsx | 6 ++++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/apps/web/app/(dashboard)/dashboard/documents/[docId]/page.tsx b/apps/web/app/(dashboard)/dashboard/documents/[docId]/page.tsx index c783cc8..e4abe23 100644 --- a/apps/web/app/(dashboard)/dashboard/documents/[docId]/page.tsx +++ b/apps/web/app/(dashboard)/dashboard/documents/[docId]/page.tsx @@ -183,9 +183,7 @@ function SectionTreeNode({ )} {section.summary && ( -
- -
+ )} @@ -345,8 +343,19 @@ export default function DocumentDetailPage({ }); if (res.ok) { router.push("/dashboard/documents"); + return; } - } catch { + const body = (await res.json().catch(() => null)) as { + error?: string; + } | null; + alert( + `Delete failed (HTTP ${res.status})${body?.error ? `: ${body.error}` : ""}`, + ); + setIsDeleting(false); + } catch (e) { + alert( + `Delete failed: ${e instanceof Error ? e.message : "network error"}`, + ); setIsDeleting(false); } }, [docId, router]); diff --git a/apps/web/app/(dashboard)/dashboard/documents/page.tsx b/apps/web/app/(dashboard)/dashboard/documents/page.tsx index a29d92a..26e0abb 100644 --- a/apps/web/app/(dashboard)/dashboard/documents/page.tsx +++ b/apps/web/app/(dashboard)/dashboard/documents/page.tsx @@ -127,9 +127,18 @@ export default function DocumentsPage() { : prev, { revalidate: false }, ); + } else { + const body = (await res.json().catch(() => null)) as { + error?: string; + } | null; + alert( + `Delete failed (HTTP ${res.status})${body?.error ? `: ${body.error}` : ""}`, + ); } - } catch { - // retry silently + } catch (e) { + alert( + `Delete failed: ${e instanceof Error ? e.message : "network error"}`, + ); } finally { setDeletingId(null); } diff --git a/apps/web/components/ui/markdown.tsx b/apps/web/components/ui/markdown.tsx index ea35845..f4f892f 100644 --- a/apps/web/components/ui/markdown.tsx +++ b/apps/web/components/ui/markdown.tsx @@ -46,9 +46,11 @@ export function MarkdownSummary({ content, className }: MarkdownProps) { className={cn( "prose prose-xs max-w-none", "prose-headings:hidden", - "prose-p:text-muted-foreground prose-p:text-sm prose-p:leading-relaxed prose-p:my-0", + // Readable dark-gray summary text (muted-foreground was too faint + // on white cards). foreground/75 = ink at 75% opacity. + "prose-p:text-foreground/75 prose-p:text-sm prose-p:leading-relaxed prose-p:my-0", "prose-strong:text-foreground prose-strong:font-medium", - "prose-ul:my-1 prose-ol:my-1 prose-li:text-sm prose-li:text-muted-foreground prose-li:my-0", + "prose-ul:my-1 prose-ol:my-1 prose-li:text-sm prose-li:text-foreground/75 prose-li:my-0", "prose-code:text-xs prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded", "[&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className