Move the Recently sent description into the card header (PMS-765) #520
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-765-card-subtitle"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PMS-765, feedback on the "Recently sent" panel from #519: the line under the heading reads as cramped. It was.
Why
It rendered as the first child of the card body:
Three things at once:
Card's header ispx-6 pt-6 pb-4 border-b border-line, and apadding: falsecard gives its body no padding at all, so the paragraph carriedpx-6 pb-4and nothing at the top. It butted straight against the header rule.text-xs, where the app's descriptive copy istext-sm.Small grey text, no room above, a line right underneath.
The fix
The sentence is the card's subtitle, so it goes in the heading, above the rule.
CardandCardHeadergain an optionalsubtitle, rendered under the title asmt-1 text-sm text-muted.items-centertoitems-startwhen it has one, so a card's header actions stay level with the title rather than floating beside the description.Why not just add
pt-4and bump the size. It relieves the squeeze and leaves the sentence below the rule, reading as a stray row of the table rather than as part of the heading. And the next card wanting a description hand-rolls the same three classes against whatever padding that card happens to have, since apadding: falsecard has none and a padded one haspt-4. That is how spacing drifts across a codebase one card at a time.Tests
Two, rendered through the real
Card: the subtitle appears before the body element even opens, it renders attext-smwith room above it, a two-line heading aligns its actions to the title, and a card without a subtitle keeps the header it had.The card under test is deliberately padded. "Inside the header" and "first thing in the body" are indistinguishable by document order, which is exactly what my first draft compared, so it passed against both the fixed and the broken shape. A padded body carries a class of its own, and the subtitle landing before that class is what actually separates the two. Verified by putting the subtitle back in the body and watching the test fail.
Scope
Presentational. One optional prop on a shared component, one call site. Nothing in the panel's fetch, cap or refresh behaviour.
just checkclean,just test318 pass.