Repository navigation
fix: preview PDFs and slides inline with agent change requests - #438
Merged
Merged
Conversation
devSejung
marked this pull request as ready for review
November 2, 2026 08:40
Contributor
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Contributor
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
This was referenced Nov 2, 2026
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.
Closes #436
What Problem This Solves
Fixes an issue where employees opening PDF or PowerPoint attachments in Chrome saw a blocked-content page instead of their preview. Browser-native PDF frames also produced inconsistent controls and left no way to point at a document section when asking the agent for changes.
Why This Change Was Made
Use one app-owned PDF.js canvas viewer for PDFs and the existing LibreOffice-converted slide snapshots. Bundle the version-matched worker, character maps, fonts, WASM, ICC resources, and license with the UI. Keep the existing authenticated snapshot, ownership checks, VM/file bridge, and original download path.
The dependency owner needs a small, explicitly approved PDF.js 6.4.299 patch: operator-stream errors must reject rendering and public operator-list readers instead of reporting successful blank/partial output. An exact-version, patch-byte, lock-hash, and archive-integrity guard registers it separately from security advisory patches. Remove it when an upstream release passes the same failure/replay/cancellation regressions. Other upstream decoder and annotation recovery behavior is unchanged.
User Impact
Evidence
Rebased onto
mainat318b75da5d4eb7defc95b6cf746449661251e3cc. Range-diff confirms the reviewed patch is unchanged; upstream composer diagnostics are preserved. Runtime proof was collected at the earlier0c8281c637d370cd24b3e2cc5a1e1cabf9b13603base, whose viewer/runtime source is unchanged by that rebase. Validation used task-owned Ubuntu 22.04 Docker containers, Node 24.18.0, pnpm 11.15.1, Chromium, rootless Docker Basic execution, and a real SSH assigned-VM fixture. Identity/history/chat-send endpoints use the standard controlled gateway fixture; asset CSP, media snapshots, conversion, PDF worker, browser selection, crop pixels, and download paths are real.frame-srcviolation.tsgo.node scripts/run-tsgo.mjs -b tsconfig.projects.json,node scripts/run-lint.mjs,pnpm check:import-cycles,pnpm build, formatting, andgit diff --check: passed. After adding Korean copy, the affected UI typecheck, lint, UI build, keyless i18n baseline/verify, and 23 existing translation tests passed. The existing product-locale integration test confirms Korean viewer labels and interpolated page positions, English locale switching, and preservation of the generated base catalog. The raw-copy baseline is unchanged.$autoreview, uncommitted candidate against the pinned base: scoped-clean through P2, no accepted/actionable findings.OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/platformclaw-check.mjs --changedpassed the PlatformClaw lane and upstream guards, then found a Canvas test mock type error. After fixing the narrow adapter, the failed full typecheck and remaining full lint/import-cycle stages passed individually; unchanged preceding guard results are reused. No skip flags or baseline relaxation were used. The original implementation matched across host/Linux; all 19 final CI-repair file hashes also match.The CI repair addresses three owning boundaries: renderers use a leaf document-change type contract rather than importing the stateful factory; Korean copy lives under the existing PlatformClaw native locale owner; every Vite test entrypoint, including the deferred source E2E server, registers the production PDF asset plugin. No optimizer retry, assertion relaxation, timeout increase, or guard/baseline change was introduced.
Repair validation in Ubuntu Docker: canonical generated-ownership checks 3 passed, request/pane/binding/locale checks 56 passed, actual Chromium project 203 passed, and the four previously failing source-server E2E files 15 passed. The exact failed core-test typecheck, UI typecheck, Madge (zero cycles), scoped lint, UI build, sidecar/performance checks, and fresh autoreview through P2 passed. The browser fixtures were run with the same English locale expected by CI; an initial run inheriting the task container's Korean locale was retained as a known fixture-language mismatch. Hosted CI is green for
e429293413f36320fb63243767b8aa68eb3ba8dd: exact-head CI run. All six previously failing checks and the remaining PR checks passed; the exact-head watcher returned GREEN with zero pending checks.The separately approved worker limit is 360 KiB gzip. Ordinary JavaScript remains capped at 215 KiB and startup at 326 KiB; their baseline is unchanged. Final UI measurements: startup 333,058 bytes gzip (325.3 KiB), largest ordinary chunk 178.2 KiB, worker 351.6 KiB; all limits pass and 828 precompressed sidecars verify. Workers remain included in total JavaScript and cannot enter startup HTML. Standard gzip compression is round-trip verified.
Sanitized desktop/mobile/contents/request screenshots and videos are retained outside Git. The existing CI UI evidence upload publishes the
platformclaw-canvas/document-previewscaptures in its exact-headhtml-attachment-browser-proof-*artifact. No screenshots or runtime state are committed.Net growth is 2,793 production lines, 3,513 tests lines, 31 documentation lines, 172 dependency/patch metadata lines. Production growth belongs to the shared renderer/worker lifecycle, bounded selection geometry, request lifecycle, current-owner outbox admission, and requested Korean copy; tests are counted separately. Selected text and crops are explicit user context rather than a global prompt addition. Protocol, config, and database schemas do not change.