Repository navigation
Conversation
- render selectable DOCX and PPTX content in editor tabs - add XLSX workbook and worksheet previews - support Office binaries across local, SSH, relay, and runtime paths - add parser and filesystem regression coverage
- Keep DOCX on Mammoth HTML preview - Render PPTX through pptx-preview - Parse XLSX workbooks with ExcelJS - Ignore graphify-out artifacts
- Add loading state around pptx-preview - Fall back to extracted slide text on timeout or render failure - Keep PPTX renderer isolated from the Office viewer router
- Stop auto-falling back to text on slow decks - Detect rendered slides with a DOM observer - Keep extracted text as an explicit fallback
- Flatten slides through PowerPoint COM on supported Windows hosts. - Preserve browser and extracted-text fallbacks across other runtimes. - Cover native export, cleanup, IPC routing, and real COM rendering.
📝 WalkthroughWalkthroughAdds Office document preview support for DOCX, PPTX, and XLSX files across binary MIME handling, runtime file access, editor routing, and parsing. DOCX files render sanitized HTML, XLSX files render bounded spreadsheet tables, and PPTX files use browser previews with extracted-text fallback. Windows PowerPoint COM rendering is exposed through typed preload and IPC handlers with renderer-scoped cancellation. Tests cover parsing, routing, binary handling, native rendering, cancellation, and Windows integration. Localized viewer strings are added for supported locales. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
src/renderer/src/components/editor/OfficePresentationView.tsx (1)
101-123: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUndocumented coupling to
pptx-preview's internal DOM class names.
clearWrapperBackground/markRenderedIfSlideExistsrely on.pptx-preview-wrapperand.pptx-preview-slide-wrapper, which aren't part of any documented public API of thepptx-previewpackage. This is likely the only way to detect render completion today, but a brief "why" comment would help future maintainers understand this is intentional and needs re-checking on library upgrades.src/renderer/src/components/editor/OfficeDocumentViewer.tsx (1)
58-70: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueImprove accessibility of sheet tabs.
Consider adding ARIA roles (
role="tablist",role="tab") andaria-selectedto the spreadsheet tabs so screen readers can properly announce the active sheet.♿ Proposed ARIA improvements
- <div className="flex gap-1 overflow-x-auto border-t border-border bg-muted p-1"> + <div className="flex gap-1 overflow-x-auto border-t border-border bg-muted p-1" role="tablist"> {sheets.map((candidate, index) => ( <button type="button" key={candidate.name} + role="tab" + aria-selected={index === activeSheet} className={`rounded-sm px-3 py-1 text-xs ${index === activeSheet ? 'bg-background text-foreground' : 'text-muted-foreground hover:bg-accent'}`} onClick={() => setActiveSheet(index)} >
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 08f94a0e-73e5-44ef-975a-11fc1a9616a4
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (32)
.gitignorepackage.jsonsrc/main/git/status.tssrc/main/ipc/filesystem.test.tssrc/main/ipc/filesystem.tssrc/main/ipc/powerpoint-preview.tssrc/main/ipc/register-core-handlers.test.tssrc/main/ipc/register-core-handlers.tssrc/main/office/native-powerpoint-preview-script.tssrc/main/office/native-powerpoint-preview.integration.test.tssrc/main/office/native-powerpoint-preview.test.tssrc/main/office/native-powerpoint-preview.tssrc/main/runtime/orca-runtime-files.tssrc/preload/api-types.tssrc/preload/index.tssrc/relay/fs-handler-utils.tssrc/relay/git-handler-utils.tssrc/renderer/src/components/editor/EditorContent.tsxsrc/renderer/src/components/editor/OfficeDocumentViewer.tsxsrc/renderer/src/components/editor/OfficePresentationView.tsxsrc/renderer/src/components/editor/office-document-file.test.tssrc/renderer/src/components/editor/office-document-file.tssrc/renderer/src/components/editor/office-document-parse.test.tssrc/renderer/src/components/editor/office-document-parse.tssrc/renderer/src/components/editor/office-presentation-preview.test.tssrc/renderer/src/components/editor/office-presentation-preview.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/powerpoint-preview.ts
👮 Files not reviewed due to content moderation or server errors (1)
- src/renderer/src/i18n/locales/ja.json
- keep Office diffs out of image rendering and cap spreadsheet materialization - cancel abandoned PowerPoint exports and clean up timed-out COM processes - add regression coverage for CodeRabbit findings and realistic COM timeouts
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bac81b24-74ac-47ed-a45d-1a05504e9e17
📒 Files selected for processing (21)
src/main/git/status.test.tssrc/main/ipc/powerpoint-preview.test.tssrc/main/ipc/powerpoint-preview.tssrc/main/office/native-powerpoint-preview-script.tssrc/main/office/native-powerpoint-preview.integration.test.tssrc/main/office/native-powerpoint-preview.test.tssrc/main/office/native-powerpoint-preview.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/components/editor/OfficeDocumentViewer.tsxsrc/renderer/src/components/editor/OfficePresentationView.tsxsrc/renderer/src/components/editor/office-document-parse.test.tssrc/renderer/src/components/editor/office-document-parse.tssrc/renderer/src/components/editor/office-presentation-preview.test.tssrc/renderer/src/components/editor/office-presentation-preview.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/powerpoint-preview.ts
🚧 Files skipped from review as they are similar to previous changes (15)
- src/shared/powerpoint-preview.ts
- src/renderer/src/components/editor/office-presentation-preview.test.ts
- src/preload/api-types.ts
- src/main/ipc/powerpoint-preview.ts
- src/preload/index.ts
- src/renderer/src/components/editor/office-document-parse.test.ts
- src/main/office/native-powerpoint-preview-script.ts
- src/main/office/native-powerpoint-preview.test.ts
- src/renderer/src/components/editor/OfficeDocumentViewer.tsx
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/components/editor/OfficePresentationView.tsx
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/locales/es.json
| await execFileAsync( | ||
| 'powershell.exe', | ||
| [ | ||
| '-NoProfile', | ||
| '-NonInteractive', | ||
| '-ExecutionPolicy', | ||
| 'Bypass', | ||
| '-File', | ||
| scriptPath, | ||
| '-OutputPath', | ||
| sourcePath | ||
| ], | ||
| { timeout: 60_000, windowsHide: true } | ||
| ) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
Clean up PowerPoint when deck creation times out.
The timeout terminates only powershell.exe; forced termination can bypass the script’s finally and leave its out-of-process PowerPoint instance running. Track and terminate the COM process, as the production renderer now does.
#!/bin/bash
rg -n -C5 'execFileAsync|timeout|ProcessIdPath|terminatePowerPointProcess' \
src/main/office/native-powerpoint-preview.integration.test.ts \
src/main/office/native-powerpoint-preview.ts \
src/main/office/native-powerpoint-preview-script.ts🧰 Tools
🪛 ast-grep (0.44.1)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
| async function terminateRecordedPowerPointProcess(processIdPath: string): Promise<void> { | ||
| try { | ||
| const processIdText = await readFile(processIdPath, 'utf8') | ||
| if (!/^\d+$/.test(processIdText.trim())) { | ||
| return | ||
| } | ||
| process.kill(Number(processIdText.trim()), 'SIGKILL') |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n -C6 'existingProcessIds|createdProcess|ProcessIdPath|process\.kill|terminatePowerPointProcess' \
src/main/office/native-powerpoint-preview.ts \
src/main/office/native-powerpoint-preview-script.ts \
src/main/office/native-powerpoint-preview.test.tsRepository: stablyai/orca
Length of output: 11178
🏁 Script executed:
#!/bin/bash
sed -n '1,220p' src/main/office/native-powerpoint-preview.ts
printf '\n--- SCRIPT ---\n'
sed -n '1,220p' src/main/office/native-powerpoint-preview-script.ts
printf '\n--- TESTS ---\n'
sed -n '1,180p' src/main/office/native-powerpoint-preview.test.tsRepository: stablyai/orca
Length of output: 11896
Avoid killing a possibly unrelated PowerPoint process. The PID is inferred from a POWERPNT process-list diff, so a concurrent preview or a user starting PowerPoint in the same window can be picked up here and then SIGKILL-ed. Bind cleanup to the COM instance you created, or re-validate ownership before terminating it.
🧰 Tools
🪛 ast-grep (0.44.1)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
|
I'm waiting for this feature! |
Summary
Addresses #8301.
Screenshots
Testing
pnpm lintpnpm typecheckpnpm testVerified with:
AI Review Report
Reviewed native rendering, fallback behavior, temporary-file cleanup, IPC typing, performance, and local/SSH document flow.
Cross-platform behavior was checked for Windows, macOS, and Linux. Native rendering is Windows-only; other platforms and Windows hosts without PowerPoint retain the browser and text fallbacks. No shortcuts or platform-specific labels were changed.
The review identified and fixed PowerPoint rejecting Windows 8.3 temporary paths.
Security Audit
The IPC accepts document bytes rather than arbitrary paths. PowerShell runs a static script with named arguments, uses an isolated temporary directory, has a bounded timeout, and cleans up after success or failure. No authentication data or secrets are accessed.
Notes
High-fidelity PPTX rendering requires Windows with Microsoft PowerPoint installed.
X: @siddqamar_ai
ELI5
You can preview Word, Excel, and PowerPoint files inside Orca without opening another app. It works for local and SSH files, with native Windows PowerPoint rendering for slides when available.