Skip to content

feat(678): typed Scenario object on /api/v2/plays + Session Viewer parity#688

Merged
jonathaneoliver merged 1 commit into
devfrom
feat/scenario-typed-api-678
Jun 7, 2026
Merged

feat(678): typed Scenario object on /api/v2/plays + Session Viewer parity#688
jonathaneoliver merged 1 commit into
devfrom
feat/scenario-typed-api-678

Conversation

@jonathaneoliver
Copy link
Copy Markdown
Owner

What

Parts 1+2 of #677 (split out as #678). Promotes the run-identity Scenario assembly off the dashboard into the API contract, so the Sessions list, Session Viewer header, and chat tools share one typed shape instead of each re-deriving it client-side (#673 did it inline in Sessions.vue).

Backend (forwarder)

  • internal/plays/scenario.goenrichScenario() attaches a nested scenario object to each play row at the single FindPlays chokepoint (covers both the list and GetPlaySummary detail paths). Hybrid-sourced: device/player/app/os/content from the authoritative typed summary columns; test/platform/run_id parsed from the testing= label tier. Omitted entirely (not {}) when a play has no identity fields.
  • scenario_test.go — hybrid sources, omit-when-empty, os-major-only, device-class-only.

API

  • forwarder.yaml — new Scenario schema + optional scenario on PlaySummary.
  • Regenerated tools/harness-cli forwarder client (Scenario type + field).

Frontend

  • v2-repo.ts — typed Scenario interface + scenario? on PlaySummary.
  • Sessions.vuescenario() now prefers the server object via scenarioView(); scenarioFromRow() is the rollout fallback (frontend may ship ahead of the forwarder — separate deploys). Platform/Test facets read scenario-first via rowPlatform/rowTest.
  • SessionDetails.vue — adds the Platform tile alongside the existing Test/Run ID + device/app/OS tiles, so the viewer surfaces the same identity set as the Sessions Scenario cell.

Test

  • go build / go vet / go test clean (forwarder + harness-cli); new scenario tests pass.
  • vue-tsc --noEmit clean; production vite build clean.

Rollout note

The scenario object requires a forwarder redeploy (make analytics-rebuild-forwarder) to populate. Until then the frontend falls back to client-side assembly, so nothing regresses if the dashboard deploys first.

Follow-up

Part 3 — stamp server/go-live build + manifest variant — tracked in #679 (design-gated).

Closes #678

🤖 Generated with Claude Code

…rity

Promote the run-identity ("Scenario") assembly off the dashboard into the
API contract, so the Sessions list, Session Viewer header, and chat tools
share one shape instead of each re-deriving it client-side (#673 did it
inline in Sessions.vue).

Backend (forwarder):
- internal/plays/scenario.go — enrichScenario() attaches a nested `scenario`
  object to each play row at the single FindPlays chokepoint (covers list +
  GetPlaySummary detail). Hybrid-sourced: device/player/app/os/content from
  the typed summary columns; test/platform/run_id parsed from the testing=
  label tier. Omitted entirely when a play has no identity fields.
- scenario_test.go — hybrid sources, omit-when-empty, os-major-only,
  device-class-only.

API:
- forwarder.yaml — new Scenario schema + optional `scenario` on PlaySummary.
- Regenerated tools/harness-cli forwarder client (Scenario type + field).

Frontend:
- v2-repo.ts — typed `Scenario` interface + `scenario?` on PlaySummary.
- Sessions.vue — scenario() now prefers the server object via scenarioView();
  scenarioFromRow() is the rollout fallback (frontend may ship ahead of the
  forwarder). Platform/Test facets read scenario-first via rowPlatform/rowTest.
- SessionDetails.vue — add the Platform tile alongside Test/Run ID so the
  viewer surfaces the same identity set as the Sessions Scenario cell.

go build/vet/test (forwarder + harness-cli) and vue-tsc all clean.

Part 3 (stamp server/go-live build + manifest variant) tracked in #679.

Closes #678

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Jun 7, 2026
@jonathaneoliver jonathaneoliver merged commit 4b6e4dd into dev Jun 7, 2026
1 check passed
@jonathaneoliver jonathaneoliver deleted the feat/scenario-typed-api-678 branch June 7, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant