Add input components 066-085; gallery chrome on real components; deploy warms the edge

This commit is contained in:
ZacharyZhang-NY committed 2026-10-11 19:05:42 -04:00
1 parent 0247a130f5
commit 095eab2b4c
38 files changed
+2340 -172

No files matched your search

+3 -1
View File
@@ -23,6 +23,8 @@ type Edit struct {
// Element is laid out; Input takes the focus.
Element, Input *ui.Element
Changed, Submitted, Focused bool
// Line is the caret's line, from 0.
Line int
}
type editKey struct{}
@@ -79,7 +81,7 @@ func Editor(c *ui.Context, value *string, o EditorOptions) Edit {
}
return took
})
res := Edit{Element: shell, Input: base, Changed: s.changed, Submitted: s.submitted, Focused: base.Focused()}
res := Edit{Element: shell, Input: base, Changed: s.changed, Submitted: s.submitted, Focused: base.Focused(), Line: cl}
if res.Focused {
frameOf(c).typing = true
}
+6
View File
@@ -128,8 +128,14 @@ func TestEditorMultiline(t *testing.T) {
h.tt.Key(0, ui.KeyUp)
h.tt.Type("X")
h.want("abX\ncd")
if h.last.Line != 0 {
t.Fatalf("caret line %d on the first line", h.last.Line)
}
h.tt.Key(0, ui.KeyEnter)
h.want("abX\n\ncd")
if h.last.Line != 1 {
t.Fatalf("caret line %d after a newline", h.last.Line)
}
h.tt.Key(ui.Cmd, ui.KeyEnter)
if h.submits != 1 {
t.Fatalf("Cmd+Enter submitted %d times", h.submits)