[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79JYA52F3VS47ZN4GGP3259":3,"skill-same:01M79JYA52F3VS47ZN4GGP3259":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M79JYA52F3VS47ZN4GGP3259","tui-components",null,"Use when building or restyling strike's TUI — views, panels, modals, pickers, badges, dashboards, status rows, or any layout work in internal\u002Ffrontend\u002Ftui. Covers the internal\u002Ffrontend\u002Ftui\u002Fui component catalog and internal\u002Ffrontend\u002Ftui\u002Ftheme tokens. Do not use for backend\u002Fengine work (internal\u002Fengine, internal\u002Fprovider, internal\u002Ftool, internal\u002Fpermission, internal\u002Fpersist\u002Fsession, internal\u002Fproduct\u002Fauth, internal\u002Ffrontend\u002Fhost) — those packages have no UI surface.","jonathanung\u002Fstrike","jonathanung","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F53621118?v=4","01M79JX057ZT3VSF94GXQBDAXY","Jonathan Ung","01M79JX05QHGCWABW16WQN8DHV",5,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjonathanung\u002Fstrike\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftui-components\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tui-components\ndescription: Use when building or restyling strike's TUI — views, panels, modals, pickers, badges, dashboards, status rows, or any layout work in internal\u002Ffrontend\u002Ftui. Covers the internal\u002Ffrontend\u002Ftui\u002Fui component catalog and internal\u002Ffrontend\u002Ftui\u002Ftheme tokens. Do not use for backend\u002Fengine work (internal\u002Fengine, internal\u002Fprovider, internal\u002Ftool, internal\u002Fpermission, internal\u002Fpersist\u002Fsession, internal\u002Fproduct\u002Fauth, internal\u002Ffrontend\u002Fhost) — those packages have no UI surface.\n---\n\n# TUI components (strike-cli)\n\n`internal\u002Ffrontend\u002Ftui\u002Ftheme` is the resolved token source and `internal\u002Ffrontend\u002Ftui\u002Fui` is the\ncomponent library. Root views compose completed theme styles and `ui`\ncomponents, then perform only structural operations (joining, allocation,\nselection, and layout). Keep this catalog synchronized with `internal\u002Ffrontend\u002Ftui\u002Fui`.\n\n## Boundaries\n\n- **Edit `internal\u002Ffrontend\u002Ftui\u002Fapp\u002F_src\u002F\u003Cgroup>\u002F` only** for package `tui`. Flattened\n  `internal\u002Ffrontend\u002Ftui\u002Fapp\u002F*.go` are gitignored and regenerated by\n  `go generate .\u002Finternal\u002Ffrontend\u002Ftui\u002Fapp` \u002F make \u002F CI — edits there are silently lost.\n  Real packages `theme`, `ui`, `term`, `common` are edited in place.\n- `internal\u002Ffrontend\u002Ftui\u002F...` may import only `internal\u002Fprotocol`, `internal\u002Ffrontend\u002Fhost`,\n  `internal\u002Ffrontend\u002Ftui\u002F...`, stdlib, and third-party packages. The boundary test\n  enforces this. Kit packages (`ui`, `theme`, `common`, `term`) must not\n  import protocol or host. Charm modules: v1 `github.com\u002Fcharmbracelet\u002F…` or v2\n  `charm.land\u002F…` — never `github.com\u002Fcharmbracelet\u002F…\u002Fv2`.\n- `internal\u002Ffrontend\u002Ftui\u002Fui` may import only stdlib, lipgloss, bubbles,\n  `charmbracelet\u002Fx\u002Fansi`, and `internal\u002Ffrontend\u002Ftui\u002Ftheme`; components do not import\n  the app model or handle `tea.Msg`. The Strike wordmark lives in the app.\n- Resolve a supplied theme before reading tokens: `th = th.Resolve()`. Colors,\n  glyphs, borders, spacing, and emphasis come only from that resolved theme.\n  Never put literal colors, visual glyphs, border\u002Fspacing values, or visual\n  modifiers in a root view. A `ui` visual-modifier argument must trace to a\n  resolved theme value; manually review unknown or interprocedural origins.\n- Components are pure renderers: exported rendering functions take a\n  `theme.Theme` and options and return a string. State and key handling remain\n  in `internal\u002Ffrontend\u002Ftui\u002Fapp` model files.\n\n## Component catalog\n\n`Tone` is `ToneDefault`, `ToneAccent`, `ToneAccentAlt`, `ToneSuccess`,\n`ToneWarning`, `ToneError`, `ToneDanger`, or `ToneMuted`. `Level` is\n`LevelInfo`, `LevelSuccess`, `LevelWarning`, or `LevelError`.\n\n| Component | Exact signature | Use |\n|---|---|---|\n| Panel | `Panel(th theme.Theme, opts PanelOpts, body string) string` | Width-safe framed tile. `PanelOpts` has `Title`, `Footer`, mandatory `Width`, optional `Height`, `Focused`, `Dim`, `Tone`, and `Borderless`. Default chrome is **bordered** (outline only, square `┌┐└┘`). Focused bordered panes: `BorderFocus` outline, no title-edge wash, no FocusBar. Soft (`chrome: soft`) keeps surface-filled body + rounded `╭╮╰╯`; focused soft panes: body stays `Surface`, title edge uses `SurfaceFocus`, outline uses `BorderFocus`. Solid chrome keeps title-edge `SurfaceFocus` + thin FocusBar. Never a full-panel wash. `TextSelection` is a separate role. Tone dialogs keep elevated `SurfaceFocus` body. Soft degrades below width 6. `Borderless` omits chrome. |\n| Panel geometry | `InnerWidth(width int) int`; `PanelInnerWidth(th theme.Theme, width int) int`; `PanelInnerHeight(width, height int) int`; `PanelInnerHeightFor(th, width, height int) int`; `PanelContentOrigin(th theme.Theme, width int) (x, y int)` | Body dimensions and content-cell origin under chrome. Themed callers must use `PanelInnerWidth`; `InnerWidth` is default-theme compatibility only. `PanelInnerHeight` uses default bordered chrome; use `PanelInnerHeightFor` for non-default themes. |\n| Dialog | `Dialog(th theme.Theme, opts DialogOpts, body string) string` | Focused Panel with a muted final hint. `DialogOpts`: `Title`, `Hint`, `Width`, `Height`, `Tone`. Body lines longer than inner width are word-wrapped (idempotent if already wrapped). |\n| Badge | `Badge(th theme.Theme, tone Tone, text string) string` | Soft pill: tone label on `SurfaceMuted` with XS pad. Stock delimiters empty; themes may set `Icons.BadgeLeft`\u002F`BadgeRight`. |\n| KeyHints | `KeyHints(th theme.Theme, width int, hints []KeyHint) string` | Width-safe footer hints. `KeyHint` has `Key`, `Label`. |\n| StatusBar | `StatusBar(th theme.Theme, width int, left, right string) string` | One exactly-width row with left\u002Fright content. |\n| List | `List(th theme.Theme, opts ListOpts) string` | Unframed picker body. `ListOpts`: `Items []ListItem`, `Cursor`, `Width`, `Visible`, `Wrap` (word-wrap labels\u002Fdetails instead of ellipsis; use for question options), `ShowFilter`, `Filter`, `Total`, `Empty`; `ListItem`: `Label`, `Detail`, `Current`, `Disabled`. |\n| Tree | `Tree(th theme.Theme, opts TreeOpts) string` | Unframed expand\u002Fcollapse tree body. `TreeOpts`: `Nodes []TreeNode`, `Cursor`, `Width`, `Visible`, `Empty`; `TreeNode`: `ID`, `Label`, `Detail`, `Children`, `Expanded`, `Lazy`, `Leaf`, `Disabled`, `Current`, `Tone`. Helpers: `FlattenTree`, `TreeNodeAt`, `TreeToggleExpanded`. Indent uses `Spacing.SM`; expand glyphs are `Icons.TreeExpanded` \u002F `TreeCollapsed`. |\n| Notice | `Notice(th theme.Theme, level Level, text string, width int) string` | One-line, level-colored feedback. |\n| Bento | `Bento(th theme.Theme, width int, cards []Card) string` | Card packer. `Card` has `Title`, `Footer`, `Body`, `Width`, optional `Height`, `Tone`, `Focused`, `Dim`; body wraps to `PanelInnerWidth(th, Width)`. Bento derives its inter-card gap from resolved `th.Spacing.SM`. |\n| Overlay | `OverlayCenter(th theme.Theme, bg, fg string, width, height int) string`; `Scrim(th theme.Theme, s string) string`; `ModalWidth(screenWidth int) int` | ANSI-aware centered overlay: scrims bg via `OverlayScrim`, pads every bg row to exact width (no bright spill strip), keeps fg sharp. Standalone `Scrim`; dialog width `min(72, screenWidth-4)`. `OverlayTopRight(th theme.Theme, bg, fg string, width int) string` splices a small chip (e.g. a `Badge` toast) into the top-right rows with an `XS` right margin, no scrim; no-op when fg is empty or wider than the screen. |\n| Canvas | `Canvas(th theme.Theme, width, height int, body string) string` | Final full-screen fit operation and owner of the application background. |\n| DiffPreview | `DiffPreview(th theme.Theme, opts DiffPreviewOpts) string` | Unified +\u002F-\u002Fcontext diff block with LCS multi-hunk matching, line-number gutter (auto when width ≥ 16; `NoLineNumbers` to disable), SurfaceMuted wash on add\u002Fremove rows, bold word-diff on paired replaces (`NoWordDiff` to disable), and `Offset` scroll window. `DiffPreviewOpts`: `Path`, `Old`, `New`, `MaxLines` (hunk body; ≤0 → 12), mandatory `Width` (≤0 → \"\"), `ShowStats`, `MoreHint`, `Offset`, `NoLineNumbers`, `NoWordDiff`. Header (path and\u002For +N\u002F−M) does not consume `MaxLines`; overflow ends with a muted ellipsis more-lines row. Helpers: `DiffBodyLen`, `DiffExceeds`, `DiffMaxOffset`. |\n| Meter | `Meter(th theme.Theme, width int, ratio float64) string` | Fixed-width ratio bar. Negative ratio = unknown hollow (MeterEmpty). |\n| Sparkline | `Sparkline(th theme.Theme, width int, samples []float64) string` | Fixed-width activity chart from non-negative samples. Empty\u002Funknown series draws hollow MeterEmpty row; glyphs from `Icons.Sparkline`. |\n| FormatTokens | `FormatTokens(n int) string` | Compact token count for chrome (`1.5k`, `2M`). |\n\nDialog word-wraps body lines to `PanelInnerWidth`; Panel still truncates any\nover-long line as a safety net. Prefer pre-wrapping free text for clarity.\n`List` truncates by default; set `Wrap: true` for multi-line option bodies\n(question modal). `Card` wraps its own body. Size panel-backed child windows\nwith `ui.PanelInnerHeight` \u002F `PanelInnerHeightFor` rather than unconditionally\nsubtracting border rows, so unbordered narrow panels retain their full height.\n\n## Theme tokens\n\n`Theme.Resolve` fills every unset role from `theme.Default()`. It preserves\nonly `theme.NoBackground()` as the explicit transparent-background choice;\notherwise `Background` resolves to a solid `lipgloss.TerminalColor`.\n\n| Token | Role |\n|---|---|\n| `Text`, `TextMuted` | primary and secondary foreground |\n| `OverlayScrim` | de-emphasized modal background (scrim) fill |\n| `Accent`, `AccentAlt`, `Highlight` | primary, secondary, and selected emphasis |\n| `Success`, `Warning`, `Error`, `Danger` | semantic state colors |\n| `Background` | application background (`lipgloss.TerminalColor`) |\n| `Surface`, `SurfaceFocus`, `SurfaceMuted` | panel fills: body default \u002F title-edge focus (and tone dialogs) \u002F dim |\n| `Border`, `BorderFocus`, `BorderMuted` | soft\u002Fbordered frame colors |\n| `UserLabel`, `ToolLabel`, `DiffAdded`, `DiffRemoved` | transcript and diff roles |\n| `Chrome` | `ChromeBordered` (default, square `┌┐└┘`), `ChromeSolid`, or `ChromeSoft` (opt-in rounded) |\n| `BorderStyle` | soft\u002Fbordered panel border weight and six glyphs |\n| `Spacing` | `None`, `XS`, `SM`, `MD`, `LG` layout gaps; left\\|right pane gutter uses `XS` (keeps 93-col split); bento\u002Fwelcome card gaps use `SM`; `Label` is the gap between a numbered permission-choice shortcut (for example, `1)`) and its label, defaulting to `1` when resolved |\n| `Icons` | glyph set below |\n| `AgentState` | runtime status coloring via `Theme.AgentStateColor` \u002F `AgentStateStyle` (not a palette field) |\n\n`Icons` fields are `Prompt`, `Assistant`, `Tool`, `OK`, `Err`, `Info`,\n`Agent`, `Bolt`, `Dot`, `Cursor`, `InputCursor`, `FilterCursor`, `ToolGuide`,\n`FocusBar`,\n`BadgeLeft`, `BadgeRight`, `DetailSeparator`, `Ellipsis`, `LogoTopRule`,\n`LogoBottomRule`, `MeterFill`, `MeterEmpty`, `TreeExpanded`,\n`TreeCollapsed`, `CheckboxOn` (`[x]`), `CheckboxOff` (`[ ]`), and `Sparkline`\n(low→high bar runes). Stock badge delimiters are empty (soft pills). Use\n`th.Icons`, never the literal glyph.\n\n`theme.AgentState` is the live session\u002Fagent status vocabulary for dynamic\ncoloring: `Ready` → `Success`, `Working` → `AccentAlt`, `Attention` →\n`Warning`, `Error` → `Error`, and reserved `Dead` → `TextMuted` (unmapped by\nreducers until dead-session lifecycle exists). Use\n`th.AgentStateColor`\u002F`AgentStateStyle`\u002F`AgentStateStrongStyle`; never hardcode\nstate colors in views. `Spinner` uses the working token (`AccentAlt`).\n\n`th.S()` returns semantic styles: `Text`, `Muted`, `Accent`, `AccentAlt`,\n`Title`, `Success`, `Warning`, `Error`, `Danger`; their `*Strong` variants;\n`Selected`, `SelectedUnderline`; `UserLabel`, `AssistantLabel`, `ToolLabel`;\n`Input`, `InputPrompt`, `InputPlaceholder`, `InputCursor`, `Spinner`;\n`Border`, `BorderFocus`, `BorderMuted`; `DiffAdded`, `DiffRemoved`,\n`DiffAddedStrong`, `DiffRemovedStrong` (bold word-diff spans); and\n`DiffAddedLine`, `DiffRemovedLine` (role FG on `SurfaceMuted` wash). Call\nit once per render and reuse it.\n\n`BorderStyle` selects `BorderWeightUnset`, `BorderWeightLight`, or\n`BorderWeightHeavy`; resolving selects the matching preset and fills invalid\nor missing one-cell glyphs. `NewSpacing(xs, sm, md, lg) Spacing` initializes\n`XS`, `SM`, `MD`, and `LG`, including explicit zero values. It does not\ninitialize `Label`, so `Theme.Resolve` supplies the default `Label` value of\n`1`. `WithXS(v int) Spacing`, `WithSM(v int) Spacing`, `WithMD(v int) Spacing`,\n`WithLG(v int) Spacing`, and `WithLabel(v int) Spacing` set their respective\ntoken and preserve an explicit zero. Literal nonzero fields, including\n`Label`, are inferred as set; use the constructor or corresponding `With`\nmethod when an explicit zero must be preserved.\n\nConfigure Bubble widgets from the resolved foreground\u002Fcursor\u002Fspinner styles\nand glyphs, without setting widget backgrounds. `ui.Canvas` owns background\npainting after root views and overlays compose, filling every cell unless the\ntheme explicitly uses `theme.NoBackground()`.\n\n## Recipes\n\n```go\nbody := ui.List(th, ui.ListOpts{\n    Items: items, Cursor: m.cursor,\n    Width: max(1, ui.PanelInnerWidth(th, width)),\n    Visible: providerModalVisible, Empty: \"no providers configured\",\n})\nreturn ui.Dialog(th, ui.DialogOpts{Title: \"Select provider\", Width: width}, body)\n```\n\nThe empty-transcript dashboard is app composition, not a component API. Its\nheader owns the compact brand; the dashboard directly allocates fixed-height\n`Panel` cards (bordered chrome by default), with one or two columns according to\navailable width. It has no outer welcome panel or logo card. The `keys` card is\nalways present; `get started` is present only when no provider is selected or\nthe selected provider is unauthenticated; `agents & skills` requires at least\none valid configured agent or skill; and `recent prompts` requires history.\nPreserve those conditions and the short-view fallback when changing the\ndashboard, without exposing app-private helpers as component recipes.\n\n## Extending and verification\n\nAdd a component under `internal\u002Ffrontend\u002Ftui\u002Fui`, make it width-safe and zero-value\ntolerant, document it, add its production-appropriate coverage, and update\nthis catalog in the same change. New colors, glyphs, borders, spacing, and\nemphasis belong in `theme`.\n\n```sh\ngo test .\u002Finternal\u002Ffrontend\u002Ftui\u002F... -count=1\nmake test\n```\n\nFor visual review, the opt-in gallery renders parameterized scenarios rather\nthan every view at both 80×24 and 120×40. Its current matrix is: 80×24 left\ndashboard and right context; 93×40 canonical split; 92×60 left-only; 120×40\nsplit; 120×80 cycle, permission modal, provider picker, command palette, and\nbusy transcript; and 160×45 long-data\u002Fstatus and danger-modal cases:\n\n```sh\nSTRIKE_GALLERY=1 go test .\u002Finternal\u002Ffrontend\u002Ftui\u002Fapp\u002F -run Gallery -count=1 -v\n```\n\nReview the constrained 80×24 dashboard, split and modal scenarios, and the\nlong-data cases appropriate to the change.\n","# TUI components (strike-cli)\n\n`internal\u002Ffrontend\u002Ftui\u002Ftheme` is the resolved token source and `internal\u002Ffrontend\u002Ftui\u002Fui` is the\ncomponent library. Root views compose completed theme styles and `ui`\ncomponents, then perform only structural operations (joining, allocation,\nselection, and layout). Keep this catalog synchronized with `internal\u002Ffrontend\u002Ftui\u002Fui`.\n\n## Boundaries\n\n- **Edit `internal\u002Ffrontend\u002Ftui\u002Fapp\u002F_src\u002F\u003Cgroup>\u002F` only** for package `tui`. Flattened\n  `internal\u002Ffrontend\u002Ftui\u002Fapp\u002F*.go` are gitignored and regenerated by\n  `go generate .\u002Finternal\u002Ffrontend\u002Ftui\u002Fapp` \u002F make \u002F CI — edits there are silently lost.\n  Real packages `theme`, `ui`, `term`, `common` are edited in place.\n- `internal\u002Ffrontend\u002Ftui\u002F...` may import only `internal\u002Fprotocol`, `internal\u002Ffrontend\u002Fhost`,\n  `internal\u002Ffrontend\u002Ftui\u002F...`, stdlib, and third-party packages. The boundary test\n  enforces this. Kit packages (`ui`, `theme`, `common`, `term`) must not\n  import protocol or host. Charm modules: v1 `github.com\u002Fcharmbracelet\u002F…` or v2\n  `charm.land\u002F…` — never `github.com\u002Fcharmbracelet\u002F…\u002Fv2`.\n- `internal\u002Ffrontend\u002Ftui\u002Fui` may import only stdlib, lipgloss, bubbles,\n  `charmbracelet\u002Fx\u002Fansi`, and `internal\u002Ffrontend\u002Ftui\u002Ftheme`; components do not import\n  the app model or handle `tea.Msg`. The Strike wordmark lives in the app.\n- Resolve a supplied theme before reading tokens: `th = th.Resolve()`. Colors,\n  glyphs, borders, spacing, and emphasis come only from that resolved theme.\n  Never put literal colors, visual glyphs, border\u002Fspacing values, or visual\n  modifiers in a root view. A `ui` visual-modifier argument must trace to a\n  resolved theme value; manually review unknown or interprocedural origins.\n- Components are pure renderers: exported rendering functions take a\n  `theme.Theme` and options and return a string. State and key handling remain\n  in `internal\u002Ffrontend\u002Ftui\u002Fapp` model files.\n\n## Component catalog\n\n`Tone` is `ToneDefault`, `ToneAccent`, `ToneAccentAlt`, `ToneSuccess`,\n`ToneWarning`, `ToneError`, `ToneDanger`, or `ToneMuted`. `Level` is\n`LevelInfo`, `LevelSuccess`, `LevelWarning`, or `LevelError`.\n\n| Component | Exact signature | Use |\n|---|---|---|\n| Panel | `Panel(th theme.Theme, opts PanelOpts, body string) string` | Width-safe framed tile. `PanelOpts` has `Title`, `Footer`, mandatory `Width`, optional `Height`, `Focused`, `Dim`, `Tone`, and `Borderless`. Default chrome is **bordered** (outline only, square `┌┐└┘`). Focused bordered panes: `BorderFocus` outline, no title-edge wash, no FocusBar. Soft (`chrome: soft`) keeps surface-filled body + rounded `╭╮╰╯`; focused soft panes: body stays `Surface`, title edge uses `SurfaceFocus`, outline uses `BorderFocus`. Solid chrome keeps title-edge `SurfaceFocus` + thin FocusBar. Never a full-panel wash. `TextSelection` is a separate role. Tone dialogs keep elevated `SurfaceFocus` body. Soft degrades below width 6. `Borderless` omits chrome. |\n| Panel geometry | `InnerWidth(width int) int`; `PanelInnerWidth(th theme.Theme, width int) int`; `PanelInnerHeight(width, height int) int`; `PanelInnerHeightFor(th, width, height int) int`; `PanelContentOrigin(th theme.Theme, width int) (x, y int)` | Body dimensions and content-cell origin under chrome. Themed callers must use `PanelInnerWidth`; `InnerWidth` is default-theme compatibility only. `PanelInnerHeight` uses default bordered chrome; use `PanelInnerHeightFor` for non-default themes. |\n| Dialog | `Dialog(th theme.Theme, opts DialogOpts, body string) string` | Focused Panel with a muted final hint. `DialogOpts`: `Title`, `Hint`, `Width`, `Height`, `Tone`. Body lines longer than inner width are word-wrapped (idempotent if already wrapped). |\n| Badge | `Badge(th theme.Theme, tone Tone, text string) string` | Soft pill: tone label on `SurfaceMuted` with XS pad. Stock delimiters empty; themes may set `Icons.BadgeLeft`\u002F`BadgeRight`. |\n| KeyHints | `KeyHints(th theme.Theme, width int, hints []KeyHint) string` | Width-safe footer hints. `KeyHint` has `Key`, `Label`. |\n| StatusBar | `StatusBar(th theme.Theme, width int, left, right string) string` | One exactly-width row with left\u002Fright content. |\n| List | `List(th theme.Theme, opts ListOpts) string` | Unframed picker body. `ListOpts`: `Items []ListItem`, `Cursor`, `Width`, `Visible`, `Wrap` (word-wrap labels\u002Fdetails instead of ellipsis; use for question options), `ShowFilter`, `Filter`, `Total`, `Empty`; `ListItem`: `Label`, `Detail`, `Current`, `Disabled`. |\n| Tree | `Tree(th theme.Theme, opts TreeOpts) string` | Unframed expand\u002Fcollapse tree body. `TreeOpts`: `Nodes []TreeNode`, `Cursor`, `Width`, `Visible`, `Empty`; `TreeNode`: `ID`, `Label`, `Detail`, `Children`, `Expanded`, `Lazy`, `Leaf`, `Disabled`, `Current`, `Tone`. Helpers: `FlattenTree`, `TreeNodeAt`, `TreeToggleExpanded`. Indent uses `Spacing.SM`; expand glyphs are `Icons.TreeExpanded` \u002F `TreeCollapsed`. |\n| Notice | `Notice(th theme.Theme, level Level, text string, width int) string` | One-line, level-colored feedback. |\n| Bento | `Bento(th theme.Theme, width int, cards []Card) string` | Card packer. `Card` has `Title`, `Footer`, `Body`, `Width`, optional `Height`, `Tone`, `Focused`, `Dim`; body wraps to `PanelInnerWidth(th, Width)`. Bento derives its inter-card gap from resolved `th.Spacing.SM`. |\n| Overlay | `OverlayCenter(th theme.Theme, bg, fg string, width, height int) string`; `Scrim(th theme.Theme, s string) string`; `ModalWidth(screenWidth int) int` | ANSI-aware centered overlay: scrims bg via `OverlayScrim`, pads every bg row to exact width (no bright spill strip), keeps fg sharp. Standalone `Scrim`; dialog width `min(72, screenWidth-4)`. `OverlayTopRight(th theme.Theme, bg, fg string, width int) string` splices a small chip (e.g. a `Badge` toast) into the top-right rows with an `XS` right margin, no scrim; no-op when fg is empty or wider than the screen. |\n| Canvas | `Canvas(th theme.Theme, width, height int, body string) string` | Final full-screen fit operation and owner of the application background. |\n| DiffPreview | `DiffPreview(th theme.Theme, opts DiffPreviewOpts) string` | Unified +\u002F-\u002Fcontext diff block with LCS multi-hunk matching, line-number gutter (auto when width ≥ 16; `NoLineNumbers` to disable), SurfaceMuted wash on add\u002Fremove rows, bold word-diff on paired replaces (`NoWordDiff` to disable), and `Offset` scroll window. `DiffPreviewOpts`: `Path`, `Old`, `New`, `MaxLines` (hunk body; ≤0 → 12), mandatory `Width` (≤0 → \"\"), `ShowStats`, `MoreHint`, `Offset`, `NoLineNumbers`, `NoWordDiff`. Header (path and\u002For +N\u002F−M) does not consume `MaxLines`; overflow ends with a muted ellipsis more-lines row. Helpers: `DiffBodyLen`, `DiffExceeds`, `DiffMaxOffset`. |\n| Meter | `Meter(th theme.Theme, width int, ratio float64) string` | Fixed-width ratio bar. Negative ratio = unknown hollow (MeterEmpty). |\n| Sparkline | `Sparkline(th theme.Theme, width int, samples []float64) string` | Fixed-width activity chart from non-negative samples. Empty\u002Funknown series draws hollow MeterEmpty row; glyphs from `Icons.Sparkline`. |\n| FormatTokens | `FormatTokens(n int) string` | Compact token count for chrome (`1.5k`, `2M`). |\n\nDialog word-wraps body lines to `PanelInnerWidth`; Panel still truncates any\nover-long line as a safety net. Prefer pre-wrapping free text for clarity.\n`List` truncates by default; set `Wrap: true` for multi-line option bodies\n(question modal). `Card` wraps its own body. Size panel-backed child windows\nwith `ui.PanelInnerHeight` \u002F `PanelInnerHeightFor` rather than unconditionally\nsubtracting border rows, so unbordered narrow panels retain their full height.\n\n## Theme tokens\n\n`Theme.Resolve` fills every unset role from `theme.Default()`. It preserves\nonly `theme.NoBackground()` as the explicit transparent-background choice;\notherwise `Background` resolves to a solid `lipgloss.TerminalColor`.\n\n| Token | Role |\n|---|---|\n| `Text`, `TextMuted` | primary and secondary foreground |\n| `OverlayScrim` | de-emphasized modal background (scrim) fill |\n| `Accent`, `AccentAlt`, `Highlight` | primary, secondary, and selected emphasis |\n| `Success`, `Warning`, `Error`, `Danger` | semantic state colors |\n| `Background` | application background (`lipgloss.TerminalColor`) |\n| `Surface`, `SurfaceFocus`, `SurfaceMuted` | panel fills: body default \u002F title-edge focus (and tone dialogs) \u002F dim |\n| `Border`, `BorderFocus`, `BorderMuted` | soft\u002Fbordered frame colors |\n| `UserLabel`, `ToolLabel`, `DiffAdded`, `DiffRemoved` | transcript and diff roles |\n| `Chrome` | `ChromeBordered` (default, square `┌┐└┘`), `ChromeSolid`, or `ChromeSoft` (opt-in rounded) |\n| `BorderStyle` | soft\u002Fbordered panel border weight and six glyphs |\n| `Spacing` | `None`, `XS`, `SM`, `MD`, `LG` layout gaps; left\\|right pane gutter uses `XS` (keeps 93-col split); bento\u002Fwelcome card gaps use `SM`; `Label` is the gap between a numbered permission-choice shortcut (for example, `1)`) and its label, defaulting to `1` when resolved |\n| `Icons` | glyph set below |\n| `AgentState` | runtime status coloring via `Theme.AgentStateColor` \u002F `AgentStateStyle` (not a palette field) |\n\n`Icons` fields are `Prompt`, `Assistant`, `Tool`, `OK`, `Err`, `Info`,\n`Agent`, `Bolt`, `Dot`, `Cursor`, `InputCursor`, `FilterCursor`, `ToolGuide`,\n`FocusBar`,\n`BadgeLeft`, `BadgeRight`, `DetailSeparator`, `Ellipsis`, `LogoTopRule`,\n`LogoBottomRule`, `MeterFill`, `MeterEmpty`, `TreeExpanded`,\n`TreeCollapsed`, `CheckboxOn` (`[x]`), `CheckboxOff` (`[ ]`), and `Sparkline`\n(low→high bar runes). Stock badge delimiters are empty (soft pills). Use\n`th.Icons`, never the literal glyph.\n\n`theme.AgentState` is the live session\u002Fagent status vocabulary for dynamic\ncoloring: `Ready` → `Success`, `Working` → `AccentAlt`, `Attention` →\n`Warning`, `Error` → `Error`, and reserved `Dead` → `TextMuted` (unmapped by\nreducers until dead-session lifecycle exists). Use\n`th.AgentStateColor`\u002F`AgentStateStyle`\u002F`AgentStateStrongStyle`; never hardcode\nstate colors in views. `Spinner` uses the working token (`AccentAlt`).\n\n`th.S()` returns semantic styles: `Text`, `Muted`, `Accent`, `AccentAlt`,\n`Title`, `Success`, `Warning`, `Error`, `Danger`; their `*Strong` variants;\n`Selected`, `SelectedUnderline`; `UserLabel`, `AssistantLabel`, `ToolLabel`;\n`Input`, `InputPrompt`, `InputPlaceholder`, `InputCursor`, `Spinner`;\n`Border`, `BorderFocus`, `BorderMuted`; `DiffAdded`, `DiffRemoved`,\n`DiffAddedStrong`, `DiffRemovedStrong` (bold word-diff spans); and\n`DiffAddedLine`, `DiffRemovedLine` (role FG on `SurfaceMuted` wash). Call\nit once per render and reuse it.\n\n`BorderStyle` selects `BorderWeightUnset`, `BorderWeightLight`, or\n`BorderWeightHeavy`; resolving selects the matching preset and fills invalid\nor missing one-cell glyphs. `NewSpacing(xs, sm, md, lg) Spacing` initializes\n`XS`, `SM`, `MD`, and `LG`, including explicit zero values. It does not\ninitialize `Label`, so `Theme.Resolve` supplies the default `Label` value of\n`1`. `WithXS(v int) Spacing`, `WithSM(v int) Spacing`, `WithMD(v int) Spacing`,\n`WithLG(v int) Spacing`, and `WithLabel(v int) Spacing` set their respective\ntoken and preserve an explicit zero. Literal nonzero fields, including\n`Label`, are inferred as set; use the constructor or corresponding `With`\nmethod when an explicit zero must be preserved.\n\nConfigure Bubble widgets from the resolved foreground\u002Fcursor\u002Fspinner styles\nand glyphs, without setting widget backgrounds. `ui.Canvas` owns background\npainting after root views and overlays compose, filling every cell unless the\ntheme explicitly uses `theme.NoBackground()`.\n\n## Recipes\n\n```go\nbody := ui.List(th, ui.ListOpts{\n    Items: items, Cursor: m.cursor,\n    Width: max(1, ui.PanelInnerWidth(th, width)),\n    Visible: providerModalVisible, Empty: \"no providers configured\",\n})\nreturn ui.Dialog(th, ui.DialogOpts{Title: \"Select provider\", Width: width}, body)\n```\n\nThe empty-transcript dashboard is app composition, not a component API. Its\nheader owns the compact brand; the dashboard directly allocates fixed-height\n`Panel` cards (bordered chrome by default), with one or two columns according to\navailable width. It has no outer welcome panel or logo card. The `keys` card is\nalways present; `get started` is present only when no provider is selected or\nthe selected provider is unauthenticated; `agents & skills` requires at least\none valid configured agent or skill; and `recent prompts` requires history.\nPreserve those conditions and the short-view fallback when changing the\ndashboard, without exposing app-private helpers as component recipes.\n\n## Extending and verification\n\nAdd a component under `internal\u002Ffrontend\u002Ftui\u002Fui`, make it width-safe and zero-value\ntolerant, document it, add its production-appropriate coverage, and update\nthis catalog in the same change. New colors, glyphs, borders, spacing, and\nemphasis belong in `theme`.\n\n```sh\ngo test .\u002Finternal\u002Ffrontend\u002Ftui\u002F... -count=1\nmake test\n```\n\nFor visual review, the opt-in gallery renders parameterized scenarios rather\nthan every view at both 80×24 and 120×40. Its current matrix is: 80×24 left\ndashboard and right context; 93×40 canonical split; 92×60 left-only; 120×40\nsplit; 120×80 cycle, permission modal, provider picker, command palette, and\nbusy transcript; and 160×45 long-data\u002Fstatus and danger-modal cases:\n\n```sh\nSTRIKE_GALLERY=1 go test .\u002Finternal\u002Ffrontend\u002Ftui\u002Fapp\u002F -run Gallery -count=1 -v\n```\n\nReview the constrained 80×24 dashboard, split and modal scenarios, and the\nlong-data cases appropriate to the change.\n",{"name":5,"description":7},"main","316d4e340263a8788b8153f4edf9fdaefdf8b2a7",".claude\u002Fskills\u002Ftui-components",2,"https:\u002F\u002Fgithub.com\u002Fjonathanung\u002Fstrike","https:\u002F\u002Fstrike.jonathanung.ca\u002F","https:\u002F\u002Fgithub.com\u002Fjonathanung","https:\u002F\u002Fjonathanung.ca","for fun programmer larping as a student","2026-11-14 19:25:31",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add jonathanung\u002Fstrike --skill tui-components",{"tool":40,"command":41},"bunx","bunx skills add jonathanung\u002Fstrike --skill tui-components",{"tool":43,"command":44},"pnpm","pnpm dlx skills add jonathanung\u002Fstrike --skill tui-components","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjonathanung\u002Fstrike\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftui-components\u002FSKILL.md",true,[],[49,56,63,70,77,83],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M79JZ3BTYJTXTH62TTMQTRSY","keep","Kept despite unknown fields","https:\u002F\u002Fgithub.com\u002Fjonathanung\u002Fstrike\u002Fblob\u002Fmain\u002Finternal\u002Fintegrate\u002Fplugin\u002Ftestdata\u002Faps\u002Funknown-fields\u002Fskills\u002Fkeep\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M79JYZBHM1ETESYN0P255ZQN","ok","Immediate skill","https:\u002F\u002Fgithub.com\u002Fjonathanung\u002Fstrike\u002Fblob\u002Fmain\u002Finternal\u002Fintegrate\u002Fplugin\u002Ftestdata\u002Faps\u002Fskills-layout\u002Fskills\u002Fok\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M79JYYFSHFEQJF8VNZ6CWAJ7","deep","Must not be discovered","https:\u002F\u002Fgithub.com\u002Fjonathanung\u002Fstrike\u002Fblob\u002Fmain\u002Finternal\u002Fintegrate\u002Fplugin\u002Ftestdata\u002Faps\u002Fskills-layout\u002Fskills\u002Fnested\u002Fdeep\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M79JYXN8XTSQ8P4E2EWAGE54","summarize","Summarize text","https:\u002F\u002Fgithub.com\u002Fjonathanung\u002Fstrike\u002Fblob\u002Fmain\u002Finternal\u002Fintegrate\u002Fplugin\u002Ftestdata\u002Faps\u002Fportable-ok\u002Fskills\u002Fsummarize\u002FSKILL.md",[],[],{"skillNo":78,"name":51,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M79JYWT8JKCZ6B255CTWVHTX","Survives MCP disable","https:\u002F\u002Fgithub.com\u002Fjonathanung\u002Fstrike\u002Fblob\u002Fmain\u002Finternal\u002Fintegrate\u002Fplugin\u002Ftestdata\u002Faps\u002Fmcp-schema-mismatch\u002Fskills\u002Fkeep\u002FSKILL.md",[],[],{"skillNo":84,"name":51,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M79JYTNMJS2GSKCQ9BWYWBKQ","Survives invalid mcp.json kind","https:\u002F\u002Fgithub.com\u002Fjonathanung\u002Fstrike\u002Fblob\u002Fmain\u002Finternal\u002Fintegrate\u002Fplugin\u002Ftestdata\u002Faps\u002Fmcp-not-file\u002Fskills\u002Fkeep\u002FSKILL.md",[],[]]