From 947e63ca14f437379d3ef3dc35122831480e6e9e Mon Sep 17 00:00:00 2001
From: LIRUI YU <128563231+LiruiYu33@users.noreply.github.com>
Date: Tue, 13 Jan 2026 17:02:36 +0800
Subject: [PATCH] Fixed typos and added pptx preview for frontend (#12577)
### What problem does this PR solve?
Previously, we added support for previewing PPT and PPTX files in the
backend. Now, we are adding it to the frontend, so when the slides in
the chat interface are referenced, they will no longer be blank.
### Type of change
- Bug Fix (non-breaking change which fixes an issue)
---
api/utils/web_utils.py | 2 +-
web/src/components/document-preview/index.tsx | 2 +-
web/src/pages/document-viewer/index.tsx | 5 +++++
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/api/utils/web_utils.py b/api/utils/web_utils.py
index c13889be2..2d2622931 100644
--- a/api/utils/web_utils.py
+++ b/api/utils/web_utils.py
@@ -88,7 +88,7 @@ CONTENT_TYPE_MAP = {
"heic": "image/heic",
# PPTX
"ppt": "application/vnd.ms-powerpoint",
- "pptx": "application/vnd.openxmLformats-officedocument.presentationml.presentation",
+ "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
}
diff --git a/web/src/components/document-preview/index.tsx b/web/src/components/document-preview/index.tsx
index 968dba3c8..334cae451 100644
--- a/web/src/components/document-preview/index.tsx
+++ b/web/src/components/document-preview/index.tsx
@@ -67,7 +67,7 @@ const Preview = ({
)}
- {['pptx'].indexOf(fileType) > -1 && (
+ {['ppt', 'pptx'].indexOf(fileType) > -1 && (
diff --git a/web/src/pages/document-viewer/index.tsx b/web/src/pages/document-viewer/index.tsx
index 3a01ea555..9bcd60c0f 100644
--- a/web/src/pages/document-viewer/index.tsx
+++ b/web/src/pages/document-viewer/index.tsx
@@ -13,6 +13,7 @@ import { ExcelCsvPreviewer } from '@/components/document-preview/excel-preview';
import { ImagePreviewer } from '@/components/document-preview/image-preview';
import Md from '@/components/document-preview/md';
import PdfPreview from '@/components/document-preview/pdf-preview';
+import { PptPreviewer } from '@/components/document-preview/ppt-preview';
import { TxtPreviewer } from '@/components/document-preview/txt-preview';
import { previewHtmlFile } from '@/utils/file-util';
// import styles from './index.less';
@@ -53,6 +54,10 @@ const DocumentViewer = () => {
)}
{ext === 'docx' && }
+
+ {(ext === 'ppt' || ext === 'pptx') && (
+
+ )}
);
};