Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 1 addition & 4 deletions pkgs/id/src/blob_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Hash, BTreeSet<String>>) -> Self {
Self {
worlds,
references,
}
Self { worlds, references }
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkgs/id/src/web/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
14 changes: 7 additions & 7 deletions pkgs/id/src/web/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ pub fn render_main_page_wrapper(content: &str) -> String {
html.push_str(" <a href=\"/peers\" data-nav class=\"crt-glow\">peers</a>\n");
html.push_str(" <a href=\"/settings\" data-nav class=\"crt-glow\">settings</a>\n");
html.push_str(" <span class=\"flex items-center gap-1\">\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"sneak\" title=\"Sneak theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"arch\" title=\"Arch theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"mech\" title=\"Mech theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"sneak\" title=\"Sneak theme\" aria-label=\"Sneak theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"arch\" title=\"Arch theme\" aria-label=\"Arch theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"mech\" title=\"Mech theme\" aria-label=\"Mech theme\"></button>\n");
html.push_str(" </span>\n");
html.push_str(" </nav>\n");
html.push_str(" </header>\n");
Expand Down Expand Up @@ -458,9 +458,9 @@ pub fn render_editor(doc_id: &str, name: &str, content: &str, hash: &str) -> Str
html.push_str(" <a href=\"/peers\" data-nav>peers</a>\n");
html.push_str(" <a href=\"/settings\" data-nav>settings</a>\n");
html.push_str(" <span class=\"flex items-center gap-1\">\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"sneak\" title=\"Sneak theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"arch\" title=\"Arch theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"mech\" title=\"Mech theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"sneak\" title=\"Sneak theme\" aria-label=\"Sneak theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"arch\" title=\"Arch theme\" aria-label=\"Arch theme\"></button>\n");
html.push_str(" <button class=\"theme-btn\" data-theme=\"mech\" title=\"Mech theme\" aria-label=\"Mech theme\"></button>\n");
html.push_str(" </span>\n");
html.push_str(" </nav>\n");
html.push_str(" </div>\n");
Expand All @@ -474,7 +474,7 @@ pub fn render_editor(doc_id: &str, name: &str, content: &str, hash: &str) -> Str
html.push_str(" <span class=\"flex items-center gap-1\" id=\"tag-add-inline\">\n");
html.push_str(" <input type=\"text\" id=\"tag-add-key\" class=\"input input-bordered input-xs w-20 bg-base-100\" placeholder=\"key\" />\n");
html.push_str(" <input type=\"text\" id=\"tag-add-value\" class=\"input input-bordered input-xs w-20 bg-base-100\" placeholder=\"value\" />\n");
html.push_str(" <button class=\"btn btn-ghost btn-xs font-mono\" onclick=\"window.idApp?.addTagInline?.()\">+</button>\n");
html.push_str(" <button class=\"btn btn-ghost btn-xs font-mono\" aria-label=\"Add tag\" onclick=\"window.idApp?.addTagInline?.()\">+</button>\n");
html.push_str(" </span>\n");
html.push_str(" </div>\n");

Expand Down
Loading