What happened?
When editing a chapter's metadata (summary, notes, etc.) via the metadata dialog, the chapter's prose content is wiped out — both in the editor view and persisted to the backend.
Steps to reproduce:
- Open a project with a chapter that has content
- Click the chapter to select it
- Click the "Edit Metadata" button for that chapter
- Edit the summary (or any metadata field)
- Close the metadata dialog
- The chapter content is now empty
Disclosure: The following was diagnosed with the help of AI, so take this with a grain of salt, but testing it did seem to fix the issue.
Potential Root cause:
ChapterList.tsx is passing the entire Chapter object as initialData, which always has content: '' due to chaptersStructuralEqual() intentionally excluding content to avoid sidebar re-renders on every keystroke. This empty content then gets spread into the chapter state during saveMetadata.
Potential Fix:
Build an explicit MetadataParams-shaped literal from the Chapter data (containing only title, summary, notes, private_notes, conflicts) instead of passing the whole object. That way an empty content can't leak into the metadata flow.
Hopefully this makes sense!
Really enjoying this app by the way. Great work!
Relevant log output
OS and version
No response
What happened?
When editing a chapter's metadata (summary, notes, etc.) via the metadata dialog, the chapter's prose content is wiped out — both in the editor view and persisted to the backend.
Steps to reproduce:
Disclosure: The following was diagnosed with the help of AI, so take this with a grain of salt, but testing it did seem to fix the issue.
Potential Root cause:
ChapterList.tsxis passing the entire Chapter object as initialData, which always hascontent: ''due tochaptersStructuralEqual()intentionally excluding content to avoid sidebar re-renders on every keystroke. This empty content then gets spread into the chapter state duringsaveMetadata.Potential Fix:
Build an explicit MetadataParams-shaped literal from the Chapter data (containing only title, summary, notes, private_notes, conflicts) instead of passing the whole object. That way an empty
contentcan't leak into the metadata flow.Hopefully this makes sense!
Really enjoying this app by the way. Great work!
Relevant log output
OS and version
No response