feat(usfm): preserve section headings through import and export - #320
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@kaseywright This PR targets The plan is to merge #305 into |
kaseywright
left a comment
There was a problem hiding this comment.
Two correctness issues found in the section-heading serialization/import path.
kaseywright
left a comment
There was a problem hiding this comment.
Both findings from the prior review are fixed in 7aacca1: sd-marker text is now rejected at write time via schema refinement, and usjToVerseTexts now returns an explicit error instead of silently dropping a trailing heading with no following verse. The marker-set duplication is also resolved (single source in schema.ts).
USFM import could append a section heading to the previous verse, and chapter content could drop stored headings. Supported titles now stay in the existing
markers.headingsfield and preserve their order through import, editing, chapter content, and export. Export also adds a body paragraph after a heading when needed, keeping scripture text outside the heading.This is stacked on #305 because the import path is not on
mainyet. Please retarget this PR tomainbefore merging #305, since merged branches are deleted automatically. No new migration or route is required. Refs #288; the web fix is eten-tech-foundation/fluent-web#432.The semantic-division marker list now has one canonical source. New writes reject text on the textless
sd/sd1–sd4markers, while legacy stored rows still export as valid bare divisions. An imported heading with no following verse now fails explicitly instead of being discarded.Validation: all 669 tests in 70 files passed on Node 24.14.0, plus lint, formatting, typecheck, build,
drizzle-kit check, and the diff whitespace check. An isolated PostgreSQL 16 smoke passed for immediate and delayed imports, saved edits, chapter content, export, empty titled verses, retries without overwrites, and compatibility with legacy semantic-division records. Lint has three existing file-length warnings. The full pre-merge workflow does not run for a PR targeting the import branch.Continues #319 after renaming the branch from
codex/288-section-heading-storagetofeat/288-section-heading-storage. The commits are unchanged.Screenshot
This report was generated from a fresh execution of the existing integration smoke on head
ae36d4b, using a local fixture and an isolated PostgreSQL 16.13 container with all 29 migrations. No shared database or external storage was used.