This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 15:46:56 -04:00
1 parent 0e51784330
commit 7d20d84b08
3 files changed
+10 -3

No files matched your search

+3 -1
View File
@@ -72,7 +72,9 @@ func AttachmentChip(c *ui.Context, a Attachment) AttachmentChipResult {
ui.Text(c, fmt.Sprintf(msg(c, "attachment_chip.uploading"), pct)).SingleLine().FontSize(small).TextColor(k.TextMuted).FontFeatures("tnum") ui.Text(c, fmt.Sprintf(msg(c, "attachment_chip.uploading"), pct)).SingleLine().FontSize(small).TextColor(k.TextMuted).FontFeatures("tnum")
frac := float32(a.Progress) frac := float32(a.Progress)
ui.Box(c).Height(3).Radius(1.5).Background(k.Border).Role(ui.RoleProgress).Label(fmt.Sprintf(msg(c, "attachment_chip.uploading"), pct)). ui.Box(c).Height(3).Radius(1.5).Background(k.Border).Role(ui.RoleProgress).Label(fmt.Sprintf(msg(c, "attachment_chip.uploading"), pct)).
Draw(func(p *ui.Painter, b ui.Rect) { p.Fill(ui.Rect{X: b.X, Y: b.Y, W: b.W * frac, H: b.H}, k.AccentText, 1.5) }) Draw(func(p *ui.Painter, b ui.Rect) {
p.Fill(ui.Rect{X: b.X, Y: b.Y, W: b.W * frac, H: b.H}, k.AccentText, 1.5)
})
default: default:
ui.Text(c, fileMessageSize(c, a.Size)).SingleLine().FontSize(small).TextColor(k.TextMuted) ui.Text(c, fileMessageSize(c, a.Size)).SingleLine().FontSize(small).TextColor(k.TextMuted)
} }
+3 -1
View File
@@ -41,7 +41,9 @@ func ParameterPanel(c *ui.Context, params []ModelParam) ChoiceResult {
} }
r.Element.Children(func() { r.Element.Children(func() {
for _, p := range params { for _, p := range params {
format := func(v float64) string { return strconv.FormatFloat(v, 'f', sliderDecimals(p.Min, p.Step, p.Default), 64) } format := func(v float64) string {
return strconv.FormatFloat(v, 'f', sliderDecimals(p.Min, p.Step, p.Default), 64)
}
ui.Column(c).Key(p.Label).Gap(u).Children(func() { ui.Column(c).Key(p.Label).Gap(u).Children(func() {
ui.Row(c).Gap(u * 2).AlignItems(ui.Center).Children(func() { ui.Row(c).Gap(u * 2).AlignItems(ui.Center).Children(func() {
ui.Text(c, p.Label).FontWeight(600).Grow(1).SingleLine() ui.Text(c, p.Label).FontWeight(600).Grow(1).SingleLine()
+4 -1
View File
@@ -170,7 +170,10 @@ func TestLayoutTransitionResizes(t *testing.T) {
t.Fatal("negative duration did not panic") t.Fatal("negative duration did not panic")
} }
}() }()
ui.Render(func(c *ui.Context) { Use(c, Settings{}); LayoutTransition(c, LayoutTransitionOptions{Duration: -1}, nil) }, 100, 50, 1) ui.Render(func(c *ui.Context) {
Use(c, Settings{})
LayoutTransition(c, LayoutTransitionOptions{Duration: -1}, nil)
}, 100, 50, 1)
} }
func TestPresenceSnapshot(t *testing.T) { func TestPresenceSnapshot(t *testing.T) {