Skip to content

fix(web): size subtitles by the window, not the film's aspect ratio - #5510

Merged
Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/5444-subtitle-size-wide-films
Nov 28, 2026
Merged

Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/5444-subtitle-size-wide-films

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #5444
Related issue: N/A
Validation tasks: none (reaches #1159 C1 and C4, neither run yet)

Other clients: Apple Silo-Server/silo-apple#1208; Android Silo-Server/silo-android#1087; Roku N/A (silo-roku has no subtitle size scaling of its own)

In the web player, a wide film's subtitles were larger than a 16:9 episode's in the same window. This happened whenever the window was wider than the film. At 1600×600 with Size X-Large, a 2.40:1 film drew 45 px text against 33 px for a 16:9 episode; on a 3440×1239 ultrawide it was 93 px against 69 px. Landscape phones hit it too. This change gives every film the same subtitle size in a given window.

Approach

computeSubtitleFontScale took its reference height from the picture's own aspect ratio, so a wide film that filled the window's height got a taller reference than a 16:9 picture. In Fit, the scale now comes from the largest 16:9 frame that fits the player: min(height, width × 9/16) / 720. That is the value a 16:9 picture already had, so 16:9 sizes do not change in any window. A 4:3 picture in a window narrower than 16:9, which used to get larger text, now matches too.

Fill still sizes text from the player height, as before. That size never depended on the film, and dropping it would shrink Fill text in narrow and portrait windows, which the issue did not ask for. Unlike the patch attached to the issue, this change keeps the fit mode as an input for that reason.

Top and Lower Third positions are still placed from the picture's reference frame. The issue notes they can sit outside the window for a wide film in an ultrawide window. That is left for a separate change.

Validation

  • Vitest: full suite passes; a new test covers the Fit scale in a window wider than a 2.40:1 film and in a window narrower than 16:9.
  • Web lint (0 errors, existing warnings only), format:check, build with the type check, and budget:check pass.
  • verify-local-paths, verify-bidi, verify-size-ratchet and verify-case-collisions pass. No Go code changed.
  • Local build: played a synthetic 1920×800 film and a 1920×1080 episode, each with an SRT, at Size X-Large in Chrome at seven window sizes, before and after the change. The measured font sizes are below.

Evidence

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

Computed subtitle font size, X-Large, same build and data before and after
Window Film 2.40:1 before Episode 16:9 before Film 2.40:1 after Episode 16:9 after
3440×1239 93 px 69 px 69 px 69 px
1600×600 45 px 33 px 33 px 33 px
1440×560 42 px 31 px 31 px 31 px
1440×900 45 px 45 px 45 px 45 px
900×900 28 px 28 px 28 px 28 px
844×390 (phone, landscape) 26 px 22 px 22 px 22 px
390×844 (phone, portrait) 12 px 12 px 12 px 12 px

Risks

Wide films get smaller subtitles than before in windows wider than 16:9, down to the size a 16:9 episode already gets there. 16:9 content is unchanged everywhere. None identified otherwise.

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, Playwright (headless Chrome) for the before/after measurements
  • Model(s): claude-opus-5-5; gpt-6.2-sol (code review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: two independent reviews of the full diff (Claude Opus via Claude Code, and GPT via Codex CLI), each checking correctness, the repository's standards, and the issue's expected behavior. Neither found a correctness problem. Both noted that Fill keeps its old sizing, unlike the patch attached to the issue. That is intended and explained under Approach. One reviewer suggested moving the test to the useSubtitleLayout hook. It stays on the scale function, because that is the logic that broke and the hook only passes the player size through.

In a window wider than the film, a 2.40:1 film's subtitles were drawn
up to 1.35 times larger than a 16:9 episode's at the same size setting,
because the font scale followed the picture's own aspect ratio. The
scale now comes from the largest 16:9 frame that fits the player, so
every film gets the same text size in a given window. A 16:9 episode
keeps its current size in every window.

Closes Silo-Server#5444
@silo-kody

silo-kody Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Code Review Could Not Complete ⚠️

The review failed before suggestions could be generated.

Reason: Rate limit reached on the provider (openai_compatible). Try again in a few minutes.

openai_compatible · gpt-6.1-terra · HTTP 429 · generalist

Provider said: The usage limit has been reached

After fixing the issue, comment @kody review on this PR to re-run the review.

Silo Kody — review incomplete

This review did not finish. Resolve the error reported above, then retry with @kody start-review in a PR comment. Treat any comments already posted as a partial review.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

​

@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 28, 2026
@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

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 59 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: 20888aa7-6e24-4d32-9fd9-bab1d5c7fa1b
Commits

Reviewing files that changed from the base of the PR and between 0a631fb and 31b653a.

Files selected for processing: 4

  • web/src/lib/subtitleAppearance.test.ts
  • web/src/lib/subtitleAppearance.ts
  • web/src/player/components/VideoPlayer.tsx
  • web/src/player/hooks/useSubtitleLayout.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@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 labels Nov 28, 2026
@Quick104
Quick104 merged commit f87aae6 into Silo-Server:main Nov 28, 2026
19 of 20 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/S 0–49 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: in a window wider than the film, a wide film's subtitles get larger than a 16:9 episode's

2 participants