Skip to content

fix: display video source type instead of title in Video Properties (NES-1210)#8968

Merged
jianwei1 merged 2 commits intomainfrom
jianweichong/nes-1210-video-source-label-displays-video-title-instead-of-source
Apr 7, 2026
Merged

fix: display video source type instead of title in Video Properties (NES-1210)#8968
jianwei1 merged 2 commits intomainfrom
jianweichong/nes-1210-video-source-label-displays-video-title-instead-of-source

Conversation

@jianwei1
Copy link
Copy Markdown
Contributor

@jianwei1 jianwei1 commented Apr 7, 2026

Summary

  • Bug: The "Video Source" field in the Video Properties sidebar was displaying the video title (e.g., "JESUS", "FallingPlates") instead of the source type
  • Fix: Uses the existing videoBlockSourceToLabel helper to show "Jesus Film Library", "YouTube", or "Custom" based on block.source
  • Test: Updated test assertion to expect source label instead of video title

Test plan

  • Open a project, add/select a Video Block
  • Go to Video Properties in the right sidebar
  • Select a video from the Library → verify "Video Source" shows "Jesus Film Library"
  • Select a video from YouTube → verify "Video Source" shows "YouTube"
  • Upload a video → verify "Video Source" shows "Custom"

Closes NES-1210

🤖 Generated with Claude Code

Summary by CodeRabbit

Bug Fixes

  • Updated video source label display in Video Options to correctly reflect the selected video source.

…NES-1210)

The Video Source accordion was showing the video title (e.g. "JESUS")
instead of the source type. Now uses the existing videoBlockSourceToLabel
helper to display "Jesus Film Library", "YouTube", or "Custom".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jianwei1 jianwei1 self-assigned this Apr 7, 2026
@linear
Copy link
Copy Markdown

linear Bot commented Apr 7, 2026

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

Walkthrough

Updated the Video component to compute the video source label using a dedicated videoBlockSourceToLabel utility function instead of deriving it from the block's media video properties. The corresponding test expectation was updated to reflect the new label output.

Changes

Cohort / File(s) Summary
Video Source Label Refactoring
apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.tsx, apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.spec.tsx
Replaced inline label computation logic with videoBlockSourceToLabel(block.source, t) utility function. Test assertion updated to expect "Jesus Film Library" instead of "FallingPlates" to align with the new label computation method.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing the display of video source type instead of title in the Video Properties component, with the ticket reference (NES-1210).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 jianweichong/nes-1210-video-source-label-displays-video-title-instead-of-source

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.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 7, 2026

View your CI Pipeline Execution ↗ for commit 4cc99f0

Command Status Duration Result
nx run journeys-admin-e2e:e2e ✅ Succeeded 31s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
nx run-many --target=upload-sourcemaps --projec... ✅ Succeeded 9s View ↗
nx run-many --target=deploy --projects=journeys... ✅ Succeeded 2m 52s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-07 21:41:03 UTC

@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin April 7, 2026 04:17 Inactive
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.spec.tsx (1)

82-82: Add coverage for the other source mappings (YouTube and Custom).

Line 82 validates only the internal/library case. Given this fix is source-mapping specific, adding cases for the other VideoBlockSource values will better protect against regressions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.spec.tsx`
at line 82, Add unit tests in Video.spec.tsx to cover the other VideoBlockSource
mappings (YouTube and Custom) in addition to the existing internal/library case;
update or add test cases that render the component with source set to
VideoBlockSource.YouTube and VideoBlockSource.Custom and assert the expected UI
text (e.g., the YouTube label and the custom label) using the same testing
utilities (getByText/toBeInTheDocument) as the existing test so mapping changes
will be caught by CI. Ensure you reference the same render helper/setup used in
the file so the new tests target the same component instance and props as the
original internal/library assertion.
apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.tsx (1)

13-13: Consider moving videoBlockSourceToLabel to a shared video utility location.

Line 13 imports from a VisitorInfo/VisitorJourneysList path, which tightly couples this editor property panel to another feature area. A shared block/video util module would keep boundaries cleaner.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.tsx`
at line 13, The import of videoBlockSourceToLabel in Video.tsx couples the
editor to VisitorJourneysList; extract or move the videoBlockSourceToLabel
function into a shared video utility module (e.g., a new shared/utils/video or
shared/blocks/video util), update Video.tsx to import videoBlockSourceToLabel
from that shared module, and update any other files that currently import it
from VisitorInfo/VisitorJourneysList to reference the new shared location so all
usages (including the Video component) use the centralized util.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.spec.tsx`:
- Line 82: Add unit tests in Video.spec.tsx to cover the other VideoBlockSource
mappings (YouTube and Custom) in addition to the existing internal/library case;
update or add test cases that render the component with source set to
VideoBlockSource.YouTube and VideoBlockSource.Custom and assert the expected UI
text (e.g., the YouTube label and the custom label) using the same testing
utilities (getByText/toBeInTheDocument) as the existing test so mapping changes
will be caught by CI. Ensure you reference the same render helper/setup used in
the file so the new tests target the same component instance and props as the
original internal/library assertion.

In
`@apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.tsx`:
- Line 13: The import of videoBlockSourceToLabel in Video.tsx couples the editor
to VisitorJourneysList; extract or move the videoBlockSourceToLabel function
into a shared video utility module (e.g., a new shared/utils/video or
shared/blocks/video util), update Video.tsx to import videoBlockSourceToLabel
from that shared module, and update any other files that currently import it
from VisitorInfo/VisitorJourneysList to reference the new shared location so all
usages (including the Video component) use the centralized util.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 537058ba-39ee-4134-9d0e-ff0956e248d6

📥 Commits

Reviewing files that changed from the base of the PR and between 74dc141 and ec0ba5f.

📒 Files selected for processing (2)
  • apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.spec.tsx
  • apps/journeys-admin/src/components/Editor/Slider/Settings/CanvasDetails/Properties/blocks/Video/Video.tsx

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Wed Apr 8 09:37:35 NZST 2026

@jianwei1 jianwei1 requested a review from csiyang April 7, 2026 04:37
@jianwei1 jianwei1 requested a review from Ur-imazing April 7, 2026 21:31
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin April 7, 2026 21:33 Inactive
@jianwei1 jianwei1 enabled auto-merge April 7, 2026 21:33
@jianwei1 jianwei1 added this pull request to the merge queue Apr 7, 2026
Merged via the queue into main with commit 5e7ae6d Apr 7, 2026
21 checks passed
@jianwei1 jianwei1 deleted the jianweichong/nes-1210-video-source-label-displays-video-title-instead-of-source branch April 7, 2026 21:41
tanflem pushed a commit that referenced this pull request Apr 13, 2026
…NES-1210) (#8968)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants