Commit 93db281
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: Martin Castro Laminrs <mcastro@laminr.ai>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 536d3a6 commit 93db281
2 files changed
Lines changed: 68 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
262 | 272 | | |
263 | | - | |
| 273 | + | |
264 | 274 | | |
265 | 275 | | |
266 | 276 | | |
| |||
343 | 353 | | |
344 | 354 | | |
345 | 355 | | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
373 | 391 | | |
374 | 392 | | |
375 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments