Skip to content

fix: improve Album Art Mode scaling, square sizing, and diagonal resize (#78)#81

Merged
klay2000 merged 2 commits into
mainfrom
issue-78
Jun 15, 2026
Merged

fix: improve Album Art Mode scaling, square sizing, and diagonal resize (#78)#81
klay2000 merged 2 commits into
mainfrom
issue-78

Conversation

@klay2000

Copy link
Copy Markdown
Owner

Summary

Fixes #78 — buttons in Album Art Mode were tiny in larger windows, the mini desktop window didn't always end up square, and the undecorated mini window had no way to resize diagonally.

  • Responsive controls: AlbumArtMode.svelte now sizes the close button, prev/play/next icons, and the play button circle with clamp(min, vmin-based, max) instead of fixed pixel sizes (e.g. width="22" on <svg>, 48px .play-btn). They now scale proportionally whether the window is the 320x320 mini mode or a large fullscreen overlay.
  • Reliable square window on entry: enterAlbumArtWindow() in albumArtWindow.js previously called setDecorations(false) followed immediately by setSize(320x320), which on some Linux WMs raced against the decoration change and didn't always land on an exact square. Now it lowers minSize/maxSize first (so the resize isn't clamped against the larger normal minimum), applies the 320x320 size, waits a frame for the decoration change to settle, then re-applies the size once more.
  • Diagonal resizing: Added four corner data-tauri-resize-handle elements (nw/ne/sw/se) to AlbumArtMode.svelte, each calling the new startResizeDrag() helper (getCurrentWindow().startResizeDragging(direction)). This is required for Tauri v2 undecorated windows, which draw no resize borders themselves. A minSize/maxSize of 220–800px keeps the mini window within a sane range while still allowing the user to resize it (including diagonally) per the issue request — it isn't hard-locked to a perfect square while dragging, since the issue prioritizes allowing diagonal resize.

Notes on testing

  • npm run build and npm test pass (49/49 unit tests, no new pure-logic helpers needed for this change).
  • I was not able to test the Tauri-specific window behavior (enterAlbumArtWindow/exitAlbumArtWindow square sizing, and the new resize handles via startResizeDragging) — this requires npm run tauri dev/build on a real desktop environment with a window manager, which isn't feasible in this sandboxed worktree. Please verify on your desktop build:
    1. Enter Album Art Mode from the desktop app — confirm the window becomes an undecorated 320x320 square reliably (try it a few times, including after moving/resizing the main window beforehand).
    2. Hover the corners of the mini window and confirm you can drag-resize diagonally from each corner (nw/ne/sw/se).
    3. Exit Album Art Mode — confirm the window restores its previous size/decorations.
  • The control-scaling change (clamp/vmin sizing) can be checked in the browser by toggling Album Art Mode and resizing the window — buttons should stay proportionate at both small and large sizes.

Test plan

  • User to verify desktop (Tauri) window behavior: square sizing on entry, diagonal resize handles, restore on exit
  • User to verify control sizing looks right in browser at small and large window sizes

klay2000 added 2 commits June 15, 2026 17:33
… Album Art Mode (#78)

- Scale AlbumArtMode controls with clamp()/vmin units instead of fixed px
  sizes, so buttons aren't tiny in a large window and aren't oversized in
  the 320x320 mini mode.
- Make enterAlbumArtWindow() reliably land on an exact 320x320 square by
  lowering minSize/maxSize before resizing and re-applying setSize on the
  next frame, working around WM/compositor timing after setDecorations(false).
- Add data-tauri-resize-handle corner elements + startResizeDragging() so
  the undecorated mini window supports diagonal resizing.
Use a fixed 8x8px diagonal-only resize handle at each corner (matching
typical OS resize-border size), with permissions for setMaxSize and
startResizeDragging so the mini window resizes correctly and stays square.
@klay2000 klay2000 merged commit d7a9eb1 into main Jun 15, 2026
@klay2000 klay2000 deleted the issue-78 branch June 15, 2026 21:56
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.

Improve Scalng on Album View

1 participant