Skip to content

fix: 阅读页目录位置、移动端交互和主题切换优化 - #16

Open
Aafff623 wants to merge 7 commits into
StatIndet:mainfrom
Aafff623:fix/article-toc-right-rail
Open

fix: 阅读页目录位置、移动端交互和主题切换优化#16
Aafff623 wants to merge 7 commits into
StatIndet:mainfrom
Aafff623:fix/article-toc-right-rail

Conversation

@Aafff623

@Aafff623 Aafff623 commented Aug 29, 2026

Copy link
Copy Markdown

对应 #15 里提的几个阅读体验问题,都在这个分支上改了。

主要做了这些:

  • 目录从正文顶上挪到了右边,做成 sticky,翻页时一直能看到;阅读进度和回顶/到底的按钮放在右栏靠下的位置
  • 标签从文章末尾挪到标题下面
  • 手机上点目录没反应的问题修了(标题 id 的编码没处理导致的)
  • 电脑上目录点第二下卡死的问题也修了
  • 文章页的时钟特效改成双击才触发,主页还是单击
  • 深色/浅色切换点了马上有反应,之前偶尔点了完全没反应的问题也一起修了

顺手修了两个小东西:封面图缓存文件名从 md5 换成 sha256;同步最新 main 的时候发现 embeds 里有个 locale 写法会让页面打开直接报错,也一起修了。

有一点要说明:目录位置、标签位置、文章页时钟改双击,这些属于默认行为变了;原来超宽屏下的动画阅读轨道在新布局里就没有了。如果想保留旧行为,可以商量做成开关。然后 check.sh 本地全跑过,桌面和手机宽度都看过一遍。

- mobile TOC: decode %-encoded heading ids before getElementById
- desktop TOC: intercept anchor clicks with smooth scroll +
  history.replaceState to avoid daybook-router fallback recursion
- move TOC from article top into a sticky right rail
- pin reading controls (progress, top/bottom) above the aside tools
- compact author identity aligned with the persistent logo
- move tags from article bottom into the header meta area
- merge meta info into a single row
- article pages: clock effect requires double-click, single clicks
  on blank areas no longer trigger it (home stays single-click)
- fix mouseenter on document resetting hover state, which caused
  link clicks to be treated as blank-area clicks
- apply theme mode and button state immediately on click instead of
  waiting for the View Transition capture frame
- guard isTransitioning with a 2s timeout and try/catch so a
  never-settling finished promise (e.g. background tab) can no
  longer brick all theme/palette toggles
- homepage single-click vs article single/double-click clock gating
- clock must not carry over from the notes list into articles
- right rail TOC visible, sticky and progress updates on scroll
Intl.NumberFormat rejects underscore locale codes; the zh_CN/en_US
rename broke every page load with RangeError: Invalid language tag
@StatIndet

Copy link
Copy Markdown
Owner
recording_20260830_10-46-36_30831.mp4

@StatIndet

Copy link
Copy Markdown
Owner

recording_20260830_10-46-36_30831.mp4

  • 标签的位置被占了。
  • 右上logo的位置被占了。

@StatIndet

Copy link
Copy Markdown
Owner

recording_20260830_10-46-36_30831.mp4

* 标签的位置被占了。

* 右上logo的位置被占了。

三分之二的布局我会重排的,宽屏下面暂时先不要动了。

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.

2 participants