Skip to content

feat(frontend): add book/chapter/scene create buttons in project tree#50

Merged
DankerMu merged 2 commits into
mainfrom
feat/49-add-book-chapter-buttons
Feb 21, 2026
Merged

feat(frontend): add book/chapter/scene create buttons in project tree#50
DankerMu merged 2 commits into
mainfrom
feat/49-add-book-chapter-buttons

Conversation

@DankerMu
Copy link
Copy Markdown
Owner

Summary

  • Add inline "+ 新建卷" / "+ 新建章节" / "+ 新建场景" buttons in the sidebar project tree
  • Click button → inline input appears → Enter to confirm, Escape to cancel
  • Tree auto-refreshes via TanStack Query invalidation after successful creation
  • Disabled input during pending mutation to prevent double-submit

Test plan

  • Click "+ 新建卷", type title, press Enter → new book appears in tree
  • Click "+ 新建章节" under a book, type title, press Enter → new chapter appears
  • Click "+ 新建场景" under a chapter, type title, press Enter → new scene appears
  • Press Escape while typing → input dismissed, no creation
  • Click away (blur) with empty input → input dismissed
  • Verify pnpm build passes with no type errors

Closes #49

🤖 Generated with Claude Code

DankerMu and others added 2 commits February 21, 2026 20:41
…#49)

Add inline creation buttons for books, chapters, and scenes in the sidebar
project tree. Click the button → type title → Enter to create, Escape to cancel.
Tree auto-refreshes after creation.

Closes #49

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address review findings:
- Add onError callbacks to all three mutations with user-facing toast
- Auto-submit on blur when input is non-empty (instead of discarding)
- Replace setTimeout focus hack with useEffect on adding state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DankerMu DankerMu merged commit 47cf067 into main Feb 21, 2026
5 of 7 checks passed
@DankerMu DankerMu deleted the feat/49-add-book-chapter-buttons branch February 21, 2026 12:46
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.

feat(frontend): 项目树缺少新增卷/章节按钮

1 participant