From 3c273feb1855cb37e1245e2341cd26e4480a16ed Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Mon, 9 Feb 2026 19:56:11 +0000 Subject: [PATCH] feat(a11y): add ARIA attributes, token colors, toast, and tab-switch links Add aria-required to required inputs, role=alert to error messages, aria-label to icon-only list nav buttons, and progressbar ARIA to bag status bars. Replace hardcoded red/green colors with error/success design tokens across all templates. Add toast notifications for entity creation and tab-switch links for empty add-form states. Increase scan upload body limit to 10MB. --- src/application/routes/api/mod.rs | 10 +- templates/base.html | 34 +++++ templates/pages/add.html | 118 +++++++++++++++--- templates/pages/admin.html | 23 ++-- templates/pages/bag.html | 2 +- templates/pages/brew.html | 2 +- templates/pages/cafe.html | 2 +- templates/pages/checkin.html | 28 ++--- templates/pages/cli_callback.html | 4 +- templates/pages/cup.html | 2 +- templates/pages/gear.html | 2 +- templates/pages/home.html | 5 +- templates/pages/login.html | 3 +- templates/pages/register.html | 5 +- templates/pages/roast.html | 2 +- templates/pages/roaster.html | 2 +- templates/pages/timeline.html | 7 +- .../partials/forms/scan_result_form.html | 3 +- templates/partials/lists/bag_list.html | 11 ++ templates/partials/lists/brew_list.html | 1 + templates/partials/lists/cafe_list.html | 1 + templates/partials/lists/cup_list.html | 1 + templates/partials/lists/gear_list.html | 1 + templates/partials/lists/roast_list.html | 1 + templates/partials/lists/roaster_list.html | 1 + templates/partials/scan_input.html | 3 +- 26 files changed, 213 insertions(+), 61 deletions(-) diff --git a/src/application/routes/api/mod.rs b/src/application/routes/api/mod.rs index d9a8e29..0ae2caf 100644 --- a/src/application/routes/api/mod.rs +++ b/src/application/routes/api/mod.rs @@ -67,8 +67,14 @@ pub(super) fn router() -> axum::Router { .route("/nearby-cafes", get(cafes::nearby_cafes)) .route("/extract-roaster", post(roasters::extract_roaster)) .route("/extract-roast", post(roasts::extract_roast_info)) - .route("/extract-bag-scan", post(scan::extract_bag_scan)) - .route("/scan", post(scan::submit_scan)) + .route( + "/extract-bag-scan", + post(scan::extract_bag_scan).layer(DefaultBodyLimit::max(10 * 1024 * 1024)), + ) + .route( + "/scan", + post(scan::submit_scan).layer(DefaultBodyLimit::max(10 * 1024 * 1024)), + ) .route("/check-in", post(checkin::submit_checkin)) .route("/cups", get(cups::list_cups).post(cups::create_cup)) .route("/cups/{id}", get(cups::get_cup).delete(cups::delete_cup)) diff --git a/templates/base.html b/templates/base.html index 2e1cebd..0d544cd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -48,12 +48,33 @@ type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@1.0.0-RC.6/bundles/datastar.js" > + {% block head %}{% endblock %} + -{% endblock %} - {% block content %} diff --git a/templates/pages/bag.html b/templates/pages/bag.html index e3640e3..d592f64 100644 --- a/templates/pages/bag.html +++ b/templates/pages/bag.html @@ -99,7 +99,7 @@ {% endif %}