mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-03 05:09:58 -05:00
ui: widen a card's track by 25%
`CardGroup`'s default `minWidth` goes from 200 to 250, and the one call site that names its
own -- the map's search results -- from 220 to 275, keeping the 10% it sits above the default.
A card wall read too dense: at a 1280px window the grid ran five cards to a row where the
pre-migration Semantic build ran four, and a video title had about two words per line. At 250
it runs four cards of 300px, which is what Semantic measured at that width (four cards, 290px
each) -- so this lands on the old layout rather than near it.
Raising the default rather than each page is the point of it being a default: videos, archives,
docs, files and the gallery all take it.
Measured across the range, and no width regresses:
grid width cards/row card width poster side gap
430 1 430 0
570 2 277 0
600 2 292 0
900 3 290 0
1245 4 300 0
1600 5 308 0
A phone is unaffected -- one column below about 570px of content width either way -- and the
poster still fills the card at every width, since its cap is a fraction of the card rather than
a fixed height.
Verified: 1143 jest tests / 65 suites, clean build, screenshotted at 1280px.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9e35d56bc4
commit
8a1233c663
3 changed files with 26 additions and 5 deletions
|
|
@ -946,6 +946,22 @@ describe('CardGroup', () => {
|
|||
expect(screen.getByText('Three')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('gives a card 250px of track by default', () => {
|
||||
/*
|
||||
* Was 200. Raised 25% because a card wall was reading too dense: at 1280px the grid
|
||||
* ran five cards to a row where the pre-migration build ran four, and a video title
|
||||
* had about two words per line. It is the default rather than a per-page choice
|
||||
* because every card wall in the app -- videos, archives, docs, files, the gallery --
|
||||
* takes it, which is the point of it being a default.
|
||||
*
|
||||
* A phone is unaffected: one column below about 570px of content width either way.
|
||||
*/
|
||||
const {container} = renderUI(<CardGroup><Card title='One'/></CardGroup>);
|
||||
|
||||
expect(container.querySelector('.wrolpi-card-group'))
|
||||
.toHaveStyle({gridTemplateColumns: 'repeat(auto-fill, minmax(15.625rem, 1fr))'});
|
||||
});
|
||||
|
||||
it('lays cards out on a track no narrower than minWidth, in rem so it scales', () => {
|
||||
/*
|
||||
* The default suits file results; a group of wide cards raises it. If the value were
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue