Field help text
Optional help text for fields: :ui (:help "<markdown>"). One new keyword in *ui-keys* plus a string rule — :ui passes through verbatim, so no other backend plumbing.
- Forms only: a small info / question-mark icon beside the field label; click reveals the text (tooltip or popover). List headers unchanged.
- Content is markdown (inline code for option names, bullets for choices) rendered with the shared markdown renderer (depends on the Markdown widget item above).
- Name
:helpsettled 2026-10-21 (collision check clean; keeps:hintfree for the future text-field width / hint item). Decide in the plan::helptogether with:hide-label ton one field — the icon anchors to the label; leaning toward a compile error, since fields that hide labels are the self-evident ones that need no help text.
Plan: field-help-plan.org
Implemented per the plan end to end:
Compiler (
lisp/model.lisp, the only Lisp file touched)::helpin*ui-keys*after:hide-label(the unknown-key message updates itself);valid-help-valuebesidevalid-hide-label-value—:missingsentinel,report-ve, non-string and blank both signal (the length form, neverpluspon the string); the:help+:hide-label tcompile error lives infinalize-uiafter the value checks and before the widget default is injected (stricteq t; an explicit:hide-label nilplus:helpcompiles;:help nil+:hide-label treports the value error, not the anchor error);finalize-uidocstring's Rejects list extended.Wire: nothing to do —
:uiridesfe-fieldsverbatim; a string serializes as a JSON string (noregister-json-boolean-key). Verified live:/api/listadd-form shows"help":"The **primary** identifier.\n\n- Use `kebab-case`\n- Keep it short", JSON-escaped newlines intact.Frontend: new
web/src/FieldHelp.tsx(real<button type"button">=,aria-expanded/aria-controls/aria-labelflipping with state,Markdownrenderer in the panel, Escape + click-outside close while subscribed only when open, the outside handler ignores the "?" button's own node);Fieldinterface gainshelp?: string;FieldRowrenders<FieldHelp>after<label>whenhelpis a non-empty string andhide-label !=true= (the defensive ignore);index.cssgains.field-help/.field-help-toggle/.field-help-panel(capped 20rem width / 16rem height,z-index900 below the lightbox,var(--border)/var(--tab-inactive-bg)— no new tokens). Onenpmhiccup: node 22 hasnodebut nonpmon PATH;./node_modules/.bin/tsc && ./node_modules/.bin/vite buildis the working build path (353.68 kB bundle, clean).Fixture
models/test/field-help-test.lisp(:posts —:titlewith:helpexercising a paragraph break, inline code, and bullets;:bodyplain; real newlines in the fixture, not\nescapes —plist-to-jsonescapes them on the wire, verified live);tests/field-help-tests.lisp(22 checks: verbatim compile survival, absent-key, non-string / blank / whitespace signals, the:hide-label tclash,:hide-label nillegal, defaults path, typo listing:help, value-error precedence,fe-fieldsadd/update/list-form emission,plist-to-jsonstring serialization). Registered indata-ui.asd;run-field-help-testsintests/helpers.lispadded torun-tests. Test-side stumble worth noting:fe-fieldstakes(type-key user)and returns the all-forms plist — not(type form user); the markdown-tests helper was the precedent to copy.Docs (
docs/model-reference.md)::helpin the per-key value-rules sentence, a:helprow after:hide-labelin the subkey table (incl. the inert:hidden/ rollup cases and the list-header ignore),:hide-labeladded to the Quick key index UI line (it was missing there).Full suite via
scripts/data-ui tests: 2158 checks, 41 groups, all passed.Forms only: a small info / question-mark icon beside the field label; click reveals the text (tooltip or popover). List headers unchanged.
Content is markdown (inline code for option names, bullets for choices) rendered with the shared markdown renderer (depends on the Markdown widget item above).
Name
:helpsettled 2026-10-21 (collision check clean; keeps:hintfree for the future text-field width / hint item). Decide in the plan::helptogether with:hide-label ton one field — the icon anchors to the label; leaning toward a compile error, since fields that hide labels are the self-evident ones that need no help text.
Plan: field-help-plan.org
- Slot
- 3000
- Status
- 60 Done
- Tags
- mvp, frontend, model, compiler
- Contributors
- Donnie