Skip to content

feat(onscreens): restore the state-flag overlay#800

Draft
dmerrick wants to merge 2 commits into
developfrom
feat/restore-state-flags
Draft

feat(onscreens): restore the state-flag overlay#800
dmerrick wants to merge 2 commits into
developfrom
feat/restore-state-flags

Conversation

@dmerrick

@dmerrick dmerrick commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Brings back the on-stream state-flag overlay, which has been a no-op since the disk-write cleanup removed the per-state image picker (ShowFlag was a stub; the asset endpoint served a 1×1 placeholder).

  • Assets: the repo already carried the full state-flag set at assets/flags/{medium,small}/ (flagpedia, lowercase abbrev) — orphaned when the overlay was disabled and referenced by nothing. This relocates the medium/ set into pkg/onscreens-server/assets/flags/ (where //go:embed can reach it) and deletes the redundant root assets/flags/ tree. Same images, one copy, in the embedding package.
  • Transport: new oe.FlagShow{State} payload + FlagShowSubject. The client (onscreens-client.ShowFlag) normalizes a full name or abbrev to the two-letter code and publishes over NATS — a state with no known flag is a no-op. The server stores the abbrev on the flag onscreen; the asset handler serves the matching embedded flag, falling back to the transparent placeholder for an unset/unknown state.
  • Callers: App.Onscreens.ShowFlag(ctx, state, dur) — threaded through the correct-guess path, !state, !flag, and !jump.
  • HTTP parity: the legacy /onscreens/flag/show handler was a 501; rewired it to take a state param (symmetry with the other overlays + manual debugging), dropped the stray spew.Dump.

The set covers all 50 states (no DC — not in the corpus); the placeholder covers any gap.

Test plan

  • `go build` + `go vet`; `pkg/{onscreens-events,onscreens-client,onscreens-server,chatbot}` suites green
  • new tests: client publishes `FlagShow` w/ normalized abbrev (+ unknown-state no-op); server `handleFlagShow` stores state; `flagPNG` embed lookup + fallback
  • CI green
  • Dana: on stage, a correct `!guess` / `!flag` / `!state` / `!jump` shows the right state flag on stream — and eyeball the OBS Flag source sizing, since flags have varying aspect ratios

dmerrick and others added 2 commits June 2, 2026 22:29
The flag overlay has been a no-op since the disk-write cleanup removed the
per-state image picker (ShowFlag was a stub, the asset endpoint served a 1×1
placeholder). Bring it back:

- Embed all 50 US state flags (assets/flags/<abbrev>.png, fetched from the
  public-domain flagcdn set) alongside GPS.png so the slim image is
  self-contained.
- Carry the state on flag.show: new oe.FlagShow{State} payload +
  FlagShowSubject. onscreens-client.ShowFlag normalizes a full name or
  abbrev to the two-letter code (no-op for an unknown state); the server
  stores it on the flag onscreen and the asset handler serves the matching
  embedded flag, falling back to the transparent placeholder.
- Thread the state through the chatbot callers (guess / !state / !flag /
  !jump) via App.Onscreens.ShowFlag(ctx, state, dur).
- Make the flag HTTP handler functional (state param) for parity with the
  other overlays instead of leaving a 501.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nload

The repo already carried the full state-flag set at assets/flags/{medium,
small}/ (flagpedia, lowercase abbrev) — orphaned when the overlay was
disabled, referenced by nothing. Rather than ship a second copy, relocate
the medium set into pkg/onscreens-server/assets/flags/ (where //go:embed
can reach it) and delete the now-redundant root assets/flags/ tree.

Same images, one copy, in the embedding package.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dmerrick dmerrick marked this pull request as draft June 3, 2026 04:07
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