Skip to content

docs(ai-primer): document four high-value v2 gotchas agents miss - #5530

Merged
tig merged 1 commit into
developfrom
docs/agent-guidance-gotchas
Jun 23, 2026
Merged

tig merged 1 commit into
developfrom
docs/agent-guidance-gotchas

Conversation

@tig

@tig tig commented Jun 23, 2026

Copy link
Copy Markdown
Member

First, safe slice of #5525. Adds the verified, high-frequency gotchas to ai-v2-primer.md's Gotchas → API Correctness list — the ones agents get wrong even once they know it's v2, and which the primer didn't cover:

  1. Dialog/MessageBox button order = the default — last button added is the default; order Cancel … OK; don't hand-set IsDefault. (Views/Dialog.cs, Views/MessageBox.cs)
  2. AddCommand is protected — register inside the View, bind via KeyBindings. (ViewBase/View.Command.cs)
  3. Terminal.Gui.Drawing.Attribute collides with System.Attribute. (Drawing/Attribute.cs)
  4. Typed views expose .Value via IValue<T>, not .Date/.Color. (Views/DatePicker.cs)

All inline prose (no fenced snippets), so validate-doc-snippets is unaffected. Each verified against current develop source.

Remaining #5525 items — flagged for a maintainer call (not in this PR)

These are contentious or cross-file, so they want your decision rather than a unilateral edit:

  • Accepted vs Accepting: the primer says "Accepted for side effects, Accepting to cancel," but live UICatalog scenarios use Accepting for side effects ~139:10, and getting-started.md says event handling "uses Accepting." Pick one and make the docs + examples agree (then validate-doc-snippets can enforce it).
  • Cookbook / llms.txt model manual IsDefault = true and obsolete SelectedItemChanged — update to match gotchas There is a problem with the high-intensity colors, they are not showing up #1/Add mouse event support to the core. #4 above.
  • Unify version/maturity strings (@2.0.* vs alpha.* vs beta.*; "Alpha" vs "Beta") now that v2 is stable 2.4.x.
  • Add llms.txt (and the dialog/IValue snippets) to validate-doc-snippets.yml so they can't rot.

Sourced while building the agent-optimized templates (tui-cs/Terminal.Gui.templates#22).

Add to ai-v2-primer.md 'Gotchas > API Correctness' (verified against source):
- Dialog/MessageBox: the last button added is the default; order Cancel…OK; don't
  hand-set IsDefault (Dialog.cs, MessageBox.cs).
- AddCommand is protected — register inside the View, bind via KeyBindings (View.Command.cs).
- Terminal.Gui.Drawing.Attribute collides with System.Attribute (Drawing/Attribute.cs).
- Typed views expose .Value via IValue<T>, not guessed names like .Date/.Color (DatePicker.cs).

Inline prose only (no fenced snippets), so the doc-snippet compiler is unaffected.

Part of #5525.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tig
tig merged commit 798ed75 into develop Jun 23, 2026
2 checks passed
@tig
tig deleted the docs/agent-guidance-gotchas branch June 23, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant