feat(onscreens): restore the state-flag overlay#800
Draft
dmerrick wants to merge 2 commits into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
ShowFlagwas a stub; the asset endpoint served a 1×1 placeholder).assets/flags/{medium,small}/(flagpedia, lowercase abbrev) — orphaned when the overlay was disabled and referenced by nothing. This relocates themedium/set intopkg/onscreens-server/assets/flags/(where//go:embedcan reach it) and deletes the redundant rootassets/flags/tree. Same images, one copy, in the embedding package.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.App.Onscreens.ShowFlag(ctx, state, dur)— threaded through the correct-guess path,!state,!flag, and!jump./onscreens/flag/showhandler was a501; rewired it to take astateparam (symmetry with the other overlays + manual debugging), dropped the strayspew.Dump.The set covers all 50 states (no DC — not in the corpus); the placeholder covers any gap.
Test plan