Skip to content

侧边栏:标题栏下加字幕下拉框,和弹窗、专注模式选同一条字幕 - #428

Merged
PathGao merged 1 commit into
mainfrom
sidepanel-subtitle-select
Oct 25, 2026
Merged

PathGao merged 1 commit into
mainfrom
sidepanel-subtitle-select

Conversation

@PathGao

@PathGao PathGao commented Oct 25, 2026

Copy link
Copy Markdown
Owner

改了什么

侧边栏视频的标题栏下加一行「字幕」下拉框(弹窗那一条的样式,32px,普通网页不显示)。开着侧边栏切视频时,不用再开弹窗去选字幕。

  • 换字幕走弹窗同一条路:popup-select-subtitle → 视频页 switchSubtitle。下拉框的选项由新的 MdgSites.fillSubtitleSelect 画,弹窗、专注模式原来各一份,改成三处共用。
  • 视频页换完字幕发 mdg-subtitle-changed,侧边栏收到后重读,弹窗、专注模式里换的也跟着变。
  • AI 正在回答时灰掉;视频页关了、从别处读出的历史对话只显示字幕名并灰掉,悬停写原因。
  • 修一个顺带发现的问题:已保存的对话在自己的视频页上继续问时,侧边栏只在第一次记下视频内容,中途换的字幕不会用到后面的提问里(sidepanel-state.js 的 keep 分支)。

验证

  • node scripts/selftest.mjs:39 个通过。新加的 sidepanel / sidepanel-state 测试去掉修复后会失败。
  • node scripts/smoke.mjs 通过。
  • 无头 Chrome 装这份扩展,在 YouTube 上:侧边栏换字幕,视频页跟着换;照弹窗的方式换,侧边栏跟着变;同一标签页换视频,列表跟着换;换到网页,这一行隐藏;没有扩展报错。
  • 没测到:B站(无头没登录拿不到字幕)、分拣台里的视频、对话中途换字幕后的「已切换字幕:…」提示(只有 selftest)。

@PathGao
PathGao merged commit 51f032b into main Oct 25, 2026
2 checks passed
@PathGao
PathGao deleted the sidepanel-subtitle-select branch October 25, 2026 08:05
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