mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
feat(now-playing): draggable widget cards with per-user layout (#267)
Each dashboard card (Album, Top Songs, Credits, Artist, Discography, On Tour) is now a widget the user grabs and drops anywhere — reorder within a column or move across columns. Layout persists per-install via the new nowPlayingLayoutStore (Zustand + localStorage, same shape as sidebarStore with an onRehydrateStorage guard for unknown IDs). Drag uses psyDnD (useDragSource / psy-drop event, the mouse-event based system from DragDropContext) — HTML5 native DnD is a no-go on WebKitGTK Linux where it always shows a forbidden cursor. The whole card is the drag handle; the column listens via a document-level mousemove for the drop indicator and via a global psy-drop listener that reads the latest hovered column from a ref, so drops below the last card still land correctly regardless of column height. Visibility is toggled from a layout menu in the top-right of the dashboard — two sections (visible / hidden) plus a reset-to-defaults button. No hide buttons on the cards themselves (keeps the card UI uncluttered). An equal-height grid (align-items: stretch + min-height on columns) keeps the drop zone active for the full vertical span of either column. Co-authored-by: Psychotoxical <dev@psysonic.app> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
b4f31e0954
commit
db72ed9e5a
@@ -117,6 +117,13 @@ export const deTranslation = {
|
||||
rgAutoTooltip: 'ReplayGain (Auto)',
|
||||
showMoreTracks: '{{count}} weitere anzeigen',
|
||||
showLessTracks: 'Weniger anzeigen',
|
||||
hideCard: 'Karte ausblenden',
|
||||
layoutMenu: 'Layout',
|
||||
visibleCards: 'Sichtbare Karten',
|
||||
hiddenCards: 'Ausgeblendete Karten',
|
||||
noHiddenCards: 'Keine ausgeblendeten Karten',
|
||||
resetLayout: 'Layout zurücksetzen',
|
||||
emptyColumn: 'Karten hier ablegen',
|
||||
},
|
||||
contextMenu: {
|
||||
playNow: 'Direkt abspielen',
|
||||
|
||||
Reference in New Issue
Block a user