You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): keep EPUB headers and footers on separate lines - #43618
EPUB attachment text can run a chapter's introduction or attribution into the body. This happens when a <header> or <footer> holds text directly or uses inline markup.
Change
Pass nonempty headers and footers through the existing block separator used for asides and captions. The separator starts a line only when needed.
Verification
I ran the same EPUB through the production extractor before and after the change:
Before
Updated timetable.Harbor departuresConfirm your berth.Source: Harbor OfficeKeep this guide.
After
Updated timetable.
Harbor departures
Confirm your berth.
Source: Harbor Office
Keep this guide.
The regression fails on base and extends the existing EPUB attachment case. Standalone header and footer replays also fail on base and pass with the fix. Inline text, empty blocks, and blocks whose text already sits in paragraphs pass both times. The targeted issue and PR search found no overlapping fix.
Vitest V8 coverage for the focused attachment test covered the changed line. The worker report measured 94.02% lines and 87.23% branches.
Dependency Cruiser found the same 31 direct imports across the two files. The comparison retains the same unresolved workspace aliases on both sides.
fast-check passed 200 generated cases and Jazzer.js ran 300 iterations of a narrow fixture generator. Stryker killed all 7 mutants on the changed line in a source-derived copy.
Fallow found no new issues in its two-file snapshot with limited dependency resolution. CodeScene’s quality gate passed and the test file’s declarations metric remained above its threshold, rising from 1,967 to 1,975.
vp run check:changed --concurrency 1 passed with 63 tests, affected-package typecheck, format, lint, Knip and GraphQL. The check also passed after rebasing onto 92786ad. Normal commit hooks passed.
Gemini 4 Neon (Antigravity, medium), Opus 5.5 (high), and Grok 4.7 Fast (high) approved the diff.
Reviewed with sol-loop: 1 round with GPT-6.2 Sol on high. Sol verdict: approved.
Created with GPT-6.2 Sol in Codex through T3 Code.
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Reviewing files that changed from the base of the PR and between b206e54 and 32f4c7c.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The EPUB paragraph extraction rule now applies line-start wrapping to text-bearing aside, address, header, and footer elements. The EPUB test covers nonempty and empty header and footer elements.
Changes: EPUB Text Extraction
Layer / File(s)
Summary
Paragraph wrapping and test coverage apps/server/src/provider/documentTextWorker.ts, apps/server/src/provider/userInputAttachments.test.ts
paragraphs now applies line-start wrapping to text-bearing aside, address, header, and footer elements. The EPUB test checks that nonempty header and footer text appears in document order and that empty elements add no text.
EPUB header and footer text now starts on its own line instead of running into the surrounding text. The change is small, the test covers the new behavior, and I found no merge-blocking risk.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: EPUB headers and footers are kept on separate lines. The title follows the conventional commit format and matches the raw summary and the objectives. It is specific an…
Description check
The description follows the template. It has Problem, Change, and Verification sections. Problem and Change are clear and specific. Verification gives before and after output and lists the focused reg…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: EPUB headers and footers are kept on separate lines. The title follows the conventional commit format and matches the raw summary and the objectives. It is specific and concise.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, and Verification sections. Problem and Change are clear and specific. Verification gives before and after output and lists the focused regression results. The Scope section is missing. It should link the issue that shows the bug, or explain why no issue is needed for this small fix. The description also does not state the required agent model line in the exact form requested, although it names the models used. The description is mostly complete, so the check passes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Ran the same EPUB upload and prompt on fresh databases in the real web app, using Replay (dev), a 1280×800 viewport and light theme. Opened an unchanged copy of the server-generated claimed attachment extraction in the app file viewer. Replay does not read the attachment itself. The scenario comparison exited 0: failed on base and passed on head.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
EPUB attachment text can run a chapter's introduction or attribution into the body. This happens when a
<header>or<footer>holds text directly or uses inline markup.Change
Pass nonempty headers and footers through the existing block separator used for asides and captions. The separator starts a line only when needed.
Verification
I ran the same EPUB through the production extractor before and after the change:
The regression fails on base and extends the existing EPUB attachment case. Standalone header and footer replays also fail on base and pass with the fix. Inline text, empty blocks, and blocks whose text already sits in paragraphs pass both times. The targeted issue and PR search found no overlapping fix.
vp run check:changed --concurrency 1passed with 63 tests, affected-package typecheck, format, lint, Knip and GraphQL. The check also passed after rebasing onto 92786ad. Normal commit hooks passed.Gemini 4 Neon (Antigravity, medium), Opus 5.5 (high), and Grok 4.7 Fast (high) approved the diff.
Reviewed with sol-loop: 1 round with GPT-6.2 Sol on high. Sol verdict: approved.
Created with GPT-6.2 Sol in Codex through T3 Code.