Skip to content

feat: add local doc bookmarks and highlight-based resume - #37

Merged
Jiu-xiao merged 1 commit into
devfrom
feat/local-bookmarks-20261127
Nov 27, 2026
Merged

Jiu-xiao merged 1 commit into
devfrom
feat/local-bookmarks-20261127

Conversation

@Jiu-xiao

Copy link
Copy Markdown
Member

Picks and refines the high-value parts of #31 (xiaoshuaijie):

  • Zero theme eject: embeds the bookmark toggle cleanly inside .xr-float-dock above .xr-progress-circle (ReadingProgress.tsx + xrstyle-reading.css) on /docs/... & /en/docs/..., adds a single native navbar link (书签 / Bookmarks), and drops the floating selection popup and DocItem/Layout / TOC/Desktop overrides.
  • Anchor capture & CSS.highlights resume: captures a visible non-
     block excerpt (docContext.ts) and restores via block-boundary-aware text indexing + progress-nearest match selection + ::highlight(xr-bookmark-flash) (	extLocator.ts, custom.css).
  • Hardening & fixes:
    • Rejects //..., URI schemes, backslashes, and non-doc paths in
      ormalizePath / isSafeDocPath + importBookmarks.
    • Guards store reads against proto/constructor/prototype, corrupted array JSON, NaN, and length/count bounds (store.ts).
    • Fixes cross-page scroll race via post-frame arming & dirty-only debounced auto-tracking (useBookmarks.ts), user-input cancellable retry timers, deferred URL.revokeObjectURL, and cross-locale links on /bookmarks / /en/bookmarks.
    • Uses @docusaurus/Translate + i18n/en/code.json aligned with XRobot Style tokens (

@Jiu-xiao
Jiu-xiao merged commit 4f2b7e6 into dev Nov 27, 2026
2 checks passed
@Jiu-xiao
Jiu-xiao deleted the feat/local-bookmarks-20261127 branch November 27, 2026 07:45
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