Repository navigation
feat(v2): inline PPTX preview via server-side OfficeCLI render - #306
Merged
Merged
Conversation
Adds OfficeCLI v1.0.70 binary to the backend image (SHA256-pinned), exposes GET /api/uploads/:fileName/preview-pptx-html that runs `officecli view html` on the uploaded .pptx and returns rendered HTML, and a PptxPreview component in V2PodInspector that srcdoc's it into a sandboxed iframe. Completes the DOCX/XLSX/PPTX inline preview trio in the inspector. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
samxu01
pushed a commit
that referenced
this pull request
May 6, 2026
PR #306 added the PptxPreview component but forgot to add the `if (kind === 'pptx') return <PptxPreview .../>` line to the switch in ArtifactPreview, so .pptx artifacts fell through to `return null` and showed nothing. The /api/uploads/:fileName/preview-pptx-html backend route + the PptxPreview component itself work fine when invoked directly — the wire was just missing. DOCX (mammoth) and XLSX (SheetJS) wires are intact; bundle inspection confirms `t==="docx"?.../t==="xlsx"?...` chain in the minified ArtifactPreview, plus mammoth.browser-*.js and xlsx-*.js chunks load 200 from /assets/. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
lilyshen0722
added a commit
that referenced
this pull request
Aug 5, 2026
#849) The comment on the pinned OfficeCLI block claimed "Same upstream + version as the gateway image." Same upstream holds. Same version does not, and could not: the gateway does not pin. openclaw's Dockerfile pulls `releases/latest/download/${asset}` with no version and no checksum, so "same version" was true at most on the day it was written. Measured against both running containers rather than inferred: backend (pinned) 1.0.70 gateway (openclaw, latest) 1.0.143 ← upstream latest, published 07-28 Seventy-three releases apart, in one system, for the same file formats — this image renders .pptx for the preview route, the gateway extracts .docx/.pptx for commonly_read_attachment. Found by chasing @sprint-review's observation that the two officecli install blocks in one deploy log differ: one pins and verifies a SHA256, the other does not. They flagged which-image-is-which as unresolved. It resolves as ours/theirs: `#8 [3/10]` is this file (single FROM), `#37 [stage-4 17/19]` is openclaw's (5 FROMs, guarded by the DOC_TOOLCHAIN ARG). We hardened ours in #306 and the hardening was never carried upstream. Not bumping to 1.0.143. The pin is doing its job, and matching a floating target once just restarts the drift. The real fix is pinning + checksum in openclaw's Dockerfile, which needs a PR there plus a submodule bump and so inherits the lineage problem. Until then the divergence is recorded as a measured fact instead of a claim of sameness, and `officecli --version` in each container is the check. Comment-only; no build behaviour changes. Co-authored-by: Claude Opus 5 <[email protected]>
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.
Summary
GET /api/uploads/:fileName/preview-pptx-html— fetches the .pptx from object storage / legacy Mongo bytes, runsofficecli view <file> html, returns the rendered HTML (text/html, 30s render timeout, 5min private cache).PptxPreviewcomponent in V2PodInspector — fetches the rendered HTML and injects it into a sandboxed iframe (srcDoc, sandbox="allow-scripts allow-same-origin").Test plan
GET /api/uploads/<name>/preview-pptx-htmlreturns 200 text/html.🤖 Generated with Claude Code