Skip to content

fix(mobile): navigate grouped toc items#432

Open
codedogQBY wants to merge 1 commit into
mainfrom
codex/fix-mobile-toc-parent-navigation
Open

fix(mobile): navigate grouped toc items#432
codedogQBY wants to merge 1 commit into
mainfrom
codex/fix-mobile-toc-parent-navigation

Conversation

@codedogQBY

Copy link
Copy Markdown
Owner

Analysis

  • Some EPUBs expose grouping entries in the TOC, such as volume/part nodes, without their own href.
  • The mobile TOC row handler only selected item.href, so tapping those visible entries silently did nothing even when their descendants were readable chapters.

Changes

  • Add getFirstTocHref in core reader utilities to resolve the first usable href in a TOC branch.
  • Use that helper in the Expo reader TOC row so grouped entries navigate to their first readable child.
  • Keep the chevron as the explicit expand/collapse control; entries with no reachable href still toggle expansion.
  • Add focused unit coverage for direct href, descendant href, blank href, and no href cases.

Verification

  • pnpm exec biome check packages/core/src/reader/toc.ts packages/core/src/reader/toc.test.ts packages/core/src/reader/index.ts packages/app-expo/src/screens/reader/TOCTreeItem.tsx
  • pnpm --filter @readany/core test -- toc
  • pnpm --filter @readany/core exec tsc --noEmit
  • pnpm --filter @readany/app-expo exec tsc --noEmit
  • git diff --check

Fixes #404

@codedogQBY codedogQBY added bug Something isn't working priority:p1 High: important feature broken or major platform/workflow regression area:reader Reader, pagination, scrolling, layout, TOC area:mobile Mobile, tablet, React Native, Android, iOS labels Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:mobile Mobile, tablet, React Native, Android, iOS area:reader Reader, pagination, scrolling, layout, TOC bug Something isn't working priority:p1 High: important feature broken or major platform/workflow regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 书籍不能选章节跳读

1 participant