Skip to content

Add setting to choose how to open office documents - #1149

Open
commandervoid wants to merge 2 commits into
haiwen:masterfrom
commandervoid:office-files
Open

Add setting to choose how to open office documents#1149
commandervoid wants to merge 2 commits into
haiwen:masterfrom
commandervoid:office-files

Conversation

@commandervoid

@commandervoid commandervoid commented May 30, 2026

Copy link
Copy Markdown

Summary

Add setting to choose how office documents (docx, xlsx, pptx,
etc.) are opened: Seafile's internal webview (default), in an external app,
or to be asked each time. Also carved out cache checking functionality
to avoid code duplication and fixed up an old test.

Changes

User-facing

  • New preference "Office documents" in settings with 3 options:
    "Open in Seafile", "Open in external app", "Ask each time"
  • "Ask each time" shows a dialog letting users pick webview or external app
  • Context menu "Open with" goes straight to the system chooser (consistent
    with user intent to pick an external app)

Testing

  • Unit tests for Utils.getOfficeFileClickAction() covering all code paths
    (no OnlyOffice server support, non-office file, INTERNAL/EXTERNAL/ASK)
  • Unit tests for FileCacheHelper.checkRemoteAndOpen() covering
    not cached, a stale cache, and an up-to-date cache.
  • Fixed up the NaturalOrderComparator unit test by having it exercise
    StringNaturalOrderComparator.

@zhwanng

zhwanng commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR, this is a very useful feature

@commandervoid

Copy link
Copy Markdown
Author

One thing I didn't do yet is set the app picker to have the 'Always open' option when the EXTERNAL option is selected. I'm planning to do that in a followup PR (or you can just change that here if you'd like).

@zhwanng

zhwanng commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Since the app already includes the ability to open Office-type files, and adding this feature would require additional configuration options, this PR will be put on hold for now.

For now, can open documents using the local app by following these steps:
Document list -> Long-press to open the context menu -> Open with

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants