Skip to content

Add unified workspace file previews backed by enhanced citations #1000

Description

@paullizer

Summary

Add a more intentional file preview experience for workspace files, preferably through an explicit Preview action that opens a popup modal using the same patterns as enhanced citations. The goal is to make files easier to inspect from workspace surfaces while also broadening and hardening enhanced citation previews.

User Value

Users need to quickly confirm that the right file was uploaded, indexed, shared, or cited without downloading it or starting a chat. A reusable preview pattern also reduces the gap between workspace file management and chat citation inspection.

Proposed Behavior

  • Add a visible Preview action for workspace files where a preview is supported. Prefer this over hover as the primary interaction so the feature works well on desktop, keyboard, and touch devices.
  • Reuse or extract the enhanced citation modal behavior for source file previews where practical.
  • Support existing enhanced citation preview types, including images, PDFs, audio/video, tabular files, and Visio files.
  • For unsupported files, show a clear fallback such as metadata, indexed text, or download/open actions rather than failing silently.
  • Keep chat enhanced citation previews working as they do today while sharing reusable preview code where possible.

Acceptance Criteria

  • Workspace document rows/cards expose a Preview action for supported file types.
  • Preview opens an accessible modal with file name, type-aware preview content, loading/error states, and fallback actions.
  • Preview behavior works for personal, group, and public workspace contexts where the user has access.
  • Enhanced citation modals and workspace file previews use a consistent supported-file matrix and fallback behavior.
  • Backend preview endpoints enforce existing workspace authorization and do not expose raw storage URLs, secrets, or cross-workspace files.
  • Existing chat citation preview behavior remains covered and does not regress.
  • Add focused functional/UI coverage for supported preview types and unauthorized access/fallback cases.

Notes

  • Related but broader than Reuse image popup for chat and workspace images #972, which focuses on reusing the image popup for chat and workspace images.
  • Likely implementation areas include application/single_app/static/js/workspace/workspace-documents.js, application/single_app/static/js/chat/chat-enhanced-citations.js, and application/single_app/route_enhanced_citations.py.
  • Open design question: whether to add hover previews later for lightweight metadata/snippets after the explicit Preview action is in place.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Pending Evaluation

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions