WIP components (as built)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 15:51:57 -04:00
1 parent 299e5fe720
commit 4b8fdf8df7
71 files changed
+3241 -468

No files matched your search

+24
View File
@@ -74,3 +74,27 @@ func TestInterruptButtonSnapshot(t *testing.T) {
})
})
}
func TestInterruptButtonAncestorDisabledClosesConfirmation(t *testing.T) {
disabled := false
stops := 0
tt := ui.NewTester(func(c *ui.Context) {
Use(c, Settings{})
ui.Column(c).Disabled(disabled).Children(func() {
if InterruptButton(c, true, InterruptButtonOptions{Confirm: true}).Changed() {
stops++
}
})
}, 400, 300)
_ = tt.Click("Stop")
disabled = true
tt.Frame()
if tt.HasText("Stop the agent?") || stops != 0 {
t.Fatal("disabled confirmation retained")
}
_ = tt.Click("Stop")
tt.Key(0, ui.KeyEnter)
if stops != 0 {
t.Fatal("disabled interrupt delivered")
}
}