fix: add a per-widget action menu (#27)
CI / build-and-test (pull_request) Successful in 2m25s

A GridStackItem now carries an overflow menu next to the grip and the
close button: refresh, maximize, duplicate, remove. Maximize and remove
are handled by the item itself; refresh and duplicate are only reported,
since what they mean depends on the widget.

Maximizing only sets a class — the item's gs-* attributes and its
gridstack node are untouched, so restoring is by definition the position
it had.

The menu sits outside the drag-handle selector, like the close button, so
opening it never starts a drag; a Playwright test drags it to prove it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0124BiJikbhbiEsNfJxdWM69
This commit is contained in:
Pit Friedrich
2026-07-28 21:26:05 +02:00
parent cff232070d
commit 8545b06f41
11 changed files with 537 additions and 8 deletions
@@ -22,7 +22,7 @@ card.registration=Registration
card.employees=Employees
card.gridstackHint=How it works
gridstack.hint=Move cards with the grip in their top right corner, resize them from the bottom right corner, close them with the X in the top right corner. The layout is stored in your browser and restored on your next visit.
gridstack.hint=Move cards with the grip in their top right corner, resize them from the bottom right corner, close them with the X in the top right corner. More actions refresh, maximize, duplicate live in the menu next to it. The layout is stored in your browser and restored on your next visit.
gridstack.addWidget=Add widget
gridstack.reset=Reset layout
gridstack.status=Layout changed {0} widgets
@@ -30,6 +30,12 @@ gridstack.statusInitial=Layout unchanged
gridstack.pickerTitle=Choose a widget
gridstack.dragHandle=Move
gridstack.close=Close
gridstack.actions=Actions
gridstack.refresh=Refresh
gridstack.maximize=Maximize
gridstack.restore=Restore
gridstack.duplicate=Duplicate
gridstack.remove=Remove
filter.period=Period
filter.period.month=Month