Codex PDF viewer renders FreeText annotations twice
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using?
ChatGPT/Codex desktop 26.825.31414 (build 7287).
What subscription do you have?
Not relevant.
What platform is your computer?
macOS 26.5.2, Apple Silicon.
What issue are you seeing?
The built-in Codex PDF preview renders editable /FreeText annotations twice:
- the annotation's normal
/AP /Nappearance stream is rendered correctly in black; and - a faint, vertically displaced copy of the same text is rendered on top of it.
The same PDF renders correctly, with one copy of the text, in macOS Preview and Poppler (pdftoppm). The annotations also remain correctly editable through Preview's Fill Form interface.
The affected annotations are standard /Subtype /FreeText annotations with /Contents, /DA, /Rect, and a non-empty /AP /N appearance. They also contain Apple Preview Fill Form metadata (/AAPL:SFF and /AAPL:AKExtras), but the visible duplicate corresponds to PDF.js's extracted FreeText annotation layer rather than a second PDF annotation.
Local inspection using the PDF.js version bundled with the desktop app reports, for each affected annotation:
{
"subtype": "FreeText",
"hasAppearance": true,
"isEditable": true,
"textContent": ["Example Student"]
}
PDF.js creates an .annotationTextContent element for that extracted textContent. Its standard pdf_viewer.css intentionally hides this accessibility/editor copy:
.annotationLayer .annotationTextContent {
opacity: 0;
color: transparent;
user-select: none;
pointer-events: none;
}
The Codex preview appears to omit or override that rule, leaving the normally invisible annotation-layer text visible in addition to the appearance stream.
What steps can reproduce the bug?
- Create or open a PDF containing a
/FreeTextannotation with non-empty/Contentsand an/AP /Nappearance stream containing the same text. - Verify the PDF in macOS Preview or Poppler; the annotation text appears once.
- Open the same PDF in the Codex desktop built-in PDF viewer.
- Zoom in on the annotation.
- Observe the correct black appearance plus a faint, displaced duplicate of the text.
What is the expected behavior?
Only the FreeText annotation appearance should be visible. The PDF.js .annotationTextContent layer should remain visually hidden while still being available for accessibility and annotation editing.
Additional information
I searched open and closed openai/codex issues for FreeText, annotationTextContent, PDF duplicate text, and annotation appearances and found no exact match. Related PDF preview and annotation issues appear to cover different behavior.
I have not attached the original affected contract because it contains personal information. A sanitized minimal PDF can be provided if needed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Codex desktop PDF preview and inspect how PDF.js annotation-layer styles are loaded or overridden, especially the pdf_viewer.css rule for .annotationTextContent. Reproduce with a minimal PDF containing a FreeText annotation and an /AP /N appearance. Done means the appearance is shown once while the text remains available for accessibility and editing.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100