docs / cheatsheet
gru · cheatsheet · 0.8.0
Cheatsheet
Fingertip lookup for the public toolkit as shipped in v0.8.0
(40-scene catalog, LAYOUT, WebView occlusion howto).
Status ≠ ok is the gap backlog.
Canonical markdown: docs/CHEATSHEET.md (keep site and repo aligned).
Status legend
| Status | Meaning |
|---|---|
ok | Shipped with a usable demo and/or doc pointer |
demo-thin | Type exists; demo coverage weak or indirect |
doc-thin | Type/demo exist; narrative doc thin |
api-thin | Usable in code; godoc / api narrative thin |
missing | Need acknowledged; not in this release |
1. Commands
go get github.com/ledocorp/gru@v0.8.0
go run ./cmd/hello
go run -tags webview2 ./cmd/webviewhello
go run -tags grudemo .
go run ./cmd/gru new myapp
| Tag / flag | When |
|---|---|
grudemo | Curated 40-scene catalog |
webview2 | Live WebView2 host (Windows + Runtime) |
x11 | Linux hello path |
gru new --webview | Scaffold FillClient WebView app |
CLI: CLI.
2. Frame loop
DrainQueue
Update (title bar + Root)
Layout if Root dirty
Draw into SSAA if NeedsRedraw, else blit cache
Present + overlays
[WebView: sync hosts after Layout; present after EndDrawing]
Copy cmd/hello. Contracts:
Architecture ·
overview.md.
3. Intent index
| Intent | Use | See | Status |
|---|---|---|---|
| Minimal window + button | cmd/hello | hello | ok |
| Scaffold an app | gru new | CLI | ok |
| HTML pane in chrome | FillClient WebView | webviewhello · WebView demos | ok |
| Settings list row | ListTile in Panel/Card | Settings · Desktop | ok |
| Master / detail | Edge shell + list + detail | List Pane (Go) | ok |
| Desktop rail | CP-SHELL-DESKTOP | Desktop Shell (Go) | ok |
| AppBar + scroll | CP-SHELL-APPSHELL | App Shell (Go) | ok |
| Scrollable page + cards | CP-SHELL-PAGE / flex + Card | Form Demo · Card Nest | ok |
| 12-col grid | CP-SHELL-GRID | Responsive Grid | ok |
| Form fields | Form · inputs | Form Demo | ok |
| Modal | flat flex modal (not Viewport root) | Batch 1 | ok |
| Toast | toast APIs | Batch 7 | ok |
| Color well / picker | ColorWell · ColorPicker | Batch 18 · Batch 26 | ok |
| Height / scroll rules | intrinsic · fill · fixed | Layout | ok |
| Reactive counter | Signal + Button | Counter Demo | ok |
| Live WebView | -tags webview2 | WebView Module · Focus Handoff | ok |
| Inspect tree | F12 | any grudemo | ok |
Full intent table (every control): CHEATSHEET.md §3.
4. Capability matrices (summary)
Shells
| Symbol | Demo | Status |
|---|---|---|
CP-SHELL-PAGE | Form Demo | ok |
CP-SHELL-APPSHELL | App Shell (Go) | ok |
CP-SHELL-DESKTOP | Desktop Shell (Go) | ok |
CP-SHELL-EDGE | List Pane · Settings Desktop | ok |
CP-SHELL-GRID | Responsive Grid | ok |
Surfaces & core
| Symbol | Demo | Status |
|---|---|---|
Panel · Card · ListTile | List Pane · Card Nest · Batch 21 | ok |
Document · Signal · chrome | hello · Counter | ok |
SplitView | inside List Pane | demo-thin |
Controls (groups)
| Group | See | Status |
|---|---|---|
| Forms / dates / combo / spin | Form Demo · Batches 3, 11, 15, 16 | ok |
| Selection / slider / progress / color | Batches 12, 14, 18, 22–26 | ok |
| Overlays / nav widgets | Batches 1, 3b, 4, 7, 13, 17, 19 | ok |
| Data / search / filters | Batch 2, 3, 6 · Filters · Timeline | ok |
ColorWell · ColorPicker | Batch 18 · Batch 26 | ok |
WebView & tooling
| Symbol | See | Status |
|---|---|---|
webview2 · FillClient · WebViewPanel | WebView | ok |
| Modal occlusion howto | WebView · WEBVIEW.md | ok |
| Non-Windows live host | — | missing |
gru CLI · F12 · Demo Index | CLI · Demos | ok |
| CI cheatsheet drift check | — | missing |
Full per-type matrices: CHEATSHEET.md §4. Widget encyclopedia: Widgets.
5. Anti-patterns
- Do not invent a frame loop; copy
cmd/hello. - Do not use a
Viewportas a modal root. - Do not invent sidebar/list wrapper widgets; use
Panel/Card+ListTile. - Do not call
LayoutfromDraw. - Do not
SetStyle("transparent")onListTileto fake nesting. - Do not assume WebView passthrough; occlude the HWND when overlays need hits.
- Do not forget
assets/fonts/must resolve at runtime. - Do not mix shell recipes casually; one shell ID per scene.
- Prefer
@v0.8.0until you mean to float.
6. Keys and env
| Key / env | Action |
|---|---|
| Tab | Next grudemo scene |
| F12 | Widget Inspector |
| F11 | Perf overlay (optional) |
| Footer Scenes | Open Demo Index |
| Shift+F11 | WebView stderr traces (when debug on) |
GRU_WEBVIEW_DEBUG=1 | WebView debug |
Triage (v0.8.0)
Closed in this release:
| Item | Was | Now |
|---|---|---|
| WebView modal occlusion howto | doc-thin | ok (WEBVIEW.md) |
| ColorWell / ColorPicker / Dropdown / RadioGroup / Breadcrumbs demos | demo-thin | ok (public catalog) |
| Slim layout contracts | internal-only | ok (Layout) |
Still accepted later (not blockers):
| Item | Status | Note |
|---|---|---|
SplitView standalone demo | demo-thin | Covered inside List Pane |
| FilePicker dedicated scene | deferred | Path UX under review |
| Non-Windows live WebView | missing | Windows-only host for now |
| Automated drift check | missing | Nice-to-have |
Next: Start · Composition · Demos