Skip to content

feat(ports): filter by group, and shrink the cards - #18

Merged
rogeriojunior31 merged 1 commit into
mainfrom
feat/filter-and-shrink-the-port-list
Aug 7, 2026
Merged

rogeriojunior31 merged 1 commit into
mainfrom
feat/filter-and-shrink-the-port-list

Conversation

@rogeriojunior31

Copy link
Copy Markdown
Contributor

The list was built for four ports and does not survive forty.

The cards

Every card carried a seven-line terminal mock, so scanning the page meant
scrolling past a preview per port to reach the one you wanted. The preview is
already redrawn full size on the port's own page, one click away, where there is
room to actually read it — on the index it was costing height and giving little.

So the card drops to what tells one port from another: name, blurb, the file it
installs as, and the repo link. Four short lines, which lets the grid run
narrower tracks and fit more per row.

54kB → 25kB at five ports, and the saving is per port.

The filter

One generated rule per group, which is what keeps it free of JavaScript: CSS
cannot compare a checked radio against a section's group, but it can be told
about each group by name — and the names come from the catalogue, so a new group
filters itself.

.ports-page:has(#f-editor:checked) .group:not([data-group="editor"]){display:none}

With "All" checked no rule matches and everything shows, which is also what
happens where :has() is unavailable: the page degrades to exactly how it works
today.

The radios sit off-screen rather than under display:none — a hidden input is
not focusable, and the label is the only keyboard route to them. The filter only
renders when there is more than one group.

Checked

astro check 0 errors, 56 tests, build clean. The generated CSS carries one rule
each for terminal, shell and editor, and no preview markup remains in the
cards.

The list was built for four ports and does not survive forty. Every card carried
a seven-line terminal mock, so scanning the page meant scrolling past a preview
per port to reach the one you wanted — and the preview is redrawn full size on
the port's own page, one click away, where there is room to actually read it.

So the card drops to what distinguishes one port from another: the name, the
blurb, the file it installs as, and a link to the repo. Four short lines, which
lets the grid run narrower tracks and fit more per row. The page goes from 54kB
to 25kB at five ports, and that saving is per port.

The filter is one generated rule per group, which is what keeps it free of
JavaScript: CSS cannot compare a checked radio against a section's group, but it
can be told about each group by name, and the names come from the catalogue — so
a new group filters itself. With "All" checked no rule matches and everything
shows, which is also what happens where `:has()` is unavailable. It degrades to
the page as it was.

The radios sit off-screen rather than under display:none, because a hidden input
is not focusable and the label is the only keyboard route to them.
@rogeriojunior31
rogeriojunior31 force-pushed the feat/filter-and-shrink-the-port-list branch from 2469a89 to a6abc72 Compare August 7, 2026 01:20
@rogeriojunior31
rogeriojunior31 merged commit 79d7fe7 into main Aug 7, 2026
1 check passed
@rogeriojunior31
rogeriojunior31 deleted the feat/filter-and-shrink-the-port-list branch August 7, 2026 01:20
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