Skip to content

fix(spa): detail-page header in 3 stacked full-width rows (#658) + 1.8.1#661

Merged
MartinCastroAlvarez merged 1 commit into
mainfrom
fix/detail-page-header-3-rows
Jun 1, 2026
Merged

fix(spa): detail-page header in 3 stacked full-width rows (#658) + 1.8.1#661
MartinCastroAlvarez merged 1 commit into
mainfrom
fix/detail-page-header-3-rows

Conversation

@MartinCastroAlvarez
Copy link
Copy Markdown
Owner

Closes #658.

Problem

The detail header laid out breadcrumb + title + toolbar on a single horizontal row with the toolbar on the right. Two failures:

  1. Long single-token titles (filename / slug / UUID) wrapped on every hyphen at full H1 size in the narrow title column, filling the viewport vertically before content showed.
  2. 8+ @admin.actions pushed the title clean off-screen — the user saw a wall of buttons but no record name.

Fix: three stacked full-width rows

row 1 — breadcrumb (full width)
row 2 — H1 (full width, break-words + text-balance)
row 3 — toolbar (full width, flex-wrap; Edit/Delete cluster floats right via ml-auto)

Each concern owns its own row; they never share horizontal space, so neither can crowd the other. Matches classic Django admin + modern SPA admin patterns (Refine, React-Admin, Retool). Scales from 1 → 20+ actions without breakpoints.

The primary-actions cluster (Refresh + Edit + Delete) is wrapped in its own ml-auto div with flex-wrap so Edit + Delete stay adjacent at the trailing edge even when the leading @admin.action cluster wraps onto multiple lines.

Verification

  • pnpm test — 222 / 222 ✓ (no regressions)
  • pnpm -r typecheck
  • pnpm lint

🤖 Generated with Claude Code

The previous header laid out breadcrumb + title + action toolbar on
a single horizontal flex row, with breadcrumb + title on the left
(``flex-1 min-w-0``) and the toolbar on the right (``shrink-0``,
wrapping right-justified). Two failure modes followed:

1. **Long single-token titles collapsed to one-word-per-line at
   full H1 size.** A filename / slug / UUID like
   ``Bk stmt docs-pp0_4-bank_statement-2024_12_09-first_bank_and_trust.pdf``
   in a narrow title column wrapped on every hyphen at full H1 size,
   filling the entire viewport vertically before any content showed.

2. **Many actions overflowed and pushed the title off-screen.** A
   ModelAdmin with 8+ ``@admin.action``s + Edit + Delete made the
   toolbar wider than the available row, eating the title column
   entirely. The user saw a wall of buttons but no record name.

## Fix: three stacked full-width rows

  row 1 — breadcrumb (full width)
  row 2 — H1 (full width, ``break-words`` so long tokens wrap inside
              the container instead of forcing each segment to its
              own line; ``text-balance`` for shorter multi-word titles)
  row 3 — toolbar (full width, ``flex-wrap`` so 8+ actions flow onto
                   subsequent lines; primary actions Edit/Delete
                   right-aligned via ``ml-auto`` on a cluster div so
                   the destructive button stays at the trailing edge)

Each concern now owns its own row — they never share horizontal
space, so neither can crowd the other off-screen. Matches what
classic Django admin and modern SPA admin frameworks (Refine,
React-Admin, Retool) do; scales cleanly from 1 action to 20+ with
no breakpoints.

The primary-actions cluster (Refresh + Edit + Delete) is wrapped
in its own ``ml-auto`` div with its own ``flex-wrap`` — so even when
the leading @admin.action cluster wraps to multiple rows, Edit /
Delete stay adjacent and at the trailing edge. The destructive
Delete is never orphaned from the constructive Edit on a
narrow viewport.

## Verification

- ``pnpm test`` — 222 / 222 ✓ (no regressions; header changes are
  layout-only and not covered by existing component tests)
- ``pnpm -r typecheck`` ✓
- ``pnpm lint`` ✓

Visual smoke-test pending CodeRabbit + the release pilot loop.

Closes #658.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MartinCastroAlvarez
Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@MartinCastroAlvarez MartinCastroAlvarez merged commit 93db281 into main Jun 1, 2026
6 checks passed
@MartinCastroAlvarez MartinCastroAlvarez deleted the fix/detail-page-header-3-rows branch June 1, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detail page header: stack breadcrumb / title / toolbar in 3 full-width rows

2 participants