Skip to content

Add 心经 as a second planted book, with a real bookshelf#5

Closed
cubxxw wants to merge 1 commit into
mainfrom
claude/vibrant-bell-2klopc
Closed

Add 心经 as a second planted book, with a real bookshelf#5
cubxxw wants to merge 1 commit into
mainfrom
claude/vibrant-bell-2klopc

Conversation

@cubxxw

@cubxxw cubxxw commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 我的树 was hardcoded to a single book (道德经). Generalized it into a Book-driven page at /tree/:bookId, with the data model and per-book content moved to src/books/ (types.ts, daodejing.ts, xinjing.ts, index.ts).
  • Built the 首页书架 (Bookshelf) timeline page at / (src/Bookshelf.tsx / .css), a port of the 老树 · 首页书架.dc.html prototype, so books can actually be walked into instead of 我的树 only existing as an unreachable route.
  • Added 《心经》(the Heart Sutra) as a second, complete, planted book — a Buddhism-themed counterpart to 道德经: five annotated branches (色空 / 五蕴 / 空相 / 无碍 / 揭谛), one 朱砂 (入木) leaf and one 青绿 (青芽) leaf with their own annotations, a thread continuation, and its own 周年回声. It's registered on the shelf timeline (year 649, Xuanzang's translation) alongside 道德经; 论语 / 庄子 remain as 即将种下 placeholders (PLACEHOLDER_BOOKS).
  • Added react-router-dom for the / and /tree/:bookId routes.

Test plan

  • npm run build (type-check + production build) passes
  • Verified in a headless browser: / renders the timeline with 道德经, 心经 (live) and 论语, 庄子 (dormant placeholders); clicking a live plank navigates to /tree/:bookId
  • Verified /tree/xinjing renders 心经's five branches, hover reveals the correct source/annotation/signature per branch, and its own 周年回声
  • Verified /tree/lunyu (a placeholder with no tree yet) shows a "这本书还没有种下" state with a link back to the shelf instead of a blank/broken tree

Generated by Claude Code

我的树 was hardcoded to a single book (道德经). Generalize it into a
Book-driven page at /tree/:bookId (src/books/ holds the data model and
per-book branch/annotation/echo content), and build the 首页书架 timeline
page at / so books can actually be walked into instead of only existing
as a route.

心经 is added end-to-end as a Buddhism-themed book: five annotated
branches (色空/五蕴/空相/无碍/揭谛), a 入木 and a 青芽 leaf, a thread
continuation, its own 周年回声, and a shelf entry on the timeline
alongside 道德经, with 论语/庄子 kept as 即将种下 placeholders.
@cubxxw

cubxxw commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #10.

This PR was the most ambitious of the batch — it introduced src/books/{types,index,daodejing,xinjing}.ts and a real 千年时间轴 Bookshelf.tsx. PR #1 crystallized the same idea into main first, but with a richer Book type (adds chapter: ReadingChapter for the /read page, plus StrataLayer and CompareSpan for sentence-level annotation strata) and a slightly different shelf implementation under src/pages/Bookshelf.tsx. The refactor plumbing here is now duplicative.

What was salvaged into #10: the intent to plant 心經 as a second 佛家 book. The tree/branch data here has been superseded by the Book shape on main; #10's xinjing.ts uses main's schema and draws the 心經 biography/reading content from #6 (which was written specifically for the biography page).

Closing in favor of #10. This PR's timeline design was 90% of the reason I trusted the "取之精华" approach — thanks.

@cubxxw cubxxw closed this Jul 5, 2026
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