diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 000000000..bd997f482 --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,4 @@ +## 2026-10-17 - Icon-only Button Accessibility + +**Learning:** Missing aria-labels on icon-only buttons (like theme toggles and inline add buttons) is a recurring accessibility issue in server-rendered Rust templates. Title attributes alone are insufficient. +**Action:** Always explicitly check for and add aria-label attributes to empty buttons when modifying server-rendered templates in pkgs/id/src/web/templates.rs. diff --git a/pkgs/id/src/blob_gate.rs b/pkgs/id/src/blob_gate.rs index d8d207fd6..e64b3bdd3 100644 --- a/pkgs/id/src/blob_gate.rs +++ b/pkgs/id/src/blob_gate.rs @@ -125,10 +125,7 @@ pub struct FoldedWorlds { impl FoldedWorlds { /// Pairs the folded worlds with a reference index. pub const fn new(worlds: Worlds, references: HashMap>) -> Self { - Self { - worlds, - references, - } + Self { worlds, references } } } diff --git a/pkgs/id/src/web/mod.rs b/pkgs/id/src/web/mod.rs index c6731d804..fccd4c190 100644 --- a/pkgs/id/src/web/mod.rs +++ b/pkgs/id/src/web/mod.rs @@ -115,7 +115,7 @@ impl SaveRateLimiter { if let Some(last) = map.get(name) { let elapsed = last.elapsed(); if elapsed < self.cooldown { - return Err(self.cooldown.checked_sub(elapsed).unwrap()); + return Err(self.cooldown.checked_sub(elapsed).unwrap_or(Duration::from_secs(0))); } } Ok(()) diff --git a/pkgs/id/src/web/templates.rs b/pkgs/id/src/web/templates.rs index a052af54f..76c609938 100644 --- a/pkgs/id/src/web/templates.rs +++ b/pkgs/id/src/web/templates.rs @@ -93,9 +93,9 @@ pub fn render_main_page_wrapper(content: &str) -> String { html.push_str(" peers\n"); html.push_str(" settings\n"); html.push_str(" \n"); - html.push_str(" \n"); - html.push_str(" \n"); - html.push_str(" \n"); + html.push_str(" \n"); + html.push_str(" \n"); + html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n"); @@ -458,9 +458,9 @@ pub fn render_editor(doc_id: &str, name: &str, content: &str, hash: &str) -> Str html.push_str(" peers\n"); html.push_str(" settings\n"); html.push_str(" \n"); - html.push_str(" \n"); - html.push_str(" \n"); - html.push_str(" \n"); + html.push_str(" \n"); + html.push_str(" \n"); + html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n"); @@ -474,7 +474,7 @@ pub fn render_editor(doc_id: &str, name: &str, content: &str, hash: &str) -> Str html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n"); - html.push_str(" \n"); + html.push_str(" \n"); html.push_str(" \n"); html.push_str(" \n");