Repository navigation
Worker 07, round 76 — local handoff - #1801
Open
2836048681 wants to merge 1 commit into
Open
2836048681 wants to merge 1 commit into
2836048681 wants to merge 1 commit into
Conversation
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hopding/pdf-lib(8,690 stars when screened)./home/hatch/workspace/pr-factory/work/w07-r76/repo(shallow clone ofmaster).93dd36e85aa659a3bca09867d2d8fac172501fbe.fix/1590-preserve-empty-lines.fbe18e6e8dc46b4db0a4093e0c0acaf4d973701c.Codex <codex@localhost>; the supervisor may replace it before submission.shortlist.md; raw unauthenticated GitHub API curl responses inscreening/.What?
Fixes #1590.
Preserve leading, consecutive, and trailing empty lines when
drawText()is givenmaxWidth. Empty input also produces the same single empty line as the existing unwrapped path.For
first\n\nsecond\n, the wrapped path now produces['first', '', 'second', '']instead of['first', 'second'].Why?
Setting
maxWidthcurrently removes vertical spacing explicitly included in the input, even when the text is short enough that no width-based wrapping occurs. The same text drawn withoutmaxWidthretains those empty lines.How?
Always append the current line at an explicit line break and at the end of the input. Ignore zero-length regex matches, and only flush for width overflow when the current line contains text. These two guards preserve the handling of words wider than
maxWidthwithout creating extra blank lines around them.The production change is three lines in
src/utils/strings.ts. Tests cover empty input, leading/consecutive/trailing newlines, word wrapping, overlong words, and the actualTj/T*operators emitted byPDFPage.drawText()with and withoutmaxWidth.Testing?
On Node.js 24.22.1 with the checked-in dependency versions:
yarn test— 65 suites, 627 tests passed.yarn typecheck— passed.node node_modules/tslint/bin/tslint --project tsconfig.json— passed.node node_modules/tslint/bin/tslint --project tests/tsconfig.json— passed.node node_modules/prettier/bin-prettier.js --check src/utils/strings.ts tests/utils/strings.spec.ts tests/api/PDFPage.spec.ts— passed.git diff --check— passed.Before the production fix, the updated two-file Jest regression run failed 9 tests, with 11 passing. The complete suite passes with the fix.
Additional local checks (scripts/logs in
evidence/):maxWidth. Each reload verifies the persisted text and line-advance operators.ttypescript1.5.15. Repository dependency files were not changed.Build qualification: the checked-in
ttypescript1.5.10 fails on both tested Node versions withCannot set property constructor ... which has only a getter. Importing that unchanged build dependency alone reproduces the failure before any project source is read. The isolated build tool above is a validation workaround, not a dependency change in this PR.Browser qualification: launching the provided Chromium binary failed before page creation because the environment requires a Hatch WebGL domain policy. No browser pass is claimed. The interactive
apps/integration suite and the upstream manual multi-viewer matrix were not run.New Dependencies?
No. Tooling used for local validation is outside the repository.
package.jsonandyarn.lockare unchanged.Screenshots
A rendered comparison is saved at
evidence/comparison.png, with the original wrapped behavior, the existing unwrapped behavior, and the fixed wrapped behavior side by side. The fixed spacing matches the unwrapped control. The companioncomparison.pdfwas rendered with Poppler and the image was inspected. The submitter can attach the PNG to the PR.Suggested Reading?
No. The recommended PDF-specification sections were not read for this string-wrapping change. Existing content-stream generation is unchanged and is checked through operator assertions and PDF save/reload tests.
Anything Else?
No GitHub push, PR, issue comment, or claim was made. Public API screening found no competing fix for #1590, and the issue is unassigned. The repository has a maintenance backlog; no review/merge timing is assumed.
Checklist
Handoff path limitation
The sandbox rejected the requested parent/global output locations as outside the writable round directory. The complete draft, ledger entry, branch metadata, and patch are saved here and in
ready/pdf-lib-1590/.evidence/handoff-paths.jsonrecords the exact failures. A supervisor with write access must copy/append these local handoff files to the requested destinations.