Skip to content

feat(tba): P0 — TBA data foundation and webcast sync - #245

Merged
tfield merged 5 commits into
mainfrom
feat/tba-data-foundation
Apr 18, 2026
Merged

feat(tba): P0 — TBA data foundation and webcast sync#245
tfield merged 5 commits into
mainfrom
feat/tba-data-foundation

Conversation

@tfield

@tfield tfield commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

tfield added 5 commits April 18, 2026 15:06
…eams page

Extend RBTournament with the enriched fields the RavenBrain backend now
returns (webcastsFromTba, webcastsLastSync, webcastsStale, tbaEventKey)
and surface them on the admin tournament-streams page.

Each webcast URL gets a CB-safe source badge derived from
webcastsFromTba membership: solid Tol-vibrant-cyan "From TBA" pill or
outlined Tol-vibrant-grey "Manual override" pill. Text labels are the
primary channel so users who cannot distinguish the two colours still
see which source each URL comes from.

When webcastsStale is true, an informational .banner-info appears above
the streams list. Wording distinguishes between "last synced N ago"
and "never synced — the TBA event key may be incorrect", so admins
understand whether the problem is transient or a misconfiguration.

TBA-sourced URLs have their Remove button disabled with a tooltip
explaining the URL is served by TBA -- this prevents the no-op UX
where Remove appeared to succeed but the URL reappeared on next render
(backend DELETE only touches manual_webcasts).

Adds .banner-info and the two badge styles to components.css with
prefers-color-scheme: dark overrides so contrast stays readable on both
light and dark themes.
Add a labelled input + Save/Clear buttons above the streams list on the
admin tournament-streams page so admins can correct the TBA event key
when FRC's auto-derived value ({year}{code}) doesn't match TBA --
common for district championships with divisional keys.

Client-side validation uses the same regex as the server
(/^20\d{2}[a-z][a-z0-9]{1,15}$/), lowercasing before compare so
"2026ONTO" is accepted and canonicalized to "2026onto". The Save
button mirrors the existing TournamentRow saving/msg pattern: disabled
during PUT, brief "Saved" fade on success, inline "Failed: reason" on
error (400 invalid format, 403 forbidden, 404 not found, or raw status
for anything else). A static hint below the input documents the
auto-derivation and override intent.

setTournamentTbaEventKey is added to rb.ts as the wrapper around the
new PUT /api/tournament/{id}/tba-event-key endpoint.
@tfield
tfield merged commit 7dfac06 into main Apr 18, 2026
4 checks passed
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