feat(reports): clamp report descriptions with a show more toggle

Report descriptions run to a paragraph. ReportDescription wraps Mantine's
Spoiler to clamp them to two lines, and the toggle only renders when the
text actually overflows.

PageHeader kept its subtitle on a hard truncate class, which would have
pinned the spoiler to one line, so a ReactNode subtitle now renders as-is
and owns its own layout. A string subtitle still truncates as before.
This commit is contained in:
Nathnael
2026-08-24 07:54:36 +00:00
parent baef14c847
commit de407c0014
4 changed files with 41 additions and 8 deletions

View File

@@ -58,9 +58,15 @@ export function PageHeader({
{meta}
</Group>
{subtitle ? (
<Text c="dimmed" size="sm" mt={4} className="truncate">
{subtitle}
</Text>
typeof subtitle === "string" ? (
<Text c="dimmed" size="sm" mt={4} className="truncate">
{subtitle}
</Text>
) : (
// A component subtitle handles its own layout — truncating it
// to one line would defeat e.g. an expandable description.
<div style={{ marginTop: 4 }}>{subtitle}</div>
)
) : null}
</div>
</Group>