From e65f7e2708274f88277691485dc3d2e2728e2cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 5 Oct 2026 13:50:55 -0400 Subject: [PATCH] AGENTS: result Element field and shared helpers --- AGENTS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 4995ed1..c1f959a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -31,6 +31,8 @@ testdata/snapshots/ /-.png ## Component rules - Signature: `func Name(c *ui.Context, value *T, opts NameOptions) *ui.Element`. Composites may return a named struct. +- Result structs expose the element as a named field `Element *ui.Element`, never embedded; element plus changed is `ChoiceResult`. +- Shared helpers: `iconAction` (borderless icon button), `overlayStyle(c, panel, overlayEnter(c, panel))` (popup surface and entry fade), `internal.RuleDiamond` / `internal.Frame` (ornaments), `colorFade` (state color transition). - Zero `Options` gives the default look. No `map[string]any` config. - Explicit font sizes: `FontSize(c, theme.CaptionSize)`; it applies the desktop text scale. - Colors: `k := mujica.Tokens(c)`. Metrics: `theme.*` consts and `Density(c).Unit()` / `.ControlHeight()`.