Skip to content

fix(star-tracker): de-inflate chart-view counts + per-repo breakdown#62

Merged
wavekat-eason merged 2 commits into
mainfrom
fix/star-tracker-double-chart-fetch
May 17, 2026
Merged

fix(star-tracker): de-inflate chart-view counts + per-repo breakdown#62
wavekat-eason merged 2 commits into
mainfrom
fix/star-tracker-double-chart-fetch

Conversation

@wavekat-eason
Copy link
Copy Markdown
Contributor

Summary

  • Chart preview used dual <img class="light"> / <img class="dark"> with CSS-driven theme toggling. Both fetched on every page render → analytics chart-view counts were ~2× inflated. Now one <img> with JS-swapped src. Toggle behavior preserved (still smooth, no flicker on existing radio change handler).
  • Landing-page auto-preview switched from dual imgs to <picture><source media="prefers-color-scheme: dark">…</picture> so the browser fetches only the matching theme.
  • New "Views by destination" section in the Audience panel groups views by (repo, kind), so the owner can tell whether traffic is hitting the org-wide chart or a specific repo's chart/page.

Notes

  • One <img> means no-JS visitors no longer get the CSS-only theme toggle on the preview. Acceptable — the panel and toggles already require JS for split/style/range/embed-snippet refresh.
  • Honest about preview-fetch reduction only — Camo-proxied README embeds still hit us normally, since they don't fire from our pages.

Test plan

  • Load /wavekat, watch Network panel: one chart.svg request per render (vs two before).
  • Toggle theme on the preview: src swaps, no second img exists, no double fetch.
  • On the landing page, switch OS theme: only the matching variant of /wavekat/chart.svg is fetched.
  • Visit a repo page like /wavekat/wavekat-vad, then check the owner Audience panel — the repo name shows up in "Views by destination" with its own chart/page counts.

🤖 Generated with Claude Code

The chart preview rendered two <img> tags (light + dark) with CSS
toggling visibility, so every page load fetched both variants and
doubled the logged chart-view count. Switch to one <img> swapped by
JS, and switch the landing-page auto-preview to <picture> so only
the matching theme actually fetches.

Also add a "Views by destination" breakdown in the Audience panel,
grouping by (repo, kind) so the owner can see which org/repo pages
and embedded charts are getting traffic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 17, 2026

Owner viewing /:slug/:repo now sees an Audience panel scoped to just
that repo's chart and page views. Uses the same viewsSummary helper
with an optional repo filter. The "Views by destination" sub-section
is suppressed when scoped (only one destination — the repo itself).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wavekat-eason wavekat-eason merged commit 954f9d4 into main May 17, 2026
4 checks passed
@wavekat-eason wavekat-eason deleted the fix/star-tracker-double-chart-fetch branch May 17, 2026 09:01
wavekat-eason pushed a commit that referenced this pull request May 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.0.23](wavekat-com-v0.0.22...wavekat-com-v0.0.23)
(2026-05-19)


### Features

* **gha-runners:** dockerized self-hosted runner setup
([#65](#65))
([120fd7e](120fd7e))
* self-hosted GHA runners on aoc-m3l + role-label workflow routing
([#64](#64))
([d2d8415](d2d8415))


### Bug Fixes

* **gha-runners:** install gh CLI and Rust toolchain in docker image
([#66](#66))
([9b167e7](9b167e7))
* **star-tracker:** de-inflate chart-view counts + per-repo breakdown
([#62](#62))
([954f9d4](954f9d4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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