Upgrade MyGo to v0.5.5

Elements are now pass-scoped value handles: tests that read bounds
after a frame bind a ui.Handle. pixel tells frames apart by the build
pass's root, since the Tester clock no longer moves on its own.

Fix the regressions the upgrade brought:
- Clipboard reads in input handlers go through c.Services().
- MyGo notes an overlay's opener after building it, so AutoFocus
  inside lost it; pixel.AutoFocus focuses through a Handle, and
  archtest bans the raw call. Dialogs hand the focus back again.
- Elements around a press stay hovered: Tooltip tells a press-given
  focus by focus arriving under the pointer.
- The web host moves the Tester clock with real time, at most 500 ms
  a call, and gives components the real clock.

The gallery's source index also accepts CRLF checkouts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-17 01:31:08 -04:00
1 parent 1f3d38110e
commit 03e1f91706
532 files changed
+828 -735

No files matched your search

+2 -2
View File
@@ -16,7 +16,7 @@ type AssigneePickerOptions struct {
}
type AssigneePickerResult struct {
Element *ui.Element
Element ui.Element
Changed bool
}
@@ -38,7 +38,7 @@ func AssigneePicker(c *ui.Context, text string, party []string, chosen *int, o A
}
// The shell draws the seat; the radio stays bare.
sel := *chosen
shell, base, st := pixel.Shell(c, func() *ui.Element {
shell, base, st := pixel.Shell(c, func() ui.Element {
return ui.RadioBase(c, &sel, i).Label(name).Disabled(o.Disabled)
})
// The radio picks before it is told it is off.
+1 -1
View File
@@ -17,7 +17,7 @@ type BurndownOptions struct {
}
// Burndown draws the ideal line and the work left.
func Burndown(c *ui.Context, text string, total float64, days int, left []float64, o BurndownOptions) *ui.Element {
func Burndown(c *ui.Context, text string, total float64, days int, left []float64, o BurndownOptions) ui.Element {
k := pixel.K(c)
if !(total > 0) || math.IsInf(total, 0) || days < 1 || len(left) > days+1 {
panic(fmt.Sprintf("project: Burndown of %v over %d days, %d points", total, days, len(left)))
+1 -1
View File
@@ -18,7 +18,7 @@ type ChecklistOptions struct {
}
type ChecklistResult struct {
Element *ui.Element
Element ui.Element
Changed bool
}
+2 -2
View File
@@ -26,7 +26,7 @@ type IssueCardOptions struct {
}
type IssueCardResult struct {
Element *ui.Element
Element ui.Element
Clicked bool
}
@@ -51,7 +51,7 @@ func IssueCard(c *ui.Context, is Issue, o IssueCardOptions) IssueCardResult {
w := pixel.Or("IssueCard Width", o.Width, 160)
lines := pixel.Wrap(is.Title, w-8, 2)
// The shell draws the card; the button stays bare.
shell, base, st := pixel.Shell(c, func() *ui.Element {
shell, base, st := pixel.Shell(c, func() ui.Element {
return ui.ButtonBase(c).Label(is.ID + " " + is.Title).Disabled(o.Disabled)
})
base.Description(strings.Join(said, ", "))
+1 -1
View File
@@ -17,7 +17,7 @@ type LabelPickerOptions struct {
}
type LabelPickerResult struct {
Element *ui.Element
Element ui.Element
Changed bool
}
+1 -1
View File
@@ -64,7 +64,7 @@ var (
)
// Milestones plants flags on a path; a hero marks today.
func Milestones(c *ui.Context, text string, ms []Milestone, o MilestonesOptions) *ui.Element {
func Milestones(c *ui.Context, text string, ms []Milestone, o MilestonesOptions) ui.Element {
k := pixel.K(c)
if len(ms) == 0 {
panic("project: Milestones has none")
+1 -1
View File
@@ -18,7 +18,7 @@ type PomodoroOptions struct {
}
type PomodoroResult struct {
Element *ui.Element
Element ui.Element
// Changed is START, PAUSE or RESET; Rang ends a phase.
Changed, Rang bool
}
+1 -1
View File
@@ -56,7 +56,7 @@ var bars = [3]*pixel.Sprite{pixel.MustSprite(`
var levelInks = [...]pixel.Slot{pixel.Good, pixel.Warn, pixel.Bad, pixel.Bad}
// Priority is a level's icon; critical is on fire.
func Priority(c *ui.Context, l Level, o PriorityOptions) *ui.Element {
func Priority(c *ui.Context, l Level, o PriorityOptions) ui.Element {
k := pixel.K(c)
say := l.word(k)
s := pixel.Or("Priority Scale", o.Scale, 1)
+1 -1
View File
@@ -53,7 +53,7 @@ func hms(d time.Duration) string {
}
// show draws s unnamed, beside an element that names it.
func show(c *ui.Context, k pixel.Kit, s string, slot pixel.Slot, w int) *ui.Element {
func show(c *ui.Context, k pixel.Kit, s string, slot pixel.Slot, w int) ui.Element {
return ui.Box(c).Size(k.D(w), k.D(pixel.LineHeight)).Draw(func(p *ui.Painter, r ui.Rect) {
k.Canvas(p, r).Text(0, 0, pixel.Wrap(s, w, 1)[0], slot, 1)
})
+2 -2
View File
@@ -19,7 +19,7 @@ type QuestBoardOptions struct {
}
type QuestBoardResult struct {
Element *ui.Element
Element ui.Element
// Moved reports a card that changed column or place.
Moved bool
}
@@ -47,7 +47,7 @@ func QuestBoard(c *ui.Context, text string, cols *[3][]string, o QuestBoardOptio
}
most = max(most, len(col))
}
shell, base, st := pixel.Shell(c, func() *ui.Element {
shell, base, st := pixel.Shell(c, func() ui.Element {
return ui.Box(c).Focusable().Role(ui.RoleGroup).Label(text).Disabled(o.Disabled)
})
b := ui.Local(base, boardKey{}, func() board { return board{} })
+1 -1
View File
@@ -36,7 +36,7 @@ var capSlots = []pixel.Slot{pixel.Info, pixel.Good, pixel.Warn, pixel.Magic, pix
const laneH = pixel.LineHeight + 8
// Roadmap lays bars on lanes under months, from from's.
func Roadmap(c *ui.Context, text string, from time.Time, lanes []Lane, o RoadmapOptions) *ui.Element {
func Roadmap(c *ui.Context, text string, from time.Time, lanes []Lane, o RoadmapOptions) ui.Element {
k := pixel.K(c)
months, mw := pixel.Or("Roadmap Months", o.Months, 6), pixel.Or("Roadmap MonthWidth", o.MonthWidth, 44)
if len(lanes) == 0 || months > 120 {
+1 -1
View File
@@ -26,7 +26,7 @@ type SprintPanelOptions struct {
const day = 24 * time.Hour
// SprintPanel shows a sprint's points done and days left.
func SprintPanel(c *ui.Context, s Sprint, o SprintPanelOptions) *ui.Element {
func SprintPanel(c *ui.Context, s Sprint, o SprintPanelOptions) ui.Element {
k := pixel.K(c)
if s.Name == "" || !s.Start.Before(s.End) || s.Total < 1 || s.Done < 0 || s.Done > s.Total {
panic(fmt.Sprintf("project: SprintPanel %q from %v to %v, %d of %d", s.Name, s.Start, s.End, s.Done, s.Total))
+1 -1
View File
@@ -24,7 +24,7 @@ type TaskItemOptions struct {
}
type TaskItemResult struct {
Element *ui.Element
Element ui.Element
Changed bool
}
+1 -1
View File
@@ -17,7 +17,7 @@ type TaskListOptions struct {
}
type TaskListResult struct {
Element *ui.Element
Element ui.Element
// Changed reports a task checked or a filter turned.
Changed bool
}
+1 -1
View File
@@ -25,7 +25,7 @@ type TimeTrackerOptions struct {
}
type TimeTrackerResult struct {
Element *ui.Element
Element ui.Element
Started, Stopped bool
}
+1 -1
View File
@@ -26,7 +26,7 @@ type WorkloadBarOptions struct {
}
// WorkloadBar shows each member's load against capacity.
func WorkloadBar(c *ui.Context, text string, loads []Load, o WorkloadBarOptions) *ui.Element {
func WorkloadBar(c *ui.Context, text string, loads []Load, o WorkloadBarOptions) ui.Element {
k := pixel.K(c)
cp := o.Capacity
if cp == 0 {