Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions apps/web/app/(dashboard)/dashboard/documents/[docId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ function SectionTreeNode({
)}
</div>
{section.summary && (
<div className="text-secondary">
<MarkdownSummary content={section.summary} />
</div>
<MarkdownSummary content={section.summary} />
)}
</div>

Expand Down Expand Up @@ -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]);
Expand Down
13 changes: 11 additions & 2 deletions apps/web/app/(dashboard)/dashboard/documents/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 4 additions & 2 deletions apps/web/components/ui/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading