fix: make dashboard widgets closable (#14) #17
Reference in New Issue
Block a user
Delete Branch "ai/issue-14-closable-widgets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #14
What
Every
GridStackItemnow renders a close button (fa-xmark) in its top-right corner, next to the drag grip — same hover/focus affordance, same corner slot, with the grip stepping aside (right: 48px) only when a close button is present.GridStackItem#close()detaches the item from its layout and fires aCloseEvent;grid-stack.tsalready unregisters removed widgets via itsMutationObserver, so the saved layout updates without any new client protocol.setClosable(false)hides the button (isClosable(),getCloseButton()alongside the existinggetDragHandle()).gridstack.closetranslation key (de/en/es), plus the hint text now mentions closing.Also
Per follow-up request: the "Letztes entfernen" / "Remove last" toolbar button in
GridStackViewis gone — per-widget close replaces it. The view no longer keeps aDequeof added widgets, and its widget counter only ever grows so a closed widget'sgs-idis never handed to a new widget (which would otherwise inherit the closed one's saved position).Tests
./mvnw test— 5/5 green.GridStackViewTestcovers add-then-close, close-removes-only-the-clicked-item, theCloseEventlistener, andsetClosable(false). The click tests fire a real DOMclickat the button so its wiring is covered, not just the server-sideclose()API.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ue9ZtWUBQF4SuSHpzZ3zwq