Skip to content

Add Library thumbnail previews and a resizable panel - #243

Open
OmarB97 wants to merge 1 commit into
lightningpixel:mainfrom
OmarB97:feat/library-thumbnails-and-resize
Open

Add Library thumbnail previews and a resizable panel#243
OmarB97 wants to merge 1 commit into
lightningpixel:mainfrom
OmarB97:feat/library-thumbnails-and-resize

Conversation

@OmarB97

@OmarB97 OmarB97 commented Jul 27, 2026

Copy link
Copy Markdown

Problem

The Library popover lists every Workflows/Exports asset as a bare filename. Once you have more than a handful of exports, the list turns into unreadable filename soup, and the popover has a fixed width, so there's no way to see more of a name or path without scrolling.

Changes

  • Each .glb/.gltf row now shows its pre-rendered <name>.thumb.png as an 80px square tile beside the name, loaded through a new workspace:library:thumbnail IPC handler that reuses the same workspace-path validation as the existing workspace:library:read/open handlers (electron/main/artifact-registry-service.ts, electron/preload/electron-api.ts, src/areas/generate/assetLibraryService.ts).
  • The Library panel can be resized by dragging its right edge, using the same drag-to-resize pattern already used for the Workflows side panel in this file. The width is clamped to 260-560px and persisted to localStorage so it survives restarts (src/areas/generate/assetLibraryUi.ts, src/areas/generate/GeneratePage.tsx).

Degrading without a thumbnail

If <name>.thumb.png doesn't exist, or fails to read, the IPC handler returns { success: false } with no error payload — a missing thumbnail is a normal, silent condition, not a surfaced error. The row then renders exactly as it did before this change: no image element, no broken-image icon, just the existing text-only row.

Testing

  • npm run lint — clean
  • npm test (test:py + test:node, including all existing assetLibrary*.test.ts files) — all pass, plus new tests covering the thumbnail read path (missing file, non-mesh asset, unsafe/traversal path) and the panel-width clamp/persistence helpers
  • npm run build — renderer, main, and preload all build successfully

Asset rows now render their pre-rendered <name>.thumb.png beside the
filename instead of showing bare text, falling back to the existing
text-only row when no thumbnail exists. The Library panel can also be
resized by dragging its edge, with the chosen width persisted across
restarts.
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