Skip to content

Fix blank clip detail page (undefined var) + type-check the SPA in build#24

Merged
nmbrthirteen merged 1 commit into
mainfrom
fix/clip-detail-undefined-file
Jun 18, 2026
Merged

Fix blank clip detail page (undefined var) + type-check the SPA in build#24
nmbrthirteen merged 1 commit into
mainfrom
fix/clip-detail-undefined-file

Conversation

@nmbrthirteen

@nmbrthirteen nmbrthirteen commented Jun 18, 2026

Copy link
Copy Markdown
Owner

ClipDetail referenced a removed file variable in the player conditional → ReferenceError → blank /clip/:id. Use clip.output_path. The client SPA isn't type-checked by the build (vite/esbuild skip types), so it shipped silently; build-studio.sh now runs the client tsc.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed clip detail display to correctly show rendered output when available.
  • Chores

    • Added TypeScript type-checking to the build process for improved code quality assurance.

Switching the preview to id-based URLs removed `const file`, but the player
conditional still used it — a ReferenceError that blanked /clip/:id. Use
clip.output_path instead. The client SPA isn't type-checked by vite/esbuild, so
this shipped silently; build-studio.sh now runs the client tsc to catch it.
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 17ad8651-3ce9-4a26-999d-ee59d8ee977a

📥 Commits

Reviewing files that changed from the base of the PR and between 35bbc8d and 3ee20ff.

📒 Files selected for processing (2)
  • scripts/build-studio.sh
  • src/ui/client/ClipDetail.tsx

📝 Walkthrough

Walkthrough

The build script gains a pre-build TypeScript type-check (npx tsc --noEmit) targeting the SPA client config. In ClipDetail.tsx, the conditional that controls whether ClipPlayer renders is corrected to evaluate clip.output_path instead of a previously undefined file variable.

Changes

ClipPlayer Fix and Build-Time Type Guard

Layer / File(s) Summary
Fix ClipPlayer condition and add TS type-check
src/ui/client/ClipDetail.tsx, scripts/build-studio.sh
ClipDetail.tsx replaces the file variable reference with clip.output_path in the player conditional. build-studio.sh adds a npx tsc --noEmit -p src/ui/client/tsconfig.json step before npm run build to catch type errors early.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A bunny found a bug one day,
file was undefined, come what may 🐇
clip.output_path to the rescue it went,
And tsc --noEmit was wisely sent,
No more mystery vars shall silently stray! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clip-detail-undefined-file

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nmbrthirteen nmbrthirteen merged commit 4625ee1 into main Jun 18, 2026
4 of 5 checks passed
@nmbrthirteen nmbrthirteen deleted the fix/clip-detail-undefined-file branch June 18, 2026 12:40
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