Skip to content

feat(assets): open a file full size when its card is clicked - #2140

Merged
benceruleanlu merged 1 commit into
mainfrom
bl/asset-left-click-53d1d9
Nov 16, 2026
Merged

benceruleanlu merged 1 commit into
mainfrom
bl/asset-left-click-53d1d9

Conversation

@benceruleanlu

Copy link
Copy Markdown
Member

What changes

Clicking an asset card on the Assets page did nothing before. Only right-click and the hover buttons (Download, More) did anything. Now a click opens the file in a viewer over the page:

  • Image: shown full size, with Fit, 50%, 100% and 200% zoom.
  • Video: plays with its controls. Audio: plays in the design-system audio player. Other files show their type icon.
  • Details panel: name, type and creation time, format, dimensions, size, tags, and Download.
  • Browsing: the arrow keys and a filmstrip step through the files in the page's current order and filter.
  • Closing: Escape, the close button or a click outside closes it, and focus goes back to the card you opened.

This is the Assets half of Pablo's #2008, ported onto main. That PR sits on top of the unmerged Apps stack (#1994 → #1997), so its Apps bridge (showOutput, onOutputAction, the app still behind the dialog) and its workflow section stay there. OutputDetailDialog keeps the same name and item shape, so #2008 can add workflow and the Apps wiring back when it rebases.

How

  • OutputDetailDialog.vue: Pablo's dialog on DesktopDialogSurface, using design-system Button, Tag, Menu and AudioPreview.
  • OutputDetailThumb.vue: a filmstrip entry. A video thumb mounts its <video> only once it scrolls into view, so a long gallery doesn't start one metadata request per video. Image thumbs use the small thumbnailUrl when there is one, and the viewer shows the full previewUrl.
  • AssetsView.vue: the card's media and caption are now one <button>. The card shows a focus ring when that button has keyboard focus. The viewer tracks the open file by its card key, so a refresh that reorders the list keeps it on the same file, and it closes if that file disappears.
  • useVirtualMasonry: gains scrollToIndex. The gallery is virtualized, so as the viewer steps, the gallery scrolls the viewed card into place behind it. That keeps the card mounted to take focus back on close.
  • Button labels: they use text-[13px]/5, not text-ui. The design system's tailwind-merge doesn't know text-ui is a font size and treats it as a colour, which wiped the inverted Download button's label (white on white).
  • Locales: new assets.inspect, assets.detail.* and assets.kindSingular.* strings in en and zh, taken from feat(apps): open outputs in one Desktop dialog from Apps and Assets #2008.

Tests

AssetsView.test.ts has four new journeys:

  • Clicking a card opens the full-size image, not the thumbnail. Escape closes it and focus is back on that card.
  • ArrowRight and ArrowLeft step in page order and wrap at the ends, and a filmstrip thumb jumps to its file.
  • A video opens with its controls.
  • Download in the viewer downloads the file being shown after stepping, not the one that was clicked.

All 33 AssetsView tests pass locally, and the pre-commit typecheck, lint and format checks pass.

Screenshots

Rendered from the real AssetsView in headless Chromium with a mocked window.api. The pictures are stills from the install showcase videos.

Clicking a card

Before After
Clicking a card leaves the page unchanged Clicking a card opens the image in the viewer

A video, picked from the filmstrip, and the card holding focus after Escape

Video After closing
A video playing in the viewer The opened card keeps focus after the viewer closes

Not checked: the running Electron app, Cloud assets (their previewUrl is a signed Cloud link, same as the card already loads), audio files, Windows and Linux.

Clicking an asset card did nothing: only right-click and the hover
buttons had actions. A click now opens the file in a viewer over the
page: the full image (Fit, 50%, 100%, 200%), the video with its
controls, or the audio player, with its name, type, creation time,
format, dimensions, size and tags beside it, and Download.

The arrow keys and a filmstrip step through the files in the page's
order and filter. Escape, the close button or a click outside closes it
and puts focus back on the card. While the viewer steps, the gallery
scrolls the viewed card into place behind it, so the card is still
mounted to take focus back.

This is the Assets half of Pablo's #2008, ported onto main without the
Apps bridge and workflow parts, which wait on the Apps stack. Filmstrip
videos load only once they scroll into view, so a long gallery does not
start a metadata request per video.
@benceruleanlu
benceruleanlu requested review from a team as code owners November 16, 2026 08:53
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The Assets gallery now opens a detail dialog for an asset. The dialog supports media previews, item navigation, image zoom, metadata, tags, and downloads. Gallery selection connects to virtual scrolling and restores focus to the selected card when the dialog closes.

Changes: Asset detail viewer

Layer / File(s) Summary
Detail viewer and media presentation
src/renderer/src/panel/OutputDetailDialog.vue, src/renderer/src/panel/OutputDetailThumb.vue, locales/en.json, locales/zh.json
The dialog displays available image, video, and audio previews, with type-based fallbacks. It adds metadata, tags, a multi-item filmstrip, image zoom controls, and download and close events. Thumbnail rendering supports lazy loading. The locale files add viewer labels and asset-kind names.
Gallery integration and navigation
src/renderer/src/composables/useVirtualMasonry.ts, src/renderer/src/panel/AssetsView.vue, src/renderer/src/panel/AssetsView.test.ts
Gallery cards open the detail dialog. The selected item tracks the visible asset list, selection changes scroll to the relevant card, and closing restores focus. Tests cover image and video previews, keyboard and filmstrip navigation, focus restoration, and downloading the displayed asset.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant AssetsView
  participant OutputDetailDialog
  participant useVirtualMasonry
  User->>AssetsView: Open an asset card
  AssetsView->>OutputDetailDialog: Set selected item
  OutputDetailDialog-->>AssetsView: Change selected index
  AssetsView->>useVirtualMasonry: scrollToIndex(index)
  User->>OutputDetailDialog: Close dialog
  OutputDetailDialog-->>AssetsView: Emit close
  AssetsView->>AssetsView: Restore focus to the matching card
Loading

Possibly related PRs

Suggested reviewers: deepme987, pablowiedemann, benjcooley

Merge Risk: Minimal · up to d0490

This adds an asset viewer to the Assets page. The review found no concrete merge-blocking issues.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@benceruleanlu
benceruleanlu merged commit ecfbb12 into main Nov 16, 2026
20 of 21 checks passed
@benceruleanlu
benceruleanlu deleted the bl/asset-left-click-53d1d9 branch November 16, 2026 08:59
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.

1 participant