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
An agent reading an EPUB gate map receives both Gate 12 and the superseded Gate 4 when the map is a standalone SVG chapter. Chromium shows only Gate 12. Embedding the same SVG in an XHTML chapter already produces the correct attachment text.
Change
Apply the worker’s existing inline display:none !important check to SVG-rooted chapters as well as XHTML chapters. The regression case covers a hidden group and a visible label whose last important declaration restores its display.
I ran the production attachment command on macOS 26.2 with Node 26.13.1 at base 358cc548f7 and head 8c50d5dea6, using the same EPUB. EPUBCheck 5.4.0 reported zero errors and warnings. Chromium rendered Gate 12 and the 09:30 departure in both chapters.
Attachment command stdout
Base
Head
Chapter 1, SVG inside XHTML
Gate 12, 09:30
Gate 12, 09:30
Chapter 2, standalone SVG
Gate 12, Gate 4, 09:30
Gate 12, 09:30
Reproduce on Linux or macOS
From either checkout with dependencies installed, these commands retrieve the public fixture generator, print the archive hash, and invoke the actual server command. I repeated this using the published issue and verified that it generated the original archive byte for byte.
Expected SHA-256: 046014ae96b31f35f0359a06094a1a5e03bfdb1b010954896aebcc74f4cf7bb2. The issue contains the original stdout. Head stdout:
## Chapter 1
Board at Gate 12.
Departure 09:30.
## Chapter 2
Board at Gate 12.
Departure 09:30.
The new assertion failed on base because the hidden label was present. All 70 cases in the attachment test file passed on head. vp run check:changed passed, including 77 tests across three files.
Macroscope's review found this PR approvable — EPUB extraction now omits explicitly hidden labels in standalone SVG maps, matching existing HTML visibility filtering. The change is confined to extracted text and introduces no operational or persistent-data changes.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 8c50d5d and 1e4d016.
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 worker now applies visibility checks to standalone SVG documents. The SVG extraction test adds a hidden group and checks that its text is not extracted.
Changes: EPUB visibility checks
Layer / File(s)
Summary
Visibility checks and extraction test apps/server/src/provider/documentTextWorker.ts, apps/server/src/provider/userInputAttachments.test.ts
The worker records the EPUB root element and applies hidden-attribute suppression to EPUB HTML documents, with until-found exempt. Important display: none suppression now applies to EPUB documents with either an html or svg root. The SVG test adds hidden text and checks that it is absent from extraction.
Standalone SVG chapters in EPUB attachments now omit text inside groups hidden with display:none !important, matching XHTML chapters. The regression test covers the hidden label and a visible label whose display is restored. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(server): omit hidden labels from standalone EPUB maps" matches the main change. The diff extends the existing display:none !important suppression in documentTextWorker.ts to SVG-rooted …
Description check
The description follows the template structure with Problem, Change, Scope, and Verification sections. It explains the bug (superseded Gate 4 appears for standalone SVG chapters), the fix (apply the e…
Linked Issues check
[#48023] The issue asks that standalone SVG EPUB chapters omit labels inside a display:none !important group, while keeping visible labels. In documentTextWorker.ts, the existing `hasImportantDispla…
Out of Scope Changes check
The changed files are documentTextWorker.ts and userInputAttachments.test.ts. The worker change is limited to the EPUB suppression condition. It adds an epubRoot variable and extends the existing `d…
Full details: Title check
Explanation
The title "fix(server): omit hidden labels from standalone EPUB maps" matches the main change. The diff extends the existing display:none !important suppression in documentTextWorker.ts to SVG-rooted EPUB chapters, so hidden labels in standalone SVG maps are omitted. The title is specific, follows conventional commit format, and does not list files.
Full details: Description check
Explanation
The description follows the template structure with Problem, Change, Scope, and Verification sections. It explains the bug (superseded Gate 4 appears for standalone SVG chapters), the fix (apply the existing display:none !important check to SVG-rooted chapters), and links issue #48023 in Scope. Verification gives focused test results, a production-command comparison with base and head output, and a reproduction path. The template's Scope section asks for a linked issue, and this is provided. Minor gaps: the Scope section does not explicitly address why the change is a bug fix rather than a feature, and the template's note about the agent model and harness is present but the description also includes extra detail beyond the template. These gaps are non-critical.
Full details: Linked Issues check
Explanation
[#48023] The issue asks that standalone SVG EPUB chapters omit labels inside a display:none !important group, while keeping visible labels. In documentTextWorker.ts, the existing hasImportantDisplayNone(tag.attributes.style) check now applies when epubRoot is svg as well as html. The diff computes epubRoot from stack[1] ?? node for .epub documents, so the SVG root case reaches the same suppression path as XHTML. The test change in userInputAttachments.test.ts adds a display:none !important group containing "Superseded gate" to the standalone SVG fixture and expects it to be absent. It also adds a display:none!important;display:inline!important text, "Standalone chart", and the expected list keeps it. This matches the issue's visible-control case. The PR does not change rendering or XHTML extraction. The author reports that the new assertion failed on base and that all 70 attachment test cases passed on head. I did not run the tests. The result rests on the diff and the reported test outcome. The hidden attribute check remains limited to html roots. The issue does not request a change there.
Full details: Out of Scope Changes check
Explanation
The changed files are documentTextWorker.ts and userInputAttachments.test.ts. The worker change is limited to the EPUB suppression condition. It adds an epubRoot variable and extends the existing display:none !important check from html roots to svg roots. The hidden attribute check and the separate SVG metadata suppression keep their prior behavior for each root type. The test change adds a fixture and expected-absence entry for the same behavior. No unrelated files or refactors appear in the reviewed diff. The PR description's EPUBCheck, Chromium, and reproduction results are supporting evidence and were not re-run.
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; 9 remain after this review.
Manually verified in the real web app: Chrome 158 on Linux, 1440×900 CSS pixels, DPR 2, dark theme, fresh isolated databases and the same synthetic project/thread on each commit.
Submit “Quote the boarding gate and departure from each chapter of gates.epub.” using Replay (dev).
Copy the real upload's extracted-text sidecar unchanged into a Markdown file and open it beside the sent attachment. The right panel below shows extraction output; the replay reply is not used as evidence.
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:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 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
An agent reading an EPUB gate map receives both Gate 12 and the superseded Gate 4 when the map is a standalone SVG chapter. Chromium shows only Gate 12. Embedding the same SVG in an XHTML chapter already produces the correct attachment text.
Change
Apply the worker’s existing inline
display:none !importantcheck to SVG-rooted chapters as well as XHTML chapters. The regression case covers a hidden group and a visible label whose last important declaration restores its display.Closes #48023.
Verification
I ran the production attachment command on macOS 26.2 with Node 26.13.1 at base
358cc548f7and head8c50d5dea6, using the same EPUB. EPUBCheck 5.4.0 reported zero errors and warnings. Chromium rendered Gate 12 and the 09:30 departure in both chapters.Reproduce on Linux or macOS
From either checkout with dependencies installed, these commands retrieve the public fixture generator, print the archive hash, and invoke the actual server command. I repeated this using the published issue and verified that it generated the original archive byte for byte.
Expected SHA-256:
046014ae96b31f35f0359a06094a1a5e03bfdb1b010954896aebcc74f4cf7bb2. The issue contains the original stdout. Head stdout:The new assertion failed on base because the hidden label was present. All 70 cases in the attachment test file passed on head.
vp run check:changedpassed, including 77 tests across three files.GPT-6.2 Astra via the Codex harness in T3 Code.