fix(spa): detail-page header in 3 stacked full-width rows (#658) + 1.8.1#661
Merged
Merged
Conversation
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>
Owner
Author
|
@coderabbitai full review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #658.
Problem
The detail header laid out breadcrumb + title + toolbar on a single horizontal row with the toolbar on the right. Two failures:
@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
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-autodiv withflex-wrapso Edit + Delete stay adjacent at the trailing edge even when the leading@admin.actioncluster wraps onto multiple lines.Verification
pnpm test— 222 / 222 ✓ (no regressions)pnpm -r typecheck✓pnpm lint✓🤖 Generated with Claude Code