Skip to content

Highlight the viewer's own team on scoreboard graphs - #176

Open
tire-fire wants to merge 1 commit into
dbaseqp:mainfrom
tire-fire:feat/highlight-own-team
Open

tire-fire wants to merge 1 commit into
dbaseqp:mainfrom
tire-fire:feat/highlight-own-team

Conversation

@tire-fire

@tire-fire tire-fire commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Alternative to #174 for #171: instead of a separate chart, each team's own row is highlighted on the existing scoreboard graphs, without revealing anything on an anonymized scoreboard.

  • www/api/graphs.go: the services, scores and uptimes endpoints mark the caller's own series with Self, based on the logged-in team. When scrubbing, every other series stays "Team" with ID 0 and the shuffle is unchanged; only the caller's own row keeps its ID so it still links to their services page. Responses now send Cache-Control: private, no-store, since they differ per caller.
  • static/templates/pages/graphs.html: the viewer's team is shown by color alone, with no extra label text. It is pinned to the top row of the Service Status and Uptime heatmaps with a bold purple label, drawn as a thick purple line on top in Scores Over Time, and shown as a purple bar on the Leaderboard. Labels are matched by position because anonymized labels are all "Team". Purple is dropped from the other series' palette so it stays unique.
  • Admins, red team and logged-out viewers see no change.

Tests

  • New tests/integration/graphs_test.go covers all three endpoints as the team itself, red team, logged out, and admin. It checks that only the caller's series is marked, other IDs stay 0, no team names appear in anonymized responses, the cache header is set, and admins still see real names.
  • tests/testutil: adds ResetCompetitionState, because the new test starts the competition and the persisted StartedAt otherwise broke TestImportedInjectScheduleAnchorsOnceToActualStart.
  • The full suite, gofmt and go vet pass. The page was also rendered headless with mocked data in light and dark mode for anonymized/named/no-team viewers, including after a resize.

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