diff --git a/app/src/components/MapSearchView.js b/app/src/components/MapSearchView.js index 106cd66b..6df499ff 100644 --- a/app/src/components/MapSearchView.js +++ b/app/src/components/MapSearchView.js @@ -119,7 +119,7 @@ export function MapSearchView() { } return - + {results.map((place, i) => )} diff --git a/app/src/components/ui/Surfaces.tsx b/app/src/components/ui/Surfaces.tsx index 0f25c476..b477f2b9 100644 --- a/app/src/components/ui/Surfaces.tsx +++ b/app/src/components/ui/Surfaces.tsx @@ -207,14 +207,19 @@ export function Card({media, title, meta, children, actions, onClick, color, cla export interface CardGroupProps extends React.HTMLAttributes { /** - * The narrowest a card may be laid out. `auto-fill` rather than `auto-fit`, so a group - * of two cards in a wide column keeps them card-sized instead of stretching each to half - * the page. + * The narrowest a card may be laid out, in px at the unscaled design size. `auto-fill` + * rather than `auto-fit`, so a group of two cards in a wide column keeps them card-sized + * instead of stretching each to half the page. + * + * The default was 200 and is 250: a card wall read too dense, running five to a row at + * 1280px where the pre-migration build ran four, which left a video title about two words + * wide. 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. */ minWidth?: number; } -export function CardGroup({children, minWidth = 200, className, style, ...props}: CardGroupProps) { +export function CardGroup({children, minWidth = 250, className, style, ...props}: CardGroupProps) { return
{ 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(); + + 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