feat(player): add transparent subtitle background option - #58
Merged
Conversation
Render subtitles on a transparent background (keep only text + outline, drop the black caption background) via a new per-player preference. - PlaybackPreferencesManager persists subtitleBackgroundTransparent (default false) - PlayerScreen derives a CaptionStyleCompat with a transparent background when enabled - Settings PlaybackPanel gains a transparent-background toggle - Web control (DTO/request + frontend switch) exposes the same option - Unit tests cover preference persistence and caption style derivation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThe change adds a persisted subtitle background transparency preference. Android settings and the player use it, while web-control APIs and the frontend load and save it. ChangesSubtitle background transparency
Estimated code review effort: 4 (Complex) | ~35 minutes Sequence Diagram(s)sequenceDiagram
participant PlaybackPanel
participant SettingsViewModel
participant PlaybackPreferencesRepository
participant PlaybackPreferencesManager
participant PlayerViewModel
participant PlayerScreen
PlaybackPanel->>SettingsViewModel: setSubtitleBackgroundTransparent(value)
SettingsViewModel->>PlaybackPreferencesRepository: set preference
PlaybackPreferencesRepository->>PlaybackPreferencesManager: persist Boolean value
PlayerViewModel->>PlaybackPreferencesRepository: get preference during initialization
PlaybackPreferencesRepository-->>PlayerViewModel: return Boolean value
PlayerViewModel-->>PlayerScreen: expose subtitleBackgroundTransparent
PlayerScreen->>PlayerScreen: apply subtitleCaptionStyle
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a per-player preference to render subtitles on a transparent background — only the text and outline are kept, and the black caption background is dropped.
Changes
PlaybackPreferencesManagerpersistssubtitleBackgroundTransparent(defaultfalse); added toPlaybackPreferencesRepository.PlayerScreenderives aCaptionStyleCompatwith a transparent background when the option is on;PlayerViewModelexposes the state.PlaybackPanelgains a "透明底 / 黑色底" toggle.PlaybackSettingsDto/Requestcarry the flag;WebControlServiceget/set it; frontendApp.vueadds the switch.Tests
PlaybackPreferencesManagerTest: preference persistencePlayerSubtitleStyleTest: caption style derivation keeps text/outline and only clears the backgroundWebControlSettingsRouteTest: round-trip via the settings APINotes
feat/subtitle-transparent-backgroundNULfile in the repo root was left untracked intentionally (not part of this change).Summary by CodeRabbit
New Features
Tests