mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-19 22:46:20 -05:00
ui: act on review -- corner chrome, a swallowed className, and the poster frame
Three real defects from the PR review, each reproduced before it was fixed.
The tag mark and a video's duration were pinned to the poster BAND, which
is the full width of the card, rather than to the painted image. Once the
height cap landed the two stopped being the same box: measured, the mark
sat 39px clear of a book cover, 56px clear of a small poster and 60px
clear of a vertical video, and the duration 55px clear. It went unnoticed
because on a 16:9 poster the image fills the band and the two pin to the
same place -- so the tests cover the height-bound ratios, and assert the
letterbox gap is really there before measuring into it.
CardPoster now centres a frame that shrink-wraps the image, and the frame
is what corner chrome is positioned against. VideoCard passes its
duration through a new `overlay` prop rather than wrapping CardPoster in a
box of its own.
The mark also went back INSIDE the link. Splitting it out made the
tagged corner a dead spot on an otherwise clickable poster.
CardLink and ExternalCardLink wrote `className='...' {...props}`, so a
caller's className replaced the pair instead of adding to it. Every
archive title passes `card-title-ellipsis`, so every archive title lost
`card-link` -- the one card type this PR migrates for layout was the one
missing the title treatment. Both compose now.
On the fourth comment, the breadth of the ActionIcon remap: it is
deliberate and the numbers are small. 59 IconButton call sites, 52 of
them at the default size, 7 at `xs` (one in Flasher, three in the
inventory schema editor). The one library control that stands beside an
input rather than a button is SearchBox's clear, and the remap is exactly
what that scale is for -- it now matches its field to the pixel, where
before it was 28px against a 36px input. Guarded by a test that fails at
42 vs 36 if the default is reverted.
1078 jest, 158 in ui-layout.cy.js, clean build.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c581dadae6
commit
e36bd85f54
5 changed files with 190 additions and 17 deletions
|
|
@ -1154,8 +1154,27 @@ html[data-theme="amber"] .wrolpi-progress-fill {
|
|||
--card-poster-max-height: 200px;
|
||||
}
|
||||
|
||||
/*
|
||||
* The band is the full width of the card and centres the poster in it. The frame inside
|
||||
* shrink-wraps the painted image, and is what corner chrome -- the tagged mark, a video's
|
||||
* duration -- is positioned against. Pinning that chrome to the BAND puts it in the
|
||||
* letterbox space beside a height-capped poster: 39px adrift on a book cover, 60px on a
|
||||
* vertical video.
|
||||
*
|
||||
* The frame's own width falls out of the caps below. Its intrinsic contribution is the
|
||||
* image's natural width already reduced by `max-height`, so a portrait cover contributes
|
||||
* 155px and gets 155px; a 16:9 poster contributes 1280px and is flex-shrunk to the band,
|
||||
* at which point `max-width: 100%` resolves against a width that is finally definite.
|
||||
*/
|
||||
.wrolpi-card-poster {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.wrolpi-card-poster-frame {
|
||||
position: relative;
|
||||
display: block;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.wrolpi-card-poster img {
|
||||
|
|
@ -1164,7 +1183,6 @@ html[data-theme="amber"] .wrolpi-progress-fill {
|
|||
height: auto;
|
||||
max-width: 100%;
|
||||
max-height: var(--card-poster-max-height);
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.wrolpi-card-icon {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue