Skip to content

FA-1353 Add “Text Documents” as a Vault File Type (Filter + Icon)#956

Merged
namtran6701 merged 1 commit intodevelopfrom
FA-1353-add-text-documents-as-a-vault-file-type
Mar 30, 2026
Merged

FA-1353 Add “Text Documents” as a Vault File Type (Filter + Icon)#956
namtran6701 merged 1 commit intodevelopfrom
FA-1353-add-text-documents-as-a-vault-file-type

Conversation

@ramirezmorac2
Copy link
Copy Markdown
Collaborator

JIRA Ticket

FA-1353

Description

[Add support for text documents as a file type in gallery filtering]

Checklist

  • Code review requested
  • Tests completed
  • Documentation updated

Copilot AI review requested due to automatic review settings March 24, 2026 19:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for filtering gallery (“Vault”) items by a new Text Documents file type, spanning frontend filter UI, typed API client params, and backend filtering/validation.

Changes:

  • Adds a new “Text Documents” option to the Gallery file type filter UI and sends file_type=text_documents to the API.
  • Extends the frontend API client typing for getGalleryItems to include "text_documents".
  • Adds backend support for filtering blobs by Word document types/extensions and validates "text_documents" in the gallery endpoint.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
frontend/src/pages/gallery/Gallery.tsx Adds “Text Documents” to the file type filter options shown in the Gallery UI.
frontend/src/api/api.ts Updates getGalleryItems request param typing to allow "text_documents".
backend/gallery/blob_utils.py Adds Word document content-type/extension detection and filtering for file_type=text_documents.
backend/app.py Allows "text_documents" as a valid file_type query param value for the gallery endpoint.

Comment on lines 36 to +40
const fileTypeFilterOptions = [
{ label: "All Types", value: "all" },
{ label: "Images", value: "images" },
{ label: "PowerPoint", value: "pptx" }
{ label: "Images/Charts", value: "images" },
{ label: "Presentations", value: "pptx" },
{ label: "Text Documents", value: "text_documents" }
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new "Text Documents" filter value will cause the gallery to request file_type=text_documents, which (per backend changes) can include legacy .doc files. In this page, preview + placeholder icon logic only recognizes .docx via getOfficeExtension / shouldUseDocumentViewer, so .doc items will fall back to the image preview path and show the default presentation icon (and likely fail to preview). Please either add .doc handling end-to-end in the gallery (extension detection + viewer/icon), or restrict the backend filter to the formats the frontend can actually preview.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +21
TEXT_DOCUMENT_EXTENSIONS = {".docx", ".doc"}
TEXT_DOCUMENT_CONTENT_TYPES = {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/msword"
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEXT_DOCUMENT_EXTENSIONS / TEXT_DOCUMENT_CONTENT_TYPES include legacy .doc / application/msword, but the current frontend gallery preview component (PPTXViewer via shouldUseDocumentViewer) only detects .docx and won’t render .doc properly. To avoid returning files the UI can’t preview (and showing incorrect icons), either remove .doc/application/msword from this filter or ensure the frontend viewer/detection supports .doc consistently.

Suggested change
TEXT_DOCUMENT_EXTENSIONS = {".docx", ".doc"}
TEXT_DOCUMENT_CONTENT_TYPES = {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/msword"
TEXT_DOCUMENT_EXTENSIONS = {".docx"}
TEXT_DOCUMENT_CONTENT_TYPES = {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"

Copilot uses AI. Check for mistakes.
@namtran6701 namtran6701 merged commit a21e93f into develop Mar 30, 2026
5 of 6 checks passed
@namtran6701 namtran6701 deleted the FA-1353-add-text-documents-as-a-vault-file-type branch March 30, 2026 14:20
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.

3 participants