Skip to content

侧边栏:字幕下拉框后面加「刷新」,和弹窗的一样 - #429

Merged
PathGao merged 2 commits into
mainfrom
sidepanel-subtitle-refresh
Oct 26, 2026
Merged

PathGao merged 2 commits into
mainfrom
sidepanel-subtitle-refresh

Conversation

@PathGao

@PathGao PathGao commented Oct 26, 2026

Copy link
Copy Markdown
Owner

改了什么

侧边栏「字幕」一行的右边加一个「刷新」,图标和弹窗右上角的那个一样。刷新就是重新读视频和字幕,所以放在字幕旁边;普通网页没有这一行,也就没有这个按钮。刷新和设置上下对齐,字幕栏和平台下拉框右端对齐。

  • 点了走 refreshContextManually(refresh: true)。读的时候图标转圈、不能点;读失败变红,下次读成功再恢复,和弹窗的 is-error 一样。
  • 空状态里的「重试」也走这个函数,所以点「重试」时它一样转圈。
  • conventions.selftest.js 的 3a 允许清单加一条:读的时候直接 disabled,finally 打开,和弹窗的 setBusy 同理。
  • DESIGN.md 侧边栏字幕那一条补上这个按钮;dev-sidepanel/index.html 按新的 sidepanel.html 重新生成。

验证

  • node scripts/selftest.mjs:39 个通过。新加的 sidepanel 测试查读的时候转圈、不能点,读失败变红,读成功恢复。
  • node scripts/smoke.mjs 通过。
  • 无头 Chrome 打开 dev-sidepanel/index.html:刷新和设置都在 x 340–368,字幕栏和平台下拉框右端都在 332;看了平时、读取中、读取失败三种样子;点一下读完后恢复原样。
  • 没测到:真 B站 / YouTube 视频页上点刷新(无头没登录)。

重新读视频和字幕;读的时候图标转圈、不能点,读失败变红,下次读成功再恢复。「重试」也走同一个函数,一样转圈。
@PathGao
PathGao merged commit 87aa9f1 into main Oct 26, 2026
3 of 4 checks passed
@PathGao
PathGao deleted the sidepanel-subtitle-refresh branch October 26, 2026 12:20
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