Skip to content

Let scrolling filter cards grow into free space - #4

Merged
JohnLevander merged 1 commit into
mainfrom
filter-columns-grow-into-space
Sep 30, 2026
Merged

JohnLevander merged 1 commit into
mainfrom
filter-columns-grow-into-space

Conversation

@JohnLevander

Copy link
Copy Markdown
Collaborator

Scrolling filter cards grow into free column space beside them, in all filter sections.

🤖 Generated with Claude Code

In Standard density a long filter card was capped at five rows and scrolled even
when the column next to it had room to spare (Pathologic TNM in Staging &
Disease Extent, Disease or Disorder in Cancer Type & Primary Site). The slack
code that should have let it grow existed, but only ran in Compact+ density, and
never saw the real columns: the grid is a Masonry that places cards itself, so
the planner was handed one card per "column".

- packColumnsInOrder plans the real columns with the Masonry's own rule (each
  card, in order, into the shortest column), from natural heights so the plan
  does not move as cards grow. buildFilterSectionLayout uses it when a section
  has a card that scrolls and two or more columns.
- The section's cards are rendered in those planned columns, and the free space
  in a column goes to its scrolling cards, never past their own content, so short
  cards no longer stretch into empty panels.
- Free space is handed out in whole rows, round-robin to the cards given the
  fewest and neediest first, so 37px becomes one usable row for one card rather
  than three unusable slivers.
- Scrolling cards end on a whole row (at any font scale) instead of mid-row,
  using row height, first-row offset and chrome measured from the DOM.
- Sections that mix OMOP cards with injected attribute cards (Cancer Type &
  Primary Site) are planned over all their cards together.
- A stretched card's natural height is derived from its current cap rather than
  a frozen old reading, which had gone stale once caps were snapped to rows and
  made the planner overestimate its column.

Verified in a browser at 820, 1000, 1400 and 1900px across all nine sections:
no free space beside a card that needs it, every scrolling card ends on a whole
row, heights are stable, and re-planning after a filter change does not loop.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@JohnLevander
JohnLevander merged commit 385fa51 into main Sep 30, 2026
2 checks passed
@JohnLevander
JohnLevander deleted the filter-columns-grow-into-space branch September 30, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant