Diffs: extend image quality configs and add PDF as a format option#31342
Diffs: extend image quality configs and add PDF as a format option#31342gumadeiras merged 10 commits intomainfrom
Conversation
Greptile SummaryThis PR successfully rebases the diffs plugin onto the latest main hardening branch while preserving all upstream security protections and adding new file rendering capabilities. Key Changes:
Implementation Quality:
Backward Compatibility: Confidence Score: 5/5
Last reviewed commit: c514a8e |
There was a problem hiding this comment.
Pull request overview
This PR rebases the diffs plugin's file mode enhancements onto the latest main branch that added security hardening. It introduces PDF rendering as an output format, adds quality presets (standard, hq, print), adds a mode=file canonical mode (deprecating mode=image), and preserves backward compatibility with image* parameter aliases and the deprecated format/imageFormat aliases.
Changes:
- New
mode=filecanonical output mode (alias for deprecatedmode=image), plus PNG and PDF rendering viafileFormat,fileQuality,fileScale,fileMaxWidthoptions with backward-compatibleimage*aliases - Browser rendering updated with pixel-cap retry logic, PDF generation via
page.pdf(), and dynamic viewport sizing based onmaxWidth - Documentation and test coverage updated for all new modes and options
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
extensions/diffs/src/types.ts |
Adds DiffFileDefaults, DiffImageQualityPreset, DiffOutputFormat types; extends DiffToolDefaults; adds image options to DiffRenderOptions; adds filePath to DiffArtifactMeta |
extensions/diffs/src/config.ts |
Adds quality preset profiles, new file* defaults, resolveDiffImageRenderOptions export, and backward-compatible image* alias resolution |
extensions/diffs/src/tool.ts |
Wires resolveDiffImageRenderOptions into execution, adds mode=file, backward-compat aliases, refactors screenshot path into renderDiffArtifactFile helper |
extensions/diffs/src/store.ts |
Adds updateFilePath/allocateFilePath/allocateStandaloneFilePath with format support; aliases old image* methods for backward compat |
extensions/diffs/src/browser.ts |
Adds pixel-cap retry loop, dynamic viewport, PDF output via page.pdf(), configurable scale/maxWidth |
extensions/diffs/src/render.ts |
Passes imageMaxWidth to buildHtmlDocument replacing hardcoded 960px |
extensions/diffs/src/config.test.ts |
Tests for new file defaults, quality presets, format aliases, and resolveDiffImageRenderOptions |
extensions/diffs/src/tool.test.ts |
Tests for mode=file, PDF output, image* backward compat aliases, and defaults |
extensions/diffs/src/browser.test.ts |
Tests PDF path, mock page updated with pdf/screenshot spies |
extensions/diffs/src/store.test.ts |
Tests for updateFilePath, allocateFilePath/Standalone, PDF path allocation, image alias compat |
extensions/diffs/src/render.test.ts |
Tests that imageHtml uses configured maxWidth |
extensions/diffs/src/prompt-guidance.ts |
Updates agent guidance from mode=image/imagePath to mode=file/filePath |
extensions/diffs/openclaw.plugin.json |
Adds file* and image* alias schema entries; updates mode enum to include "file" |
extensions/diffs/index.ts |
Updates description to mention PNG/PDF |
extensions/diffs/README.md |
Updates docs for new file* options, removes old image* primary references |
docs/tools/diffs.md |
Simplifies doc page for new file-mode terminology |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29dbe0fe85
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b08559211f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2202d0b7c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 061cf3981e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d7b2d6c to
86e29e5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86e29e5037
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f57dae7 to
cc12097
Compare
|
Merged via squash. Thanks @gumadeiras! |
* main: (212 commits) fix(ci): annotate feishu hoisted mock type fix(ci): align strict nullable typing across channels and ui refactor(tests): dedupe macos ipc smoke setup blocks refactor(tests): dedupe ios gateway and deeplink fixtures refactor(tests): dedupe openclawkit chat test helpers test(runtime): trim timer-heavy regression suites test(config): reuse fixtures for faster validation test(cli): reduce update/program suite overhead refactor(tests): dedupe ios defaults and setup-code helpers refactor(tests): dedupe swift gateway and chat fixtures Diffs: extend image quality configs and add PDF as a format option (openclaw#31342) refactor(scripts): dedupe installer CLI verification refactor(extensions): dedupe channel config, onboarding, and monitors refactor(core): extract shared usage, auth, and display helpers refactor(ui): dedupe state, views, and usage helpers refactor(scripts): dedupe guard checks and smoke helpers fix(browser): honor profile attachOnly for loopback CDP (openclaw#31429) [AI-assisted] test: fix typing and test fixture issues (openclaw#31444) chore(tsgo/lint): fix CI errors fix(browser): support configurable CDP auto-port range start (openclaw#31352) ...
…penclaw#31342) Merged via squash. Prepared head SHA: cc12097 Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
…penclaw#31342) Merged via squash. Prepared head SHA: cc12097 Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
…penclaw#31342) Merged via squash. Prepared head SHA: cc12097 Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
…penclaw#31342) Merged via squash. Prepared head SHA: cc12097 Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
…penclaw#31342) Merged via squash. Prepared head SHA: cc12097 Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
Summary
file*defaults)image*inputs/details/config while keeping docs focused on canonicalfile*optionsTesting
pnpm test extensions/diffs/index.test.ts extensions/diffs/src/config.test.ts extensions/diffs/src/render.test.ts extensions/diffs/src/tool.test.ts extensions/diffs/src/browser.test.ts extensions/diffs/src/http.test.ts extensions/diffs/src/viewer-payload.test.ts extensions/diffs/src/store.test.ts