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): separate EPUB figures from surrounding text - #43853
The extracted text from an EPUB can run a captionless figure into nearby prose. A map's alternative text appears in the same line as the sentence before and after it.
Change
Use the existing line separator for a <figure> that contributes text. This also handles figures whose only text is an image description.
Verification
The production extractor read the same EPUB with an SVG map before and after the fix.
Before
Choose your route.Map of the north pier Continue to the gate.
After
Choose your route.
Map of the north pier
Continue to the gate.
The new assertion in the existing EPUB case fails on base and checks both the figure boundary and an empty figure. The captioned figure, empty figure and inline span replays also passed as controls. This is distinct from #43190 (caption boundaries) and #42925 (image descriptions).
Vitest V8 exercised both outcomes of the changed condition, and Dependency Cruiser found the same 31 direct imports before and after. The supporting checks included fast-check, 300 Jazzer.js fuzz-target runs, Stryker (8/8 killed), Fallow on a scoped snapshot, and a passing CodeScene quality gate with an existing test-declaration advisory.
The normal commit hooks passed. After rebasing onto main, the EPUB replay still passed and vp run check:changed upstream/main --concurrency 1 passed with 65 tests, affected-package typecheck, format, lint, Knip and GraphQL.
Sol-loop approved in one round with GPT-6.2 Sol high. Gemini 4 Neon medium (Antigravity), Opus 5.5 high and Grok 4.7 Fast high also approved the diff.
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 19a3715 and 06e58dd.
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 text extractor now processes figure elements through the existing paragraph extraction path. The EPUB test fixture covers a figure with image alt text and an empty figure.
Changes: EPUB figure text extraction
Layer / File(s)
Summary
Figure extraction and test coverage apps/server/src/provider/documentTextWorker.ts, apps/server/src/provider/userInputAttachments.test.ts
The extractor applies line-start markers and recursive text extraction to figure elements. The EPUB test checks reading order for image alt text and confirms an empty figure adds no text.
This change keeps text from EPUB figures on separate lines from the surrounding prose. It is a small, localized extraction change with test coverage, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(server): separate EPUB figures from surrounding text" matches the main change. The raw summary and objectives say figure elements now use the line separator in EPUB text extraction, so …
Description check
The description has the Problem, Change, and Verification sections the template asks for. The Problem section states the bug and the observed output. The Change section explains the fix. The Verificat…
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 "fix(server): separate EPUB figures from surrounding text" matches the main change. The raw summary and objectives say figure elements now use the line separator in EPUB text extraction, so figure text no longer runs into adjacent prose. The title is concise, follows the conventional commit format, and names the affected area.
Full details: Description check
Explanation
The description has the Problem, Change, and Verification sections the template asks for. The Problem section states the bug and the observed output. The Change section explains the fix. The Verification section gives a before/after replay and lists focused tests and checks with observed results. The Scope section is missing. It should link the issue that shows the bug, or explain why an issue is not needed. The author links related PRs #43190 and #42925 but does not link an issue or state that this is a small obvious fix. The description also includes tooling detail beyond what the template asks for, and it does not clearly state which agent or model did the work in the expected form, though it does name a model and harness.
Resolution
Add a Scope section. Link the issue that shows the bug, or explain why a small obvious fix needs no issue. Consider trimming the long list of tool runs to the checks that cover the changed behavior.
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; 7 remain after this review.
Attached the same synthetic EPUB through the composer on both commits, then opened a byte-for-byte copy of the server's extracted text in the app file viewer. Chromium web client, 1280×800, light theme, fresh isolated state and Replay (dev).
The GPT-6-Luna cat-and-quote step was replaced with Replay and direct display of the actual server-generated extracted file; model quotation behavior was not exercised.
…3853)
Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 9534f2a)
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
The extracted text from an EPUB can run a captionless figure into nearby prose. A map's alternative text appears in the same line as the sentence before and after it.
Change
Use the existing line separator for a
<figure>that contributes text. This also handles figures whose only text is an image description.Verification
The production extractor read the same EPUB with an SVG map before and after the fix.
The new assertion in the existing EPUB case fails on base and checks both the figure boundary and an empty figure. The captioned figure, empty figure and inline span replays also passed as controls. This is distinct from #43190 (caption boundaries) and #42925 (image descriptions).
Vitest V8 exercised both outcomes of the changed condition, and Dependency Cruiser found the same 31 direct imports before and after. The supporting checks included fast-check, 300 Jazzer.js fuzz-target runs, Stryker (8/8 killed), Fallow on a scoped snapshot, and a passing CodeScene quality gate with an existing test-declaration advisory.
The normal commit hooks passed. After rebasing onto
main, the EPUB replay still passed andvp run check:changed upstream/main --concurrency 1passed with 65 tests, affected-package typecheck, format, lint, Knip and GraphQL.Sol-loop approved in one round with GPT-6.2 Sol high. Gemini 4 Neon medium (Antigravity), Opus 5.5 high and Grok 4.7 Fast high also approved the diff.
Created with GPT-6.2 Sol in Codex through T3 Code.