Skip to content

feat: preview and text extraction for office files and pdf - #47640

Closed
xirothedev wants to merge 6 commits into
anomalyco:devfrom
The-Resonance-Team:office-preview-pdf
Closed

xirothedev wants to merge 6 commits into
anomalyco:devfrom
The-Resonance-Team:office-preview-pdf

Conversation

@xirothedev

@xirothedev xirothedev commented Sep 6, 2026 •

Copy link
Copy Markdown

Issue for this PR

N/A - fork feature catch-up (preview + office extraction onto dev).

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds offline document preview and office attachment text extraction:

  • Preview (session-ui, app): pdf via iframe, docx/xlsx/pptx via ooxml, markdown, fallback. Wires document-preview-tab, file-tabs, session panel.
  • Extraction (core, opencode): office.ts handles doc, xls, docx, xlsx, pptx, odt, ods, odp on attach and read. Legacy ppt binary excluded.
  • Pdf: preview + attach + extract.

Two commits on office-preview-pdf (3-word branch, off dev). Deps: mammoth, xlsx, zip.js, word-extractor, docx-preview, docx-renderer, silurus/ooxml, dompurify. Server PluginInvoke left out on purpose - the app falls back to built-in preview when no office.preview plugin exists.

How did you verify your code works?

  • bun test test/office.test.ts test/tool-read-filesystem.test.ts (packages/core): 20 pass
  • bun test test/tool/read.test.ts test/session/message-v2.test.ts (packages/opencode): 83 pass
  • bun test src/components/office-preview.test.ts (packages/session-ui): 4 pass
  • bun test src/pages/session/helpers.test.ts (packages/app): 12 pass
  • tsgo --noEmit clean in app, core, opencode, session-ui

Screenshots / recordings

No screenshot attached. Storybook stories + fixtures (docx, xlsx, pdf, md) included under session-ui.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:title labels Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Hey! Your PR title feat(core,session-ui,app): preview and text extraction for office files and pdf doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@xirothedev xirothedev changed the title feat(core,session-ui,app): preview and text extraction for office files and pdf feat: preview and text extraction for office files and pdf Sep 6, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@xirothedev

Copy link
Copy Markdown
Author

Resolved: title updated to feat: preview and text extraction for office files and pdf (single-scope form per CONTRIBUTING). Compliance bot confirmed guidelines met. No further action.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant