WIP components (as built)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 15:51:57 -04:00
1 parent a22527cceb
commit ade219840e
70 files changed
+2610 -235

No files matched your search

+17 -1
View File
@@ -50,8 +50,24 @@ func TestSearchProgressBadCounts(t *testing.T) {
}, 100, 100)
}
func TestSearchProgressReopensForNextSearch(t *testing.T) {
opts := SearchProgressOptions{Query: "first", Read: 1, Total: 2, Stages: []SearchStage{{Label: "First stage"}}}
tt := ui.NewTester(func(c *ui.Context) {
Use(c, Settings{})
SearchProgress(c, opts)
}, 400, 300)
tt.SetPreferences(ui.Preferences{ReduceMotion: true, TextScale: 1})
opts.Done = true
tt.Frame()
opts = SearchProgressOptions{Query: "second", Total: 3, Stages: []SearchStage{{Label: "Next stage"}}}
tt.Frame()
if !tt.HasText("Next stage") || !tt.HasText("Read 0 of 3 sources") {
t.Fatalf("next search remains folded: %q", tt.Texts())
}
}
func TestSearchProgressSnapshot(t *testing.T) {
snapshot(t, "search_progress", 440, 230, func(c *ui.Context) {
snapshot(t, "search_progress", 440, 300, func(c *ui.Context) {
ui.Column(c).Padding(16).Gap(12).Children(func() {
SearchProgress(c, SearchProgressOptions{Query: "Versailles 1682", Read: 3, Total: 8, Stages: searchStages(2)})
SearchProgress(c, SearchProgressOptions{Query: "Hall of Mirrors", Read: 5, Total: 5, Stages: searchStages(4), Done: true})