Skip to content

Fix: update every live badge and observe elements for resize - #40

Merged
SandObserver merged 1 commit into
mainfrom
fix/live-badge-ids-and-resize-observers
Sep 7, 2026
Merged

SandObserver merged 1 commit into
mainfrom
fix/live-badge-ids-and-resize-observers

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Replace the duplicated id="seerrCount" and id="jellyfinCount" hooks with data-live-seerr / data-live-jellyfin attributes, and update every matching node instead of the single element getElementById returned.
  • Clear and reschedule the landing page badge interval on visibilitychange, so it stops while the document is hidden.
  • Drive the phone widget fit from a ResizeObserver on .screen-inner, dropping the window resize listener and its manual requestAnimationFrame coalescing.
  • Move the scrollable-table affordance out of the concatenated script string in astro.config.mjs into a typed <script> in the Starlight head component, and observe each .sy-tscroll box with a ResizeObserver.

Testing
All green: npm run build and npm run check both pass. Verified over CDP in headless Chrome: both Seerr badges now tick in lockstep and no duplicate ids remain; the table affordance tracks live resizes in both directions across five docs pages at 380/500/700px, in both docs themes; the phone scale variables are set at 390px and cleared at 1280px. Screenshots taken at 390px and 1280px on the landing page and at 380px on the badges page in both colour schemes.

Checklist

  • npm run build and npm run check both pass.
  • Product UI is shown by running or capturing it, never recreated in CSS.
  • Any new preview or screenshot carries no private hostnames or real data.
  • Visual changes verified in both colour schemes and both docs themes.
  • Links to the app repo still resolve.

The landing page marked two badges with the same id, so getElementById
updated only the first and the badge demo's live value never changed.
Key both live badges off data attributes and write to every match.

Pause the badge interval while the document is hidden.

Replace the window resize listeners behind the phone widget fit and the
scrollable-table affordance with ResizeObserver. Both measure elements
that resize with the content column, not with the viewport. This also
moves the table script out of a concatenated string in the Astro config
into a typed script in the Starlight head component.
@SandObserver SandObserver added the bug Something isn't working label Sep 7, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying stackyard-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: a936429
Status: ✅  Deploy successful!
Preview URL: https://73394c42.stackyard-docs.pages.dev
Branch Preview URL: https://fix-live-badge-ids-and-resiz.stackyard-docs.pages.dev

View logs

@SandObserver
SandObserver merged commit c287116 into main Sep 7, 2026
2 checks passed
@SandObserver
SandObserver deleted the fix/live-badge-ids-and-resize-observers branch September 7, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant