Skip to content

Polish subtitle typography, fix live ASR bilingual display, persist settings - #6

Merged
ycosine merged 1 commit into
mainfrom
agent/subtitle-design-and-sync
Jul 16, 2026
Merged

Polish subtitle typography, fix live ASR bilingual display, persist settings#6
ycosine merged 1 commit into
mainfrom
agent/subtitle-design-and-sync

Conversation

@ycosine

@ycosine ycosine commented Jul 16, 2026

Copy link
Copy Markdown
Owner

What changed

Font & subtitle design

  • Convert bundled LXGW WenKai Lite from 13 MB TTF to 5 MB WOFF2 (lossless container conversion; THIRD_PARTY_NOTICES.md and OFL references updated). Release zip drops from ~8.7 MB back to ~4 MB.
  • Add WenKai (文楷) as a subtitle typography preset and make it the new default; the YouTube overlay now injects the bundled font via @font-face.
  • Translated subtitle line renders at 0.9em of the platform caption size (CJK glyphs read larger than Latin at equal px), and the standalone ASR overlay base size is reduced.
  • Every overlay line is clamped to max 2 lines (-webkit-line-clamp).

Live ASR bilingual fix

  • Bug: the translation line was blanked whenever a partial hypothesis was streaming. In continuous speech a new partial starts right after each commit, so translations effectively never displayed — only the English transcript showed. Translation requests were being made all along; it was a display gate.
  • Fix: in bilingual mode the translation line now shows the latest committed cue's translation (lagging one sentence behind the live original), the standard pattern for live translated captions.

Settings persistence

  • translation-settings, provider-credentials, and asr-credentials move from chrome.storage.local to chrome.storage.sync — settings survive uninstall/reinstall and follow the signed-in browser profile. Translation cache stays local.
  • One-time idempotent local→sync migration runs at background startup (never overwrites existing sync values).
  • Chromium manifest gains a fixed key, pinning the extension ID (hioaccickilmocnacnbmfjbcihfgpmdj) so loading an unpacked/zip build from any directory keeps the same identity and storage. Firefox already pins via browser_specific_settings.gecko.id.
  • README (EN/ZH) privacy sections updated: keys now live in sync storage and ride the browser's own extension sync when signed in.

Notes for existing installs

  • Because the manifest key changes the unpacked extension ID, the first load of this version starts fresh one last time; after reconfiguring once, settings persist across all future reinstalls/updates.
  • Users who previously saved settings keep their stored subtitle style; pick 文楷 in Options to adopt the new default look.

Validation

  • pnpm type-check, pnpm lint, pnpm -F @extension/content-script test (25 tests), pnpm build, pnpm build:firefox
  • Verified dist contains the WOFF2 font, Chromium manifest has key + WOFF2 web-accessible resource, Firefox manifest has no key
  • dist size: 15 MB → 5.9 MB

🤖 Generated with Claude Code

Font & subtitle design:
- convert the bundled LXGW WenKai Lite from 13 MB TTF to 5 MB WOFF2
  (lossless container change; OFL notice updated)
- add WenKai as a subtitle style and make it the default, with a
  @font-face injected for the YouTube overlay
- render the translated subtitle line at 0.9em of the platform caption
  size so CJK text no longer reads oversized, shrink the standalone ASR
  overlay base size, and clamp every overlay line to 2 lines

Live ASR bilingual fix:
- the translation line was blanked whenever a partial hypothesis was
  streaming, which in continuous speech meant translations never showed;
  keep showing the latest committed cue's translation (it lags one
  sentence) instead

Settings persistence:
- move translation settings, provider credentials, and the ElevenLabs
  key from chrome.storage.local to chrome.storage.sync so they survive
  uninstall/reinstall and follow the signed-in profile
- one-time idempotent local→sync migration on background startup
- pin the Chromium extension ID with a manifest key so unpacked/zip
  installs from different directories keep the same identity (Firefox
  already has a fixed gecko id); README privacy sections updated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ycosine
ycosine merged commit d5f2068 into main Jul 16, 2026
2 checks passed
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.

1 participant