Skip to content

feat(setup-ui): Recordings tab with list, playback and download - #228

Merged
birme merged 2 commits into
mainfrom
feat/studio/recordings-tab
Oct 20, 2026
Merged

birme merged 2 commits into
mainfrom
feat/studio/recordings-tab

Conversation

@eyevinn-developer

Copy link
Copy Markdown
Contributor

Summary

Closes #220

Changes

  • src/lib/api.ts: ApiRecording, PlaybackUnavailableReason, RecordingUploadSummary, RecordingUploadReason and recordingsApi (list, listForProduction, get), all quiet so each error shows once, inline. Adds lastRecordingUpload to the production shape. These match open-live main (src/routes/recordings.ts, src/db/types.ts, from feat(recording): connection-only recording target, downloads and upload outcome open-live#543). No fields were invented.
  • src/lib/recordings.ts (new): pure helpers. Newest-first sort by startedAt, key basename, joins to production names ("Deleted production (id)") and storage names ("Default"), duration formatting ("unknown" when durationMs is absent), playbackUnavailable text, downloadUrl with a playbackUrl new-tab fallback, upload banner, deactivate-in-flight detection, and the player error classification.
  • src/store/recordings.store.ts (new): the list for all recordings or one production, with a request sequence number so a stale response cannot overwrite the list after the filter changes. loadError keeps the backend message and status. fetchFresh(id) re-reads one recording.
  • src/pages/SetupPage/RecordingsPanel.tsx (new): the table (file, production, started, duration, size, storage), production filter, Refresh, banners, empty and 503 states, and per-row Play and Download. A row without playbackUrl shows the reason, and Play and Download are disabled.
  • src/pages/SetupPage/RecordingPlayerModal.tsx (new): fetches a fresh link each time it opens or "Reload link" is clicked. If <video> fails, it probes the URL to tell apart: link expired or denied (403), host not reachable from this browser (mentions https when Studio uses https, and covers mixed content), and unsupported file.
  • src/pages/SetupPage/index.tsx: Recordings tab. ?tab=recordings&production=<id> opens it with that production filtered.
  • src/pages/SetupPage/ProductionsPanel.tsx: read-only "Recordings" shortcut on each production row.
  • src/store/productions.store.ts: carries lastRecordingUpload through.

Test Plan

  • Unit tests pass (pnpm test: 23 files, 206 tests; 42 new in src/lib/recordings.test.ts and src/store/recordings.store.test.ts). They cover the list store (sorting, production filter, stale-response guard, join to production names), the fresh-link fetch on Play (fetchFresh refetches every call, recordingsApi.get path), and each error state (503 with no toast, 404, network, empty, playbackUnavailable reasons, upload banner, player expired/denied/unreachable/unsupported).
  • pnpm run lint (0 warnings), pnpm run typecheck, pnpm run build pass.
  • Manual verification against a live instance (Phase 4 acceptance in OL-21b: Storage tab, connection pickers and read-only bucket browser (Studio half of OL-21) #216): record for 60 s then deactivate and check the list, Play with seeking in Chrome and Safari, .mp4 download, a 403 storage key to see the banner, RECORDING_PRESIGN_TTL_S=60 to check that Play still works after 2 min, an unreachable storage endpoint, and DB down (503). Not run here because there is no live backend in this environment. Needs tester on openlivedev.

Checklist

  • Code-quality checks passed
  • No hardcoded SRT ports
  • GStreamer pipelines have watchdogs (not applicable)
  • EFP sequence validation present (not applicable)
  • docs/repo-patterns.md updated if non-obvious issue encountered (none)

Notes:

  • mixerInput per-input recordings (item 20) are not handled. RecordingDoc on open-live main has no mixerInput; it only exists if feat(recording): record inputs chosen per source assignment open-live#411 lands.
  • <video> cannot report an HTTP status. After a failure Studio checks the link's expiry and mixed content, then probes it with a no-cors request (host reachable or not) and a cors range request (reads the status if the bucket has a CORS rule). If neither gives a status, a decode error counts as "unsupported" and anything else as "expired or denied", which "Reload link" addresses.

🤖 Generated with Claude Code

Add a read-only Recordings tab after Outputs. It lists
GET /api/v1/recordings, or GET /api/v1/productions/:id/recordings when a
production filter is chosen, sorted newest first by startedAt. Columns:
file name (key basename), production name ("Deleted production" with the
id when it is gone), started, duration (durationMs, "unknown" when
absent), size and storage ("Default" without a connectionId). Each
production row gets a Recordings shortcut that opens the tab filtered.

Play opens a player that fetches GET /api/v1/recordings/:id every time
(the listed presigned URL expires after RECORDING_PRESIGN_TTL_S). Download
fetches a fresh link too and uses downloadUrl, falling back to opening
playbackUrl in a new tab. A row without playbackUrl shows the
playbackUnavailable reason with Play and Download disabled. A video load
failure is classified as link expired/denied, host unreachable from this
browser (mentions https on an https page) or unsupported file, with a
"Reload link" that refetches the recording.

The selected production's lastRecordingUpload drives a failure banner
(count, reason, retry note). While a deactivate for it is in flight in
this browser the tab shows "Uploading recordings" and refreshes the list
when it finishes. A backend 503 shows the backend message with Retry and
never the empty message. Recordings calls are quiet so each error is
shown once, inline.

Closes #220

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@birme

birme commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

daily-backlog-pr Phase 3: pr-reviewer's read-through verdict on 5ef6a1c was APPROVE, with every Prior-findings row FIXED and CI green. It was not merged: #227 merged earlier in this run and now conflicts with this branch in:

The conflict was not force-resolved. The card goes back to Ready. Phase 2's conflict path will merge main into this branch (a merge commit, no rebase), keeping both changes. After that, Step 3a can land it on this verdict without a second review, once CI is green and the eyevinn-pr-reviewer App approval is on the new head.

…s-tab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@eyevinn-pr-reviewer eyevinn-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: feat(setup-ui): Recordings tab with list, playback and download

Verdict: APPROVE

Prior findings

Sources read: PR #228 reviews (none), PR review comments (none), PR issue comments (1, birme 2026-10-19), issue #220 comments (none), parent #216 body and comments. There is no earlier REQUEST CHANGES review. The earlier read-through APPROVE was on 5ef6a1c. The head is now the merge 5f44687, which this review covers.

# Finding / criterion (source) Status Evidence on head 5f44687
1 Merge conflict with #227 in src/lib/api.ts / src/store/productions.store.ts: keep both ActivationWarning[] and lastRecordingUpload (birme, PR comment 2026-10-19) FIXED 5f44687: src/lib/api.ts:259-261,292-293,317-318; src/store/productions.store.ts:5,35-36,91-92. #227's change is intact
2 Blocked on Eyevinn/open-live#534 items 2, 4, 5, 6, 7 (#220 body) FIXED (upstream) open-live#534 was closed by open-live#543 (merged 2026-10-19). The fields and routes on open-live main match the Studio types at src/lib/api.ts:928-981
3 Blocked by #219 (#220 body) FIXED (upstream) #219 is closed. PR #225 is in this branch's base
4 19: tab after Outputs, list/filter, newest first, shortcut on production rows FIXED src/pages/SetupPage/index.tsx:20,32-33,67; src/store/recordings.store.ts:64-90; src/lib/recordings.ts:40-46; ProductionsPanel.tsx:1299
5 20: columns FIXED src/lib/recordings.ts:26-29,49-57,80-96; RecordingsPanel.tsx:183-216. mixerInput is not handled, correctly: it depends on open-live#411
6 21: fresh-link Play, Download via downloadUrl or a playbackUrl fallback FIXED RecordingPlayerModal.tsx:42-60; recordings.store.ts:92-99; RecordingsPanel.tsx:82-115; recordings.ts:119-123
7 22: upload-failure banner, "Uploading recordings" state FIXED src/lib/recordings.ts:154-170,280-294; RecordingsPanel.tsx:60-68,75-76,146-160
8 23: empty, 503 with Retry, disabled rows, player error states, "Reload link" FIXED RecordingsPanel.tsx:117,163-177,201-203,218-227; recordings.ts:98-116,186-273; RecordingPlayerModal.tsx:62-75,106-113
9 24: read-only FIXED recordingsApi (src/lib/api.ts:985-993) only sends GET
10 Unit tests: list store, fresh-link fetch, error states FIXED src/store/recordings.store.test.ts, src/lib/recordings.test.ts. 24 files / 215 tests pass on 5f44687
11 Phase 4 live criteria (#216) FIXED (code), live run outstanding The code paths are rows 4-8. A live check is still needed: tester on openlivedev after deploy (beta-regression gate)

Critical Issues

None.

Warnings (non-blocking)

  • RecordingsPanel.tsx:107 window.location.assign(downloadUrl): if the storage host can't be reached, the SPA navigates away from Studio. A hidden <a download> or window.open would keep the page.
  • A Recordings shortcut for a deleted production (stale ?production= URL) gets a 404 "Production not found" instead of that production's orphaned recordings, which are still listed under "All productions".

Nits

  • CI runs lint, typecheck and build but not pnpm test. This is outside this PR.

What Was Verified

  • Merge resolution in 5f44687 is the union of #227 and this PR. No fabricated fields: the types match open-live main exactly. The tab still works against an older backend or with missing fields. Stale-response guards are in place.
  • Local run on 5f44687: lint, typecheck, build and test (215/215) pass. CI build-and-lint is green.
  • No secrets. Presigned URLs are not logged. No new write routes.

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.

OL-21b.4: Recordings tab with list, playback and download (blocked on open-live#534 items 2,4,5,6,7)

1 participant