Skip to content
Open
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
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
## 2026-06-23 - [SwiftUI Button Accessibility]
**Learning:** Found a pattern where SwiftUI icon-only buttons or minimal UI elements were given `.help()` modifiers for hover tooltips but lacked `.accessibilityLabel()` modifiers for screen readers.
**Action:** When adding `.help()` to buttons, always pair it with a corresponding `.accessibilityLabel()` to ensure full accessibility.
## 2024-06-28 - Missing accessibility in Empty State List Item Buttons
**Learning:** Empty state list item buttons (like "Add example scripts") containing only an icon or text and icon can miss explicit accessibility labels or helpful tooltips, particularly in dynamically generated lists (`ForEach`) or customized interactive elements, causing a bad UX for mouse and screen reader users.
**Action:** Always add `.help()` and `.accessibilityLabel()` modifiers to interactive empty state list buttons.
Comment on lines +28 to +30

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.

📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Palette guidance conflates icon-only and text-visible buttons, risking misapplied accessibility overrides.

The new entry groups "only an icon or text and icon" together, but these have different accessibility requirements. Buttons with visible text (like this scriptsEmptyState button containing example.name and example.description) should not blindly receive .accessibilityLabel(): SwiftUI's automatic label incorporates all visible text, and a static override strips that context from VoiceOver users.

Revise the guidance to explicitly distinguish:

  • Icon-only buttons: always add both .help() and .accessibilityLabel() (matches existing 2024-11-20 entry).
  • Buttons with visible text: do not add .accessibilityLabel() unless the visible text fails to describe the action; prefer letting SwiftUI auto-generate from content, or use dynamic labels that include visible text.

Also, the entry date "2024-06-28" predates the 2024-11-20 and 2026-06-06 entries; verify this is intentional and not a copy-paste error.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.Jules/palette.md around lines 28 - 30, Update the palette guidance entry to
clearly separate icon-only buttons from buttons with visible text: the current
wording in the empty-state list item guidance is too broad and can lead to
incorrectly adding a static accessibility label to text-visible controls like
the scripts empty state button. Revise the wording around the empty-state button
guidance to say icon-only buttons should always get both .help() and
.accessibilityLabel(), while buttons with visible text should generally rely on
SwiftUI’s automatic accessibility label unless the visible text is insufficient;
reference the existing empty-state list item guidance and the newer icon-only
entry so the terminology stays consistent. Also verify whether the 2024-06-28
date is intentional relative to the later entries, and correct it if it was
copied by mistake.

Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ struct ScriptListView: View {
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.help("Add \(example.name)")
.accessibilityLabel("Add \(example.name)")
}

HStack(spacing: 12) {
Expand Down
Loading