Skip to content

feat(subtitle): add shadow/outline adjustments, expand fonts selection, and fix YouTube API error handling#1660

Open
Ckrvxr wants to merge 6 commits into
mengxi-ream:mainfrom
Ckrvxr:feat/subtitle-core
Open

feat(subtitle): add shadow/outline adjustments, expand fonts selection, and fix YouTube API error handling#1660
Ckrvxr wants to merge 6 commits into
mengxi-ream:mainfrom
Ckrvxr:feat/subtitle-core

Conversation

@Ckrvxr

@Ckrvxr Ckrvxr commented Jun 7, 2026

Copy link
Copy Markdown

PR Title

Sorry about the previous mess—I wasn't familiar with the workflow and ended up pushing a huge bunch of unrelated changes. It triggered the anti-spam/security policy by mistake, sorry for the trouble!

抱歉之前不熟悉流程,直接推送了一大坨过来,触发了风控,麻烦你们了。之前两个PR 忽略即可。

feat(subtitle): add shadow/outline adjustments, expand fonts selection, and fix YouTube API error handling


Description

📝 Type of Changes

  • ✨ New feature (feat)
  • 🐛 Bug fix (fix)
  • 📦 Other changes that do not modify src or test files (chore)

📖 Description

This PR introduces granular style controls for video subtitles, adds more localized font options, improves API stability for YouTube subtitles, and upgrades development dependencies.

Key Changes:

  1. Subtitle Style Enhancements:
  • Replaced simple boolean toggles for shadow and outline with high-precision sliders (shadowIntensity and strokeWidth) allowing users to fine-tune subtitle visibility.
  • Implemented dynamic CSS generation for textShadow and WebkitTextStroke to render smooth text effects.
  • Added a config migration script (v075-to-v076) to seamlessly port existing user settings without breaking changes.
  1. Font Expansion: - Added support for new high-quality fonts including MiSans, IBM Plex, and TsukuARdGothic Std across multilingual options.
  2. YouTube Subtitle Robustness:
  • Improved response handling in YoutubeSubtitlesFetcher by validating empty responses text before parsing JSON, preventing unexpected crashes when YouTube returns an empty subtitle payload.
  1. DX & Dependencies:
  • Integrated cross-env into package.json script hooks to ensure seamless environment variable injection across different OS environments (e.g., Windows).
  • Added @ai-sdk/provider and reselect dependencies.
  • Complete multi-language localization updates for the new style settings.

🔗 Related Issue

None, Personaly Feature.

🧪 How Has This Been Tested?

  • Verified through manual testing (Tested slider responsiveness, rendering effects of text shadows/outlines, and font family switching locally).

📋 Checklist

  • I have tested these changes locally
  • I have updated the documentation accordingly if necessary
  • My code follows the code style of this project
  • My changes do not break existing functionality

Fearture Preview

PixPin_2026-06-08_01-22-53 PixPin_2026-06-08_01-20-36

@changeset-bot

changeset-bot Bot commented Jun 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 432e0d2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added feat contrib-trust:new PR author trust score is 0-29. needs-maintainer-review Contributor trust automation recommends maintainer review. labels Jun 7, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Contributor trust score

12/100 — New contributor

This score estimates contributor familiarity with mengxi-ream/read-frog using public GitHub signals. It is advisory only and does not block merges automatically.

Outcome

Score breakdown

Dimension Score Signals
Repo familiarity 0/35 commits in repo, merged PRs, reviews
Community standing 7/25 account age, followers, repo role
OSS influence 3/20 stars on owned non-fork repositories
PR track record 2/20 merge rate across resolved PRs in this repo

Signals used

  • Repo commits: 0 (author commits reachable from the repository default branch)
  • Repo PR history: merged 0, open 1, closed-unmerged 2
  • Repo reviews: 0
  • PR changed lines: 185 (+176 / -9)
  • Repo permission: read
  • Followers: 10
  • Account age: 60 months
  • Owned non-fork repos considered: max 4, total 8 (Ckrvxr/mactype_ini (4), Ckrvxr/mihomo_yaml (3), Ckrvxr/pysine (1), Ckrvxr/esp32s3_hearts_band (0), Ckrvxr/mpv_slim (0), Ckrvxr/skill_music_reaper (0), Ckrvxr/ppg_max30100_cnn_beats (0), Ckrvxr/zynq7020_circuit_simulation_2025g_vitis (0), Ckrvxr/acuteswirl_playground (0), Ckrvxr/simple_greasyfork_script_filter_js (0), Ckrvxr/hzu_jwxt_jppighand_js (0), Ckrvxr/hzu_jwxt_icsexporter_js (0), Ckrvxr/hzu_jwxt_score_js (0), Ckrvxr/computed_life (0), Ckrvxr/browser_text_render_tweaks (0), Ckrvxr/extreme_picture_converter_py (0), Ckrvxr/zynq7020_freertos_u8g2_ssd1315_iic_example (0), Ckrvxr/embedded_modern_dev_space (0))

Policy

  • Low-score review threshold: < 30
  • Auto-close: score < 20 and changed lines > 1000
  • Policy version: v1.1

Updated automatically when the PR changes or when a maintainer reruns the workflow.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 386c81c7ff

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

export const THEME_STORAGE_KEY = "theme"
export const DEFAULT_DETECTED_CODE = "eng" as const
export const CONFIG_SCHEMA_VERSION = 75
export const CONFIG_SCHEMA_VERSION = 76

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the v75→v76 migration before bumping schema

When an installed user upgrades from schema 75, this bump makes initializeConfig call runMigration(76, ...), but repo-wide search of src/utils/config/migration-scripts shows the latest script is v074-to-v075.ts and there is no v075-to-v076.ts. runMigration therefore throws, the loop advances anyway, and the stricter subtitle schema rejects the old config because fontShadowIntensity and fontStrokeWidth are missing, causing the extension to fall back to DEFAULT_CONFIG and lose the user's settings; migrateConfig paths such as Google Drive sync/import will throw the missing-migration error directly.

Useful? React with 👍 / 👎.

@Ckrvxr

Ckrvxr commented Jun 7, 2026

Copy link
Copy Markdown
Author

(已经在新的PR中解决了)

目前来说有个没有找到解决办法的Bug(感觉无解),开启OutLine时部分字体部分字形触发。
是描边算法和字体本身导致的bug.会在激烈倒角处产生猪尾巴一样的毛刺。
比如Noto Sans:
PixPin_2026-06-08_02-21-33
IBM Plex 和微软雅黑则没有:
PixPin_2026-06-08_02-29-25
但目前来说,整体观感还是会比原来的遮罩背景好很多。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 432e0d2983

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

export const THEME_STORAGE_KEY = "theme"
export const DEFAULT_DETECTED_CODE = "eng" as const
export const CONFIG_SCHEMA_VERSION = 75
export const CONFIG_SCHEMA_VERSION = 76

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add v076 migration example data

When this schema bump is present, all-migrations.test.ts derives latestVersionStr from CONFIG_SCHEMA_VERSION and imports src/utils/config/__tests__/example/v076.ts, but repo-wide inspection of src/utils/config/__tests__/example shows the newest fixture is still v075.ts. As a result, the migration test suite fails before validating the new v75→v76 script; add a v076 fixture (with the new subtitle style fields) alongside the migration.

Useful? React with 👍 / 👎.

@Ckrvxr

Ckrvxr commented Jun 8, 2026

Copy link
Copy Markdown
Author

抱歉,由于这次完全重写了字幕渲染引擎,并完善了渲染和灯光选择功能,导致修改的代码量过大,直接触发了 GitHub 机器人的风控策略而被自动关闭了。
我写代码时性子比较急,一下发了一堆 PR,真的给团队添麻烦了!🙏✨
烦请各位维护者忽略之前的那一堆东西,直接查看并考虑合并下面这个最新的 PR 即可:
🔗 #1662
非常感谢!


Apologies for the confusion! Since this update completely rewrote the subtitle rendering engine and perfected the rendering and lighting selection features, the massive amount of code changes accidentally triggered GitHub's anti-spam/security policy, causing the previous PR to be auto-closed.
I got a bit impatient while coding and ended up pushing multiple PRs at once. I'm truly sorry for the extra trouble caused to the team! 🙏✨
Please ignore all the previous mess and directly review/merge this latest PR instead:
🔗 #1662
Thank you so much for your time!

@mengxi-ream mengxi-ream requested a review from taiiiyang June 8, 2026 04:49
@mengxi-ream

mengxi-ream commented Jun 8, 2026

Copy link
Copy Markdown
Owner

有些 shadow 如果是不明显的话,或许可以直接加上 shadow,但是不要暴露选项。就是尽量希望选项少一些,不要让用户看到吓人。具体由你来定啦 @taiiiyang

有一些如果不是所有人都需要的样式的话,可以后面做一个类似翻译样式的,用户可以直接用 CSS 来写,这样既满足了自定义,又不会让选项多的吓人(很多选项大部分人根本不会用到)。

@Ckrvxr

Ckrvxr commented Jun 8, 2026

Copy link
Copy Markdown
Author

收到建议,现在已经有数值膨胀的苗头了。。。之前用隔壁沉浸式翻译就有眼花缭乱的感觉。确实"傻瓜"一些会好好很多。
我再慢慢打磨一段时间。有啥建议和想法尽管提。

@mengxi-ream

mengxi-ream commented Jun 8, 2026

Copy link
Copy Markdown
Owner

收到建议,现在已经有数值膨胀的苗头了。。。之前用隔壁沉浸式翻译就有眼花缭乱的感觉。确实"傻瓜"一些会好好很多。 我再慢慢打磨一段时间。有啥建议和想法尽管提。

我觉得有一些样式好的话,可以直接默认加进去,比如这个 shadow。然后之后 PR 在做自定义 css。具体怎么判断,可能要 @taiiiyang 来看看 PR。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contrib-trust:new PR author trust score is 0-29. feat needs-maintainer-review Contributor trust automation recommends maintainer review. on-hold

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants