Skip to content

Feat/file browser rich preview#16

Merged
iptoux merged 5 commits into
mainfrom
feat/file-browser-rich-preview
May 22, 2026
Merged

Feat/file browser rich preview#16
iptoux merged 5 commits into
mainfrom
feat/file-browser-rich-preview

Conversation

@iptoux
Copy link
Copy Markdown
Contributor

@iptoux iptoux commented May 22, 2026

Summary

Extends the center-tab file preview introduced on main (images, video, Markdown, Mermaid) into a full typed preview system with sandboxed Tauri IPC, dedicated renderers, and a shared topbar.

  • Rich media & docs: ImageView, VideoView, MarkdownView (pulldown-cmark + sanitized HTML), and MermaidView (vendored Mermaid 11.x, lazy-loaded) with extension-based routing via FileKind and new commands stat_workspace_file, read_workspace_image_file, read_workspace_video_file in src-tauri/src/fs_entries.rs (16 MiB image / 64 MiB video caps, workspace-root sandbox unchanged).
  • Code & text: new CodeView with sticky line-number gutter, highlight.js syntax highlighting for FileKind::Code, plain monospaced layout for FileKind::Text, and per-row click selection; hljs_glue.rs + util.rs split highlighted HTML into balanced per-line fragments.
  • UX & i18n: shared preview header (name, path, size, mtime, copy path, refresh), localized error banners, 19+ new FilePreview* keys across all 13 locales; docs/user/file-preview.md and architecture/IPC docs updated.
  • Also included: git_graph gutter/layout refactor (1f309ab) bundled on this branch.

44 files changed (~7.9k insertions). Vendored assets: public/vendor/highlight/, public/vendor/mermaid/.

Test plan

  • Open workspace, click files in Project Explorer: PNG/SVG, MP4, .md (incl. fenced mermaid), .mmd, unsupported binary → correct renderer or placeholder
  • Code file (e.g. .rs, .ts): line numbers, syntax colors, row select/deselect; plain .txt/.log without highlighting
  • Topbar: size/mtime chips, copy path toast, refresh reloads content + meta
  • Files over image/video caps show localized too-large message
  • cargo test --workspace and cargo check -p blxcode-ui --target wasm32-unknown-unknown
  • Git graph panel still renders sensibly after gutter refactor

Made with Cursor

iptoux added 5 commits May 22, 2026 21:19
…er handling

Refactored the Git graph implementation to replace the swim-lane layout with a native `git log --graph` representation. Updated the data structures to use `GitGraphEntry` for better clarity and streamlined the fetching of commit data. Improved gutter handling for better alignment and visual consistency in the sidebar. This change enhances the overall user experience by providing a more accurate representation of commit relationships.
Added support for previewing various file types including images, videos, Markdown, and Mermaid diagrams. Introduced a new `FilePreviewHeader` component to display file metadata such as name, path, size, and modification time. Enhanced the Markdown renderer to support inline Mermaid blocks and improved the overall user experience with loading states and error handling. Updated internationalization keys for new features across multiple languages.
… error handling and internationalization

Completed the implementation of the file preview feature, supporting images, videos, Markdown, and Mermaid diagrams. Introduced a structured error handling system using `FilePreviewError` to provide user-friendly messages for various failure scenarios. Updated internationalization keys across multiple languages to reflect new error messages and improved user experience. Marked the file browser rich preview as active in the plans documentation.
…ers and documentation

Expanded the file preview feature to support rich previews for images, videos, Markdown, and Mermaid diagrams. Introduced a new topbar displaying file metadata and improved error handling for unsupported file types. Updated documentation to include a dedicated section for file previews and added screenshots for better user guidance. Included internationalization updates for new keys across all supported languages.
…ew with line numbers and syntax highlighting

Added a new `CodeView` component to the file preview feature, enabling a two-column layout for source code files with line numbers and syntax highlighting using highlight.js. This update allows users to select specific lines for reference, improving the usability of code previews. The implementation includes support for various programming languages and integrates with existing file preview functionalities. Updated styles and documentation to reflect these changes, along with new unit tests for the CodeView component.
@iptoux iptoux self-assigned this May 22, 2026
@iptoux iptoux added done Ticket/Work done. enhancement New feature or request labels May 22, 2026
@iptoux iptoux merged commit e3e58c9 into main May 22, 2026
1 check passed
@iptoux iptoux deleted the feat/file-browser-rich-preview branch May 22, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

done Ticket/Work done. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant