Part of #1706: emit typed a11y primitives from CRUD scaffold codegen#1875
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)andLink::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:Button::new(...).data_tablepaths emitLink::new(href, text).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 checkclean (proven by the generated-project cargo-check tests, see Testing).Scope / follow-on
Being honest about what this slice does not cover:
form::*helpers that require a label, so those are already accessible. The escape-hatch raw-markup fields carryclass+aria-invalid/aria-describedby+ inline-error + validation-constraint wiring that the currentTextFieldtypestate cannot express. FullTextFieldfield adoption needs the primitive extended first — that is the named follow-on.confirm()guard) is 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— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo test -p autumn-cli— green (unittests 3678,cli_tests175,generate177; 0 failed)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 basegenerated_scaffold_cargo_checksall pass — the generated sample projects compile with the typed primitives in place.Part of #1706.
Generated by Claude Code