Skip to content

Part of #1706: emit typed a11y primitives from CRUD scaffold codegen#1875

Merged
madmax983 merged 1 commit into
trunk-devfrom
1706-a11y-scaffold-adoption
Jul 13, 2026
Merged

Part of #1706: emit typed a11y primitives from CRUD scaffold codegen#1875
madmax983 merged 1 commit into
trunk-devfrom
1706-a11y-scaffold-adoption

Conversation

@madmax983

Copy link
Copy Markdown
Owner

Part of #1706.

Before / After

Before: the CRUD scaffold could generate a submit button or a nav/action link with no accessible name, and the generated app compiled fine — the missing accessible name only surfaced (if ever) at runtime or in an audit.

After: generated submit buttons and static-text nav/action links emit typed primitives — autumn_web::a11y::Button::new(name) and Link::new(href, text) — so a nameless generated control fails to compile in the generated app. Accessibility is enforced by construction. The rendered HTML is byte-identical to before and runtime behavior is unchanged; this is purely a codegen-shape change.

How

Generator-only change in autumn-cli/src/generate/scaffold.rs. The codegen paths that now route through the typed primitives:

  • Submit buttons in the live-validation path emit Button::new(...).
  • Nav + action links in the index / show / search / data_table paths emit Link::new(href, text).
  • The Show-column link emits Link::new(...).

Composition is preserved across every existing scaffold axis: FTS/search, sort-filter allowlisting, policy, submit-tokens, typed paths, and the #1867 zero-JS multipart uploads. Freshly-generated sample projects still cargo check clean (proven by the generated-project cargo-check tests, see Testing).

Scope / follow-on

Being honest about what this slice does not cover:

  • Raw form-field inputs are mostly left as-is. The standard field path already routes through form::* helpers that require a label, so those are already accessible. The escape-hatch raw-markup fields carry class + aria-invalid/aria-describedby + inline-error + validation-constraint wiring that the current TextField typestate cannot express. Full TextField field adoption needs the primitive extended first — that is the named follow-on.
  • The destructive Delete button (with its confirm() guard) is left as-is.
  • Dynamic-text links (where the link text is computed at runtime) are left as-is.

Testing

Post-rebase onto latest trunk-dev (which now includes #1867 uploads and the #1845 a11y verify scanner):

  • cargo fmt --all -- --check — clean
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test -p autumn-cli — green (unittests 3678, cli_tests 175, generate 177; 0 failed)
  • Generated-project cargo-check proofs (ignored, slow): generated_form_for_scaffold_cargo_checks, generated_attachment_scaffold_cargo_checks (composition with Scaffold: persist file uploads on plain multipart submit (zero JS) #1867 uploads), and the base generated_scaffold_cargo_checks all pass — the generated sample projects compile with the typed primitives in place.

Part of #1706.


Generated by Claude Code

Route the generated CRUD views' primary submit buttons and navigation/
action links through the typed accessible primitives in autumn_web::a11y
(Button::new(...).submit(), Link::new(href, text)) so a nameless button or
link is a compile error in the generated app. The destructive delete button
(carries an onclick confirm the current Button API can't express) and the
error/htmx/constraint-wired form-field inputs stay as-is for now.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pf5JUv54F6Bxo8KzErU9sz
@madmax983 madmax983 marked this pull request as ready for review July 13, 2026 17:13

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the scaffold generator in autumn-cli to use typed accessibility primitives (autumn_web::a11y::Button and autumn_web::a11y::Link) instead of raw HTML elements for buttons and links. This ensures that generated applications have accessible names and avoids compilation errors. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@madmax983 madmax983 merged commit 10421aa into trunk-dev Jul 13, 2026
28 of 29 checks passed
@madmax983 madmax983 deleted the 1706-a11y-scaffold-adoption branch July 13, 2026 17:44
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.

2 participants