Skip to content

Versioned stylesheet URLs; compact table rows on phones - #69

Merged
patrickballard merged 1 commit into
mainfrom
fix/versioned-css-and-phone-table
Nov 29, 2026
Merged

patrickballard merged 1 commit into
mainfrom
fix/versioned-css-and-phone-table

Conversation

@patrickballard

Copy link
Copy Markdown
Contributor

Two fixes for the gap wheels page.

Stale CSS after a deploy

GitHub Pages lets a browser reuse a file for 10 minutes, so right after a deploy a returning visitor could get the new page with an old cached stylesheet. That's how the new popover menu showed up as a full-screen box on phones today. The page now links:

  • brand.css?v=<first 10 hex of its sha256>, hashed from site/brand.css as it's copied;
  • /tracker/style.css?v=<hash>, from the copy the tracker serves when the page is built. main() reads it, and the page is rebuilt every hour, so the version follows the tracker within the hour. If it can't be read, the build warns, links it without a version (as before) and carries on. PyPI still decides whether the build goes ahead.

The tests check both hashes, that a different stylesheet gets a different URL, and the fetch and its fallback. They never use the network.

The table on phones

At 375px the published-wheels table squeezed the install command into a 70px column. The long pip install --extra-index-url … became a ~340px-tall column, so every row was about 344px tall and mostly empty. The install cell now has an 18em minimum, set by a small inline <style> (the page's CSP already allows inline styles, and an inline rule can't go stale in a cache):

before after
375px: row height 344–366px 82–104px
375px: table width (scrolls sideways) 665px 848px
1280px: row height 126px 82px
1280px: table width 888px 888px

On desktop the command now wraps in three lines instead of five. Nothing else on the page moved. I compared before and after screenshots at 375px and 1280px in light and dark.

pytest: 319 passed.

🤖 Generated with Claude Code

GitHub Pages lets browsers reuse a file for 10 minutes, so after a deploy a returning visitor
could get the new page with an old cached stylesheet. The page now links brand.css as
brand.css?v=<first 10 hex of its sha256>, and the tracker's style.css with the hash of the
copy the tracker serves when the page is built (hourly); if it can't be read, the link has no
version and the build goes on.

At 375px the published-wheels table squeezed the install command to 70px, so every row was
about 344px tall. The install cell now has a minimum of 18em (an inline style; the page's CSP
already allows them): rows are about 104px on a phone, and at 1280px they go from 126px to 82px
with the table still 888px wide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patrickballard
patrickballard merged commit 89cca68 into main Nov 29, 2026
1 check passed
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