fix: make dashboard widgets closable (#14)
CI / build-and-test (pull_request) Successful in 1m27s
CI / build-and-test (pull_request) Successful in 1m27s
Every GridStackItem now renders a close button next to its drag grip, mirroring the grip's hover affordance. Closing detaches the item server-side; grid-stack.ts already unregisters widgets via its MutationObserver, so the layout is persisted without an extra protocol. Closable is on by default and can be turned off per item with setClosable(false); GridStackItem.CloseEvent lets views react. The GridStackView "remove last" toolbar button is dropped — per-widget close replaces it, so the view no longer tracks a widget stack. Its counter now only grows, keeping a closed widget's id from being handed to a new widget (which would inherit the saved position). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ue9ZtWUBQF4SuSHpzZ3zwq
This commit is contained in:
@@ -25,7 +25,8 @@ public enum Fa {
|
||||
ADD("fa-solid", "fa-plus"),
|
||||
REMOVE("fa-solid", "fa-trash"),
|
||||
RESET("fa-solid", "fa-arrow-rotate-left"),
|
||||
DRAG("fa-solid", "fa-grip-vertical");
|
||||
DRAG("fa-solid", "fa-grip-vertical"),
|
||||
CLOSE("fa-solid", "fa-xmark");
|
||||
|
||||
private final String[] classes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user