Skip to content

fix: remove other languages from subtitles select#8122

Merged
tataihono merged 3 commits intomainfrom
wat-187-update-subtitles-select
Nov 3, 2025
Merged

fix: remove other languages from subtitles select#8122
tataihono merged 3 commits intomainfrom
wat-187-update-subtitles-select

Conversation

@tataihono
Copy link
Contributor

@tataihono tataihono commented Nov 2, 2025

Updates to SubtitlesSelect component and its test file.

Summary by CodeRabbit

  • Bug Fixes

    • Simplified subtitle selection by removing category grouping and showing only languages with available subtitles; tightened native-name display logic.
  • Refactor

    • Streamlined language filtering to derive available subtitle languages more predictably.
  • Tests

    • Updated tests to assert language options via accessible roles/names rather than DOM positions.
  • Chores

    • Removed unused translation entries for the removed category headings.

@linear
Copy link

linear bot commented Nov 2, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 2, 2025

Walkthrough

Filters subtitle options to only video-available subtitle language IDs (SUBTITLE_LANGUAGE_IDS), removes Autocomplete grouping into "Available/Other Languages", tightens native-name display logic, and updates tests to use centralized language fixtures with ARIA-role-based assertions; locale keys for the removed groups were deleted.

Changes

Cohort / File(s) Summary
Tests — fixtures & assertions
apps/watch/src/components/LanguageSwitchDialog/SubtitlesSelect/SubtitlesSelect.spec.tsx, apps/watch/src/components/LanguageSwitchDialog/LanguageSwitchDialog.spec.tsx
Added centralized language fixtures (English, French, Spanish, non-subtitle); updated mocks to return the languages array; changed assertions to query options by role/name (getByRole/queryByRole) and removed checks for grouped headings.
Subtitles selector logic
apps/watch/src/components/LanguageSwitchDialog/SubtitlesSelect/SubtitlesSelect.tsx
Derives languages from useLanguages() then filters by SUBTITLE_LANGUAGE_IDS via useMemo; removes Autocomplete groupBy ("Available"/"Other") and simplifies options generation; only shows nativeName when present and different from displayName.
Localization
libs/locales/en/apps-watch.json
Removed translation entries for "Available Languages" and "Other Languages".

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant Component as SubtitlesSelect
  participant Hook as useLanguages()
  participant Filter as SUBTITLE_LANGUAGE_IDS filter
  participant Autocomplete as Autocomplete UI

  User->>Component: open subtitles dropdown
  Component->>Hook: fetch allLanguages / isLoading
  Hook-->>Component: allLanguages, isLoading
  Component->>Filter: filter allLanguages by SUBTITLE_LANGUAGE_IDS (useMemo)
  Filter-->>Component: filteredLanguages
  Component->>Autocomplete: render options from filteredLanguages
  Autocomplete-->>User: show option list (no "Available/Other" groups)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to useMemo dependencies and correct application of SUBTITLE_LANGUAGE_IDS.
  • Verify accessibility after removing groupBy (ARIA roles, focus/keyboard behavior).
  • Confirm tests' fixtures/mocks reflect realistic language IDs and that assertions cover absence/presence cases.

Possibly related PRs

Suggested reviewers

  • Kneesal
  • mikeallisonJS

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues Check ✅ Passed The changes in this PR directly address the objective stated in WAT-187 to align the subtitle dropdown format with the dubbed languages dropdown. The key modifications—removing the "Available Languages" and "Other Languages" grouping, filtering subtitle languages by SUBTITLE_LANGUAGE_IDS, simplifying the options generation by removing the groupBy logic, and updating test assertions to use role-based queries—all work together to remove the categorical separation that was making the subtitle dropdown differ from the dubbed languages dropdown. The removal of translation entries and the alignment of test patterns suggest the subtitle and dubbed language dropdowns will now have consistent presentation and behavior.
Out of Scope Changes Check ✅ Passed All code changes in this PR are directly scoped to the objective of aligning the SubtitlesSelect dropdown format with dubbed languages. The modifications include updates to the SubtitlesSelect component implementation, corresponding test file updates, removal of now-unused translation keys, and updates to the LanguageSwitchDialog tests to reflect the new format. Each change is either a necessary component update, test assertion alignment, or cleanup of removed UI groupings, with no unrelated modifications present.
Title Check ✅ Passed The PR title "fix: remove other languages from subtitles select" is specific and directly related to the main changes in the changeset. It accurately describes the primary implementation change: the removal of the "Available Languages" and "Other Languages" grouping categories from the SubtitlesSelect component. The title uses clear, concise language and refers directly to the affected component. A teammate scanning the PR history would clearly understand that this change removes the secondary language categorization from the subtitles dropdown. While the higher-level objective is to align the subtitle dropdown format with the dubbed languages dropdown, the title appropriately captures the main technical implementation at the code level.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wat-187-update-subtitles-select

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

nx-cloud bot commented Nov 2, 2025

View your CI Pipeline Execution ↗ for commit feab9e3

Command Status Duration Result
nx run journeys-admin-e2e:e2e ✅ Succeeded 37s View ↗
nx run watch-modern-e2e:e2e ✅ Succeeded 3s View ↗
nx run journeys-e2e:e2e ✅ Succeeded 14s View ↗
nx run watch-e2e:e2e ✅ Succeeded 12s View ↗
nx run videos-admin-e2e:e2e ✅ Succeeded 4s View ↗
nx run-many --target=vercel-alias --projects=watch ✅ Succeeded 2s View ↗
nx run-many --target=upload-sourcemaps --projec... ✅ Succeeded 11s View ↗
nx run-many --target=deploy --projects=watch ✅ Succeeded 1m 31s View ↗
Additional runs (12) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-11-02 22:58:58 UTC

@blacksmith-sh

This comment has been minimized.

@github-actions github-actions bot temporarily deployed to Preview - journeys-admin November 2, 2025 21:29 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys November 2, 2025 21:29 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin November 2, 2025 21:29 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch-modern November 2, 2025 21:29 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch-modern ✅ Ready watch-modern preview Mon Nov 3 11:54:18 NZDT 2025

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Mon Nov 3 11:54:51 NZDT 2025

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Mon Nov 3 11:54:36 NZDT 2025

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Mon Nov 3 11:55:42 NZDT 2025

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Mon Nov 3 11:55:20 NZDT 2025

@tataihono tataihono requested a review from csiyang November 2, 2025 22:51
@tataihono tataihono self-assigned this Nov 2, 2025
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin November 2, 2025 22:52 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin November 2, 2025 22:52 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys November 2, 2025 22:52 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch-modern November 2, 2025 22:52 Inactive
@tataihono tataihono changed the title WAT-187: Update SubtitlesSelect component WAT-187: update subtitles select component Nov 3, 2025
@tataihono tataihono changed the title WAT-187: update subtitles select component fix: update subtitles select component Nov 3, 2025
@tataihono tataihono changed the title fix: update subtitles select component fix: remove other languages from subtitles select Nov 3, 2025
@tataihono tataihono enabled auto-merge November 3, 2025 00:31
@tataihono tataihono requested a review from csiyang November 3, 2025 00:32
@tataihono tataihono added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit a9cbb99 Nov 3, 2025
35 of 40 checks passed
@tataihono tataihono deleted the wat-187-update-subtitles-select branch November 3, 2025 00:37
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