mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[PR #20035] [MERGED] feat: Enhanced File Viewer Modal (Excel, CSV, Markdown & Code) #25437
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20035
Author: @silentoplayz
Created: 12/18/2025
Status: ✅ Merged
Merged: 12/20/2025
Merged by: @tjbck
Base:
dev← Head:feat/revamp-FileItemModel📝 Commits (6)
0326184feat: Add Excel file viewer to FileItemModala3267a4feat: Add CSV file viewer to FileItemModal432fe35feat: Add Markdown and Code syntax highlighting to file viewer73ca287chore: add dependencyd953640fix: default to raw text view for Excel/Code/MD files5d3cdbbfix: only show rows count in preview tab for excel files📊 Changes
2 files changed (+326 additions, -13 deletions)
View changed files
📝
package.json(+1 -0)📝
src/lib/components/common/FileItemModal.svelte(+325 -13)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. Not targeting thedevbranch will lead to immediate closure of the PR.Changelog Entry
Description
This PR significantly enhances the
FileItemModalcomponent to provide a rich viewing experience for various file types that were previously displayed as plain text. It introduces native-like viewers for Excel/CSV spreadsheets, Markdown documents, and Source Code files.Key Improvements:
Markdowncomponent.CodeBlockcomponent.Added
xlsxlibrary to parse and display spreadsheet data in formatted tables..mdfiles and render them using theMarkdowncomponent withprosestyling.CodeBlockcomponent.isExcel,isMarkdown, andisCodebased on MIME types and extensions.Changed
src/lib/components/common/FileItemModal.svelteto support conditional rendering of different content types.Dependencies
xlsx(^0.18.5) dependency topackage.jsonfor client-side Excel parsing.Additional Information
This feature revamp addresses the need for better in-app file previews (Issue #2867). It leverages existing components (
Markdown,CodeBlock) to keep the codebase consistent and implementation lightweight ("Quick Wins"), while addingxlsxfor robust spreadsheet handling.Screenshots or Videos
Before (test-multiple-sheets.xlsx)
After (test-multiple-sheets.xlsx)
Before (test.xlsx)
After (test.xlsx)
Before (test.xls)
After (test.xls)
Before (file_example_XLSX_5000.xlsx)
After (file_example_XLSX_5000.xlsx)
Before (file_example_XLSX_5000.xls)
After (file_example_XLSX_5000.xls)
Before (user-import.csv)
After (user-import.csv)
Before (improved-migration-guide.md)
After (improved-migration-guide.md)
Before (MemTest86_User_Guide_UEFI.pdf)
After (MemTest86_User_Guide_UEFI.pdf)
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.