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

StatusMeaning
okShipped with a usable demo and/or doc pointer
demo-thinType exists; demo coverage weak or indirect
doc-thinType/demo exist; narrative doc thin
api-thinUsable in code; godoc / api narrative thin
missingNeed 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 / flagWhen
grudemoCurated 40-scene catalog
webview2Live WebView2 host (Windows + Runtime)
x11Linux hello path
gru new --webviewScaffold 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

IntentUseSeeStatus
Minimal window + buttoncmd/hellohellook
Scaffold an appgru newCLIok
HTML pane in chromeFillClient WebViewwebviewhello · WebView demosok
Settings list rowListTile in Panel/CardSettings · Desktopok
Master / detailEdge shell + list + detailList Pane (Go)ok
Desktop railCP-SHELL-DESKTOPDesktop Shell (Go)ok
AppBar + scrollCP-SHELL-APPSHELLApp Shell (Go)ok
Scrollable page + cardsCP-SHELL-PAGE / flex + CardForm Demo · Card Nestok
12-col gridCP-SHELL-GRIDResponsive Gridok
Form fieldsForm · inputsForm Demook
Modalflat flex modal (not Viewport root)Batch 1ok
Toasttoast APIsBatch 7ok
Color well / pickerColorWell · ColorPickerBatch 18 · Batch 26ok
Height / scroll rulesintrinsic · fill · fixedLayoutok
Reactive counterSignal + ButtonCounter Demook
Live WebView-tags webview2WebView Module · Focus Handoffok
Inspect treeF12any grudemook

Full intent table (every control): CHEATSHEET.md §3.

4. Capability matrices (summary)

Shells

SymbolDemoStatus
CP-SHELL-PAGEForm Demook
CP-SHELL-APPSHELLApp Shell (Go)ok
CP-SHELL-DESKTOPDesktop Shell (Go)ok
CP-SHELL-EDGEList Pane · Settings Desktopok
CP-SHELL-GRIDResponsive Gridok

Surfaces & core

SymbolDemoStatus
Panel · Card · ListTileList Pane · Card Nest · Batch 21ok
Document · Signal · chromehello · Counterok
SplitViewinside List Panedemo-thin

Controls (groups)

GroupSeeStatus
Forms / dates / combo / spinForm Demo · Batches 3, 11, 15, 16ok
Selection / slider / progress / colorBatches 12, 14, 18, 22–26ok
Overlays / nav widgetsBatches 1, 3b, 4, 7, 13, 17, 19ok
Data / search / filtersBatch 2, 3, 6 · Filters · Timelineok
ColorWell · ColorPickerBatch 18 · Batch 26ok

WebView & tooling

SymbolSeeStatus
webview2 · FillClient · WebViewPanelWebViewok
Modal occlusion howtoWebView · WEBVIEW.mdok
Non-Windows live host—missing
gru CLI · F12 · Demo IndexCLI · Demosok
CI cheatsheet drift check—missing

Full per-type matrices: CHEATSHEET.md §4. Widget encyclopedia: Widgets.

5. Anti-patterns

  1. Do not invent a frame loop; copy cmd/hello.
  2. Do not use a Viewport as a modal root.
  3. Do not invent sidebar/list wrapper widgets; use Panel/Card + ListTile.
  4. Do not call Layout from Draw.
  5. Do not SetStyle("transparent") on ListTile to fake nesting.
  6. Do not assume WebView passthrough; occlude the HWND when overlays need hits.
  7. Do not forget assets/fonts/ must resolve at runtime.
  8. Do not mix shell recipes casually; one shell ID per scene.
  9. Prefer @v0.8.0 until you mean to float.

6. Keys and env

Key / envAction
TabNext grudemo scene
F12Widget Inspector
F11Perf overlay (optional)
Footer ScenesOpen Demo Index
Shift+F11WebView stderr traces (when debug on)
GRU_WEBVIEW_DEBUG=1WebView debug

Triage (v0.8.0)

Closed in this release:

ItemWasNow
WebView modal occlusion howtodoc-thinok (WEBVIEW.md)
ColorWell / ColorPicker / Dropdown / RadioGroup / Breadcrumbs demosdemo-thinok (public catalog)
Slim layout contractsinternal-onlyok (Layout)

Still accepted later (not blockers):

ItemStatusNote
SplitView standalone demodemo-thinCovered inside List Pane
FilePicker dedicated scenedeferredPath UX under review
Non-Windows live WebViewmissingWindows-only host for now
Automated drift checkmissingNice-to-have

Next: Start · Composition · Demos