diff --git a/src/components/PeopleTiles.css b/src/components/PeopleTiles.css index c75f990..d60f9b1 100644 --- a/src/components/PeopleTiles.css +++ b/src/components/PeopleTiles.css @@ -66,6 +66,16 @@ border-left: 1px solid var(--pl-rule); } +/* Everyone on one line (fitsOneRow in PeopleTiles.tsx): the groups + share it by head count, and the tiles narrow to fit. */ +.pl__groups[data-row="one"] { + flex-wrap: nowrap; +} + +.pl__groups[data-row="one"] .pl__group { + flex: var(--pl-share) 1 0; +} + .pl__group-head { display: flex; flex-direction: column; diff --git a/src/components/PeopleTiles.tsx b/src/components/PeopleTiles.tsx index 400ec9e..2f8e1bf 100644 --- a/src/components/PeopleTiles.tsx +++ b/src/components/PeopleTiles.tsx @@ -56,7 +56,10 @@ import "./PeopleTiles.css"; * Rows fill (balancedColumns): as many tiles across as fit, never * fewer than 2 or more than 10, one fewer when that would leave a * lone tile on the last row. When 2 don't fit at full size they - * shrink. + * shrink. And when everyone (every group, leads and members alike) + * fits on one line with tiles at ONE_ROW_SHRINK of full width or + * wider, they all share that one line instead (fitsOneRow): a + * board of 7 reads as one row, not 5 and 2. * * Details open in a panel right under the tile, over what follows * (flipped to end at the tile's right edge when it would run off @@ -484,6 +487,9 @@ export function PeopleTilesView({ } const open = openKey ? findByKey(resolvedGroups, openKey) : null; + const oneRow = + room !== null && overflow !== "scroll" && + fitsOneRow(resolvedGroups.map((group) => group.people.length), room.width, room.tile, room.gap); const anchored = overflow !== "scroll"; const closePanel = () => { setOpenKey(null); @@ -537,13 +543,17 @@ export function PeopleTilesView({ {...rest} > -