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

+1 -1
View File
@@ -24,7 +24,7 @@ type AgentCardOptions struct {
const cardW, cardH = 136, 48
// AgentCard is a party card: class, level, context as HP.
func AgentCard(c *ui.Context, a Agent, o AgentCardOptions) *ui.Element {
func AgentCard(c *ui.Context, a Agent, o AgentCardOptions) ui.Element {
k := pixel.K(c)
if a.Name == "" || a.Class == "" || a.Level < 1 || a.Window < 1 || a.Used < 0 || a.Used > a.Window {
panic(fmt.Sprintf("agent: AgentCard %q, %q, LV %d, %d of %d tokens", a.Name, a.Class, a.Level, a.Used, a.Window))
+1 -1
View File
@@ -41,7 +41,7 @@ type AgentLogOptions struct {
type agentLogKey struct{}
// AgentLog tells steps as a battle log, the newest typed.
func AgentLog(c *ui.Context, text, agent string, steps []LogStep, o AgentLogOptions) *ui.Element {
func AgentLog(c *ui.Context, text, agent string, steps []LogStep, o AgentLogOptions) ui.Element {
k := pixel.K(c)
if agent == "" {
panic("agent: AgentLog has no agent")
+1 -1
View File
@@ -19,7 +19,7 @@ type AgentStatusOptions struct {
var halo = ring(17)
// AgentStatus rings a portrait: idle, working, blocked or done.
func AgentStatus(c *ui.Context, text string, s Status, o AgentStatusOptions) *ui.Element {
func AgentStatus(c *ui.Context, text string, s Status, o AgentStatusOptions) ui.Element {
k := pixel.K(c)
face := portrait("AgentStatus", o.Portrait)
word, slot := s.look(k)
+2 -2
View File
@@ -20,7 +20,7 @@ type ApprovalPromptOptions struct {
}
type ApprovalPromptResult struct {
Element *ui.Element
Element ui.Element
// Allowed or Denied is the answer given this frame.
Allowed, Denied bool
}
@@ -81,7 +81,7 @@ func ApprovalPrompt(c *ui.Context, text, command string, o ApprovalPromptOptions
}
// sprite is a 12-dot icon, unnamed, in ink.
func sprite(c *ui.Context, k pixel.Kit, sp *pixel.Sprite, ink pixel.Slot) *ui.Element {
func sprite(c *ui.Context, k pixel.Kit, sp *pixel.Sprite, ink pixel.Slot) ui.Element {
return ui.Box(c).Size(k.D(sp.W), k.D(sp.H)).Role(ui.RoleNone).Draw(func(p *ui.Painter, r ui.Rect) {
k.Canvas(p, r).Sprite(0, 0, sp, 0, ink, 1)
})
+1 -1
View File
@@ -26,7 +26,7 @@ type CheckpointsOptions struct {
}
type CheckpointsResult struct {
Element *ui.Element
Element ui.Element
// Restored is the checkpoint chosen this frame, else -1.
Restored int
}
+1 -1
View File
@@ -15,7 +15,7 @@ type CostCoinsOptions struct {
}
// CostCoins stacks cost as gold dollars, silver dimes, bronze cents.
func CostCoins(c *ui.Context, text string, cents int, o CostCoinsOptions) *ui.Element {
func CostCoins(c *ui.Context, text string, cents int, o CostCoinsOptions) ui.Element {
k := pixel.K(c)
if cents < 0 {
panic(fmt.Sprintf("agent: CostCoins of %d cents", cents))
+1 -1
View File
@@ -23,7 +23,7 @@ type DiffScrollOptions struct {
}
// DiffScroll unrolls a parchment of changed files, lines counted.
func DiffScroll(c *ui.Context, text string, files []FileDiff, o DiffScrollOptions) *ui.Element {
func DiffScroll(c *ui.Context, text string, files []FileDiff, o DiffScrollOptions) ui.Element {
k := pixel.K(c)
if len(files) == 0 {
panic("agent: DiffScroll has no files")
+1 -1
View File
@@ -18,7 +18,7 @@ type MemoryCrystalsOptions struct {
}
type MemoryCrystalsResult struct {
Element *ui.Element
Element ui.Element
// Picked is the crystal chosen this frame, else -1.
Picked int
}
+1 -1
View File
@@ -22,7 +22,7 @@ type ModelSelectOptions struct {
}
type ModelSelectResult struct {
Element *ui.Element
Element ui.Element
Changed bool
}
+1 -1
View File
@@ -22,7 +22,7 @@ type PlanQuestOptions struct {
}
// PlanQuest shows a plan's steps as quest objectives.
func PlanQuest(c *ui.Context, title string, steps []PlanStep, o PlanQuestOptions) *ui.Element {
func PlanQuest(c *ui.Context, title string, steps []PlanStep, o PlanQuestOptions) ui.Element {
k := pixel.K(c)
if title == "" || len(steps) == 0 {
panic(fmt.Sprintf("agent: PlanQuest %q has %d steps", title, len(steps)))
+1 -1
View File
@@ -20,7 +20,7 @@ type PromptBoxOptions struct {
}
type PromptBoxResult struct {
Element *ui.Element
Element ui.Element
Changed bool
// Cast is the prompt cast this frame, else empty.
Cast string
+1 -1
View File
@@ -30,7 +30,7 @@ type partyRow struct {
}
// SubAgentParty draws the summoning tree, each agent with its status.
func SubAgentParty(c *ui.Context, text string, party []Member, o SubAgentPartyOptions) *ui.Element {
func SubAgentParty(c *ui.Context, text string, party []Member, o SubAgentPartyOptions) ui.Element {
k := pixel.K(c)
w := pixel.Or("SubAgentParty Width", o.Width, 200)
var rows []partyRow
+1 -1
View File
@@ -24,7 +24,7 @@ var (
)
// ThinkingOrb is a crystal ball that swirls while thinking.
func ThinkingOrb(c *ui.Context, text string, thinking bool, o ThinkingOrbOptions) *ui.Element {
func ThinkingOrb(c *ui.Context, text string, thinking bool, o ThinkingOrbOptions) ui.Element {
k := pixel.K(c)
word := k.Msg("idle")
if thinking {
+1 -1
View File
@@ -14,7 +14,7 @@ type TokenManaOptions struct {
}
// TokenMana shows a token budget's remainder as MP.
func TokenMana(c *ui.Context, text string, used, budget int, o TokenManaOptions) *ui.Element {
func TokenMana(c *ui.Context, text string, used, budget int, o TokenManaOptions) ui.Element {
k := pixel.K(c)
if used < 0 || budget < 1 {
panic(fmt.Sprintf("agent: TokenMana %d of %d", used, budget))
+1 -1
View File
@@ -28,7 +28,7 @@ type ToolCallOptions struct {
var glow = []pixel.Slot{pixel.Magic, pixel.Info, pixel.Accent}
// ToolCall is a spell card: CAST, then OK or FAILED.
func ToolCall(c *ui.Context, tool string, out Outcome, o ToolCallOptions) *ui.Element {
func ToolCall(c *ui.Context, tool string, out Outcome, o ToolCallOptions) ui.Element {
k := pixel.K(c)
if tool == "" || out < Casting || out > Failed {
panic(fmt.Sprintf("agent: ToolCall %q with outcome %d", tool, out))