Skip to content

fix(web): label the AI subtitle menu item "Generate subtitles with AI…" when it can only transcribe - #5514

Merged
Quick104 merged 3 commits into
Silo-Server:mainfrom
Rhainland:fix/5352-ai-subtitle-menu-label
Nov 30, 2026
Merged

Quick104 merged 3 commits into
Silo-Server:mainfrom
Rhainland:fix/5352-ai-subtitle-menu-label

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #5352
Related issue: N/A
Validation tasks: unblocks #1165 C2; unblocks #1166 C1

Other clients: Apple Silo-Server/silo-apple#1314; Android Silo-Server/silo-android#1074; Roku N/A (no AI subtitle entry in the Roku player)

The web player's Subtitles menu always labelled its AI entry "Translate with AI…". When the server has only transcription turned on, or the video has no subtitle track the server can translate, that entry opens a dialog that can only generate subtitles from the audio, titled "Generate subtitles with AI". In those cases the menu now reads "Generate subtitles with AI…". It still reads "Translate with AI…" whenever a track can be translated.

Approach

The menu picks its label with the same condition the dialog uses to choose its mode: translation enabled and at least one translatable subtitle track. When the menu shows the entry and the dialog would open in audio mode, the menu shows the new label. When the entry appears is unchanged.

The new catalog key web.subtitles.menu.generateWithAi comes from Silo-Server/silo-translations#196. This branch syncs it from a local checkout, and I will re-sync with --version once that release is published.

Validation

  • Web: pnpm run lint, format:check, build and budget:check pass; make test-web passes (358 files, 3463 tests).
  • I ran a component test for the three label cases red, then green, during development. It isn't committed because CONTRIBUTING "Decide what to test" excludes small UI and copy changes.
  • Local build with a stub AI provider and two synthetic movies (one without subtitles, one with an English SRT), in headless Chromium at 1440 px and 390 px. I checked six combinations of server settings and titles before and after the fix:
    • Transcription only: "Translate with AI…" before, "Generate subtitles with AI…" after. The dialog is titled "Generate subtitles with AI" in both builds.
    • Translation and transcription on, title without subtitles: "Translate with AI…" before, "Generate subtitles with AI…" after. The dialog opens in audio mode.
    • Translation on, title with an SRT: "Translate with AI…" in both builds, with or without transcription. The dialog is titled "Translate subtitles with AI".
    • Translation only, title without subtitles: no AI entry in either build.
  • en-XA pseudo-locale: the new item and the dialog title both render pseudo-localized at both widths, with no plain English left.
  • The Go half of the gate was not run because this change touches no Go code.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-5514/

Surface and build: web player Subtitles menu, transcription only, desktop 1440 px and mobile 390 px, local build of this branch against a stub AI provider.

Risks

None identified. The change affects only the label. When the entry appears and what the dialog does are unchanged.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code (via T3 Code); Codex CLI for code review
  • Tool(s): Claude Code, Codex CLI, GitHub CLI, Playwright (headless Chromium), ffmpeg
  • Model(s): claude-opus-5-5; gpt-6.2-sol (code review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: dual-code-review at medium effort on the final diff: two independent reviewers, gpt-6.2-sol via Codex CLI and claude-opus-5-5, checked correctness, repository standards and the issue spec. Neither found a correctness or spec problem. Sol noted that the added component test broke "Decide what to test" (a small UI change), so I removed it. Opus noted, as a low-severity judgement call, that the menu repeats the dialog's capability check. That duplication was already there before this change, so I left it as it is.

Note

Show "Generate subtitles with AI…" label when only transcription is available in SubtitleMenu

  • In SubtitleMenu.tsx, the AI menu item now checks audio transcription and subtitle-track translation as separate capabilities. It stays visible when either is enabled and subtitles can be added.
  • The item uses the generation label ("Generate subtitles with AI…") when track translation is unavailable, and the translation label otherwise. Both labels open the existing subtitle tool.
  • Adds the new label key to keys.ts and locale catalogs, including pseudo-locales for testing.

Macroscope summarized 1b0b5b9.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 491185d3-8d7e-49b5-ab00-8d1c33a9d42e
Commits

Reviewing files that changed from the base of the PR and between 1b0b5b9 and e71ed7e.

Files selected for processing: 44

  • .silo-translations
  • web/src/locales/ar-XB.json
  • web/src/locales/ar.json
  • web/src/locales/bg.json
  • web/src/locales/ca.json
  • web/src/locales/cs.json
  • web/src/locales/da.json
  • web/src/locales/de.json
  • web/src/locales/el.json
  • web/src/locales/en-XA.json
  • web/src/locales/en.json
  • web/src/locales/es.json
  • web/src/locales/et.json
  • web/src/locales/fi.json
  • web/src/locales/fr.json
  • web/src/locales/he.json
  • web/src/locales/hi.json
  • web/src/locales/hr.json
  • web/src/locales/hu.json
  • web/src/locales/id.json
  • web/src/locales/it.json
  • web/src/locales/ja.json
  • web/src/locales/keys.ts
  • web/src/locales/ko.json
  • web/src/locales/lt.json
  • web/src/locales/lv.json
  • web/src/locales/ms.json
  • web/src/locales/nb.json
  • web/src/locales/nl.json
  • web/src/locales/pl.json
  • web/src/locales/pt-BR.json
  • web/src/locales/pt-PT.json
  • web/src/locales/ro.json
  • web/src/locales/ru.json
  • web/src/locales/sk.json
  • web/src/locales/sl.json
  • web/src/locales/sv.json
  • web/src/locales/th.json
  • web/src/locales/tr.json
  • web/src/locales/uk.json
  • web/src/locales/vi.json
  • web/src/locales/zh-Hans.json
  • web/src/locales/zh-Hant.json
  • web/src/player/components/SubtitleMenu.tsx

No actionable comments were generated in the recent review.

Walkthrough

The subtitle menu offers the AI action when translation or transcription is available. Its label reflects whether translation is available. The locale catalogs and MessageKey include a label for AI subtitle generation.

Changes: AI subtitle menu

Layer / File(s) Summary
Add the generation label
.silo-translations, web/src/locales/{en,en-XA,ar-XB}.json, web/src/locales/keys.ts
The locale catalogs and MessageKey add web.subtitles.menu.generateWithAi. The catalog revision identifier is updated.
Select AI menu eligibility and label
web/src/player/components/SubtitleMenu.tsx
The AI menu item is available when subtitles can be added and translation or transcription is available. It says “Translate with AI” when translation is available; otherwise, it says “Generate with AI.”

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • Issue #1166: The web validation task covers exposing AI subtitle operations, including transcription. This change updates the menu label for the transcription path.
  • Issue #1163: The acceptance issue covers AI subtitle actions across first-party players. This change addresses the web player's transcription label only.

Possibly related PRs

Suggested reviewers: quick104, darthshadow

Merge Risk: Minimal · previous review 1b0b5

The AI subtitle menu label now matches what the dialog offers: "Generate subtitles with AI…" when translation is unavailable, and "Translate with AI…" otherwise. The change is small, confined to the web UI and reversible. No merge-blocking risk was identified; the translations marker should be re-synced to a released version once the catalog release is published.

Architecture risk: Low · up to 1b0b5

The change affects 1 source area.

Changed areas: web

Review details

Systems and components

  • observed — 5 changed files mapped to web.

Before / after behavior

  • observed — Modified behavior in web/src/player/components/SubtitleMenu.tsx: SubtitleMenu now computes translation and transcription eligibility separately, then enables the AI tool when subtitles can be added and either capability is available. The previous combined canTranslate condition was replaced.
  • observed — Modified behavior in web/src/player/components/SubtitleMenu.tsx: The AI menu item now uses canUseAi instead of the previous combined canTranslate condition.
  • observed — Modified behavior in web/src/player/components/SubtitleMenu.tsx: The AI menu item now says “Translate with AI” when a translatable track is available; otherwise, it says “Generate with AI.” Previously, it always used the translation label.
  • observed — Modified behavior in web/src/locales/ar-XB.json: Adds the web.subtitles.menu.generateWithAi locale entry with an AI subtitle-generation label wrapped in directional control characters.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: the AI subtitle menu item label changes to "Generate subtitles with AI…" when the entry can only transcribe. The raw summary and objectives confirm that SubtitleMenu.tsx an…
Linked Issues check Passed [#5352] requires the web player AI subtitle menu label to match what the AI dialog offers. At the reviewed head, web/src/player/components/SubtitleMenu.tsx sets canTranslateTrack = aiEnabled && tracks…
Out of Scope Changes check Passed At the reviewed head, the SubtitleMenu.tsx logic change only renames the AI entry label. The show condition canUseAi = canAddSubtitles && (canTranslateTrack || canTranscribe) keeps the entry visibilit…
Description check Passed The description is specific and on-topic. It names the web player Subtitles menu, the old and new labels, the condition that picks each label, the linked issue and catalog key, the validation steps, a…
Full details: Title check

Explanation

The title names the change: the AI subtitle menu item label changes to "Generate subtitles with AI…" when the entry can only transcribe. The raw summary and objectives confirm that SubtitleMenu.tsx and the locale files change the label to match the dialog mode, which matches the title. The title is long at 99 characters, but it is specific and on-topic.

Full details: Linked Issues check

Explanation

[#5352] requires the web player AI subtitle menu label to match what the AI dialog offers. At the reviewed head, web/src/player/components/SubtitleMenu.tsx sets canTranslateTrack = aiEnabled && tracks.some(isTranslatableSource) and canTranscribe = aiTranscribeEnabled && audio tracks exist. The menu item shows t("web.subtitles.menu.translateWithAi") when canTranslateTrack is true and t("web.subtitles.menu.generateWithAi") otherwise. The dialog in SubtitleTranslateModal.tsx starts in subtitles mode only when translateEnabled && sourceTracks.length > 0 (same isTranslatableSource filter), and otherwise starts in audio mode. The title switches to 'Generate' in audio mode. So the menu label matches the dialog's starting mode. The key web.subtitles.menu.generateWithAi is present in keys.ts and the locale files, per the previous review and PR description. Unverified: the parent passes translateEnabled from aiEnabled, which was not read. The incremental diff from the previous reviewed head (7a635b2) to head (1b0b5b9) could not be read, so this verdict rests on the head file contents. The Macroscope summary text ("Generate with AI") does not match the code, so it was not used as evidence.

Full details: Out of Scope Changes check

Explanation

At the reviewed head, the SubtitleMenu.tsx logic change only renames the AI entry label. The show condition canUseAi = canAddSubtitles && (canTranslateTrack || canTranscribe) keeps the entry visibility of the prior code. The new key is added to keys.ts and the locale files, which the label needs. The .silo-translations version bump is the catalog sync for that key. The PR description discloses that the sync came from a local checkout. This is a provenance concern for the release process, not a scope violation. No unrelated code was identified in the files read. The incremental diff since the previous review could not be read, so changes in that range are not directly verified. The head file contents show no unrelated logic.

Full details: Description check

Explanation

The description is specific and on-topic. It names the web player Subtitles menu, the old and new labels, the condition that picks each label, the linked issue and catalog key, the validation steps, and the scope limits. It matches the changeset in web/src/player/components/SubtitleMenu.tsx, the locale catalogs, and keys.ts.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f033ef9d-4827-40f8-8a79-2849dc71e2d3
Commits

Reviewing files that changed from the base of the PR and between 7a635b2 and 1b0b5b9.

Files selected for processing: 5

  • .silo-translations
  • web/src/locales/ar-XB.json
  • web/src/locales/en-XA.json
  • web/src/locales/en.json
  • web/src/locales/keys.ts
Files skipped from review as they are similar to previous changes: 3

  • web/src/locales/ar-XB.json
  • web/src/locales/en-XA.json
  • web/src/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@silo-triage silo-triage Bot added the size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. label Nov 28, 2026
@silo-kody

This comment has been minimized.

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority. and removed size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. labels Nov 28, 2026
@silo-kody

silo-kody Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Comment thread .silo-translations Outdated
Comment on lines +2 to +3
version=local-c406d7fec298
sha256=-

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug medium

Local translation pin breaks reproducible translation synchronization

The local-only version makes scripts/sync-translations fail without arguments, preventing reproduction of the committed translations. After the catalog change is released, pin the published release and its checksum.

Prompt for LLM
File .silo-translations, lines 2-3:

Local translation pin breaks reproducible translation synchronization

The local-only version makes `scripts/sync-translations` fail when run without arguments, so the committed translation state cannot be reproduced from the pinned release. Pin the published translation release and its checksum after the catalog change is released.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Known and planned: the new key comes from Silo-Server/silo-translations#196, which hasn't been released yet. Once it merges and its release is published, this branch re-syncs with --version <release> so .silo-translations names that release and its checksum, before this PR merges.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Understood. The local pin is temporary, and the planned re-sync to the published release and checksum addresses the reproducibility concern. The suggestion remains applicable until that re-sync is completed before merge.

@Rhainland
Rhainland force-pushed the fix/5352-ai-subtitle-menu-label branch from e125e85 to 7a635b2 Compare November 28, 2026 18:40
@silo-kody

silo-kody Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

When the server can only create subtitles from the audio (translation off, or
no subtitle track it can translate), the player's subtitle menu now reads
"Generate subtitles with AI…" instead of "Translate with AI…", matching the
dialog it opens.

Translations are synced from a local silo-translations checkout that adds
web.subtitles.menu.generateWithAi; re-sync with --version once that catalog
change is released.

Closes Silo-Server#5352
@Rhainland
Rhainland force-pushed the fix/5352-ai-subtitle-menu-label branch from 7a635b2 to 1b0b5b9 Compare November 28, 2026 22:37
@silo-kody

silo-kody Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@Quick104

Copy link
Copy Markdown
Contributor

/silo review

Reviewed head: 1b0b5b9

The label change is correct. The menu now names the entry with the same condition the dialog uses to pick its mode: translation enabled and at least one translatable subtitle track. When the entry is shown is unchanged. I found no defect this PR introduces, so there are no inline findings.

Verification. A throwaway component test that renders SubtitleMenu with a mocked AI status covered the four cases from the description. The two "Generate subtitles with AI…" cases (transcription only; translation on but no translatable track) failed against the base component and pass at this head. The "Translate with AI…" case and the hidden-entry case pass on both, as expected. I didn't commit the test, for the reason the description gives. I didn't run a live sandbox.

Translation catalog. Silo-Server/silo-translations#196 was missing its translation pass, which is why its translations-complete check failed. I ran make translate-pr and pushed the result to that PR as a separate commit, covering all 38 languages, and added the per-language table to its description.

Left for the maintainers.

  • Merge feat(catalog): add web subtitle menu label for AI subtitle generation silo-translations#196 once its checks pass, then re-sync this branch with scripts/sync-translations --version <release>. .silo-translations still names a local build (local-e91795f585ed), and only en, en-XA and ar-XB carry the new key. The existing review thread on .silo-translations tracks the same step.
  • Not caused by this PR: the AI dialog's accessible name stays "Translate subtitles with AI" in audio mode (SubtitleTranslateModal.tsx, the label prop of PlayerModalDialog), while its visible heading switches to "Generate subtitles with AI". It is the same on main. Screen-reader users who pick "Generate subtitles with AI…" hear the dialog announced as translation. It needs a separate one-line fix.
  • Optional cleanup: the menu and the dialog each compute "can translate a track" and "can transcribe". A small shared helper next to isTranslatableSource would stop the two from drifting apart. That duplication predates this PR.

Validated features. No passed 1.0 case is affected. Of the two cases that found this bug, #1165 C2 and #1166 C1, neither has been run yet. This PR lets the web client pass them, so I changed the Validation tasks: line to unblocks #1165 C2; unblocks #1166 C1.

User manual. "Translate or transcribe with AI" on the Missing subtitles page (using-silo/missing-subtitles.md) tells web users to open Translate with AI…. On servers with only transcription, or titles without a translatable subtitle, the entry will read Generate subtitles with AI…. I recommend a siloserver.org issue for that page. None exists yet.

Other clients. Apple Silo-Server/silo-apple#1314 and Android Silo-Server/silo-android#1074 are open and linked. Roku has no AI subtitle entry. The Jellyfin-compatible API and the server API are unaffected.

Council (one round on 1b0b5b9):

Member Round 1
Sol (gpt-6.2-sol, medium) 8/10
Opus (claude-opus-5-5, medium) 7/10
Gemini (gemini-4-neon, medium) 7/10

All three found the label logic correct. Each scored the pending re-sync and the dialog's accessible name, both covered above. Sol also noted that the dialog keeps its starting mode when the subtitle list changes while it is open. That behavior is older than this PR, and I couldn't confirm that a refresh actually removes a translatable track mid-dialog.

Fit: 9/10 · Readiness: 8/10 — conditional (assuming CI is green)

  • Fit: the change makes the entry describe what the dialog will do. It adds one string, no setting, and no new surface.
  • Readiness: the logic is verified, and a test failed on the base. One condition remains before merge: the catalog release and the --version re-sync.

🤖 Claude Code (claude-opus-5-5)

@Rhainland

Copy link
Copy Markdown
Contributor Author

Thanks. I opened Silo-Server/siloserver.org#478 for the Missing subtitles page. I'll re-sync .silo-translations with --version once silo-translations#196 is merged and released.

Regenerate the web locales from one catalog build with both open catalog
changes: Silo-Server/silo-translations#151 (web.search.typePodcast, pinned
by main) and Silo-Server#196 (web.subtitles.menu.generateWithAi, this branch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added size/L 200–499 added + deleted lines (all files); change volume, not priority. and removed size/S 0–49 added + deleted lines (all files); change volume, not priority. labels Nov 30, 2026
@Quick104
Quick104 merged commit ee293b2 into Silo-Server:main Nov 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/L 200–499 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Web player's AI subtitle menu says "Translate with AI…" when only transcription is enabled

2 participants