From ee963b2772d6416fae9a11ffe7414b3e7eda7301 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 22 Jul 2025 16:16:13 -0400 Subject: present reset button on top of prompt --- go/ui/collection.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'go/ui') diff --git a/go/ui/collection.go b/go/ui/collection.go index f60f5f3b..d4c2cd69 100644 --- a/go/ui/collection.go +++ b/go/ui/collection.go @@ -50,6 +50,16 @@ func (c *Collection) AddWidget(w Widget) { if slices.Contains(c.widgets, w) { log.Panicf("Double insertion of %v", w) } + log.Println("add", w) + c.widgets = append(c.widgets, w) +} + +// MoveIdxToLast shifts the widget at index idx to the last position. +func (c *Collection) MoveIdxToLast(idx int) { + w := c.widgets[idx] + after := c.widgets[idx+1:] + c.widgets = c.widgets[:idx] + c.widgets = append(c.widgets, after...) c.widgets = append(c.widgets, w) } -- cgit v1.2.3