Skip to content

🎨 Palette: Add contextual disambiguation to list action tooltips and accessibility labels#77

Open
NSEvent wants to merge 4 commits into
mainfrom
palette/dynamic-accessibility-list-actions-7251807470675885245
Open

🎨 Palette: Add contextual disambiguation to list action tooltips and accessibility labels#77
NSEvent wants to merge 4 commits into
mainfrom
palette/dynamic-accessibility-list-actions-7251807470675885245

Conversation

@NSEvent

@NSEvent NSEvent commented Jul 6, 2026

Copy link
Copy Markdown
Owner

💡 What: The UX enhancement added dynamic context from the current list item (e.g. macro.name) to .help() tooltips and .accessibilityLabel() attributes for icon-only list actions in Macros, Scripts, Gestures, and Chords.

🎯 Why: Previously, VoiceOver users and hover tooltips would simply read "Edit" or "Delete" multiple times in a row for repeated list items, making it difficult to disambiguate which item was currently focused. Using dynamic fallback-aware names resolves this ambiguity.

Accessibility: Added significant disambiguation to screen reader navigation by ensuring context-aware labeling across all action buttons in the main application lists.


PR created automatically by Jules for task 7251807470675885245 started by @NSEvent

Summary by CodeRabbit

  • Accessibility
    • Improved VoiceOver and tooltip context for list actions by including the specific item name in Edit/Delete/Clear labels.
    • Applied this to macros, scripts, and gestures so repeated items are easier to distinguish.
    • Added friendly fallbacks such as “Unnamed Macro” and “Untitled Script” when names are missing.

…d tooltips

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates .help() and .accessibilityLabel() strings on icon-only edit/delete/clear buttons across MacroListView.swift, ScriptListView.swift, and GestureListViews.swift to include item-specific names (macro name, script name, gesture display name) with fallback text when empty, and documents this pattern in .Jules/palette.md.

Changes

Contextual Accessibility Labels

Layer / File(s) Summary
Macro row action labels
XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift
Edit/delete .help and .accessibilityLabel strings in SharedMacroRow and MacroRow now use the macro's name, falling back to "Unnamed Macro" when empty.
Script row action labels
XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift
Edit/delete .help and .accessibilityLabel strings in ScriptRow now use the script's name, falling back to "Untitled Script" when empty.
Gesture row action labels
XboxControllerMapper/XboxControllerMapper/Views/MainWindow/GestureListViews.swift
Edit/clear .help and .accessibilityLabel strings in GestureRow now include gestureType.displayName.
Palette documentation update
.Jules/palette.md
A new guidance section documents adding dynamic item-specific context to help/accessibility strings for repeated list item actions.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: contextual tooltips and accessibility labels for repeated list actions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/dynamic-accessibility-list-actions-7251807470675885245

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

google-labs-jules Bot and others added 3 commits July 6, 2026 09:01
…ation, add dynamic context to list action accessibility labels and tooltips

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
…accessibility labels

💡 **What:** The UX enhancement added dynamic context from the current list item to `.help()` tooltips and `.accessibilityLabel()` attributes for icon-only list actions in Macros, Scripts, and Gestures.

🎯 **Why:** Previously, VoiceOver users and hover tooltips would simply read "Edit" or "Delete" multiple times in a row for repeated list items.

♿ **Accessibility:** Added significant disambiguation to screen reader navigation.

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
…accessibility labels

💡 **What:** The UX enhancement added dynamic context from the current list item to `.help()` tooltips and `.accessibilityLabel()` attributes for icon-only list actions in Macros, Scripts, and Gestures.

🎯 **Why:** Previously, VoiceOver users and hover tooltips would simply read "Edit" or "Delete" multiple times in a row for repeated list items.

♿ **Accessibility:** Added significant disambiguation to screen reader navigation.

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (2)
XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift (1)

158-159: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract repeated fallback-name logic to reduce duplication.

The macro.name.isEmpty ? "Unnamed Macro" : macro.name ternary is duplicated 4 times across SharedMacroRow and MacroRow (once per .help/.accessibilityLabel pair, per button). Extracting it into a computed property would avoid the two strings drifting if only one is edited later.

♻️ Proposed refactor
 struct SharedMacroRow: View {
     let macro: TriggerKitCore.AutomationMacro
     var onEdit: () -> Void

+    private var displayName: String {
+        macro.name.isEmpty ? "Unnamed Macro" : macro.name
+    }
+
     var body: some View {
...
             .buttonStyle(.borderless)
-            .help("Edit \(macro.name.isEmpty ? "Unnamed Macro" : macro.name) in shared library")
-            .accessibilityLabel("Edit \(macro.name.isEmpty ? "Unnamed Macro" : macro.name) in shared library")
+            .help("Edit \(displayName) in shared library")
+            .accessibilityLabel("Edit \(displayName) in shared library")
 struct MacroRow: View {
     let macro: Macro
     var onEdit: () -> Void
     var onDelete: () -> Void

+    private var displayName: String {
+        macro.name.isEmpty ? "Unnamed Macro" : macro.name
+    }
+
     var body: some View {
...
                 .buttonStyle(.borderless)
-                .help("Edit \(macro.name.isEmpty ? "Unnamed Macro" : macro.name)")
-                .accessibilityLabel("Edit \(macro.name.isEmpty ? "Unnamed Macro" : macro.name)")
+                .help("Edit \(displayName)")
+                .accessibilityLabel("Edit \(displayName)")

                 Button(action: onDelete) {
                     Image(systemName: "trash")
                         .foregroundColor(.red.opacity(0.8))
                 }
                 .buttonStyle(.borderless)
-                .help("Delete \(macro.name.isEmpty ? "Unnamed Macro" : macro.name)")
-                .accessibilityLabel("Delete \(macro.name.isEmpty ? "Unnamed Macro" : macro.name)")
+                .help("Delete \(displayName)")
+                .accessibilityLabel("Delete \(displayName)")

Also applies to: 209-218

🤖 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 `@XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift`
around lines 158 - 159, The fallback macro-name ternary is duplicated in
SharedMacroRow and MacroRow, so extract it into a shared computed property or
helper on the relevant row view and reuse it for both .help and
.accessibilityLabel. Update the edit button labels to reference that single
source of truth so the “Unnamed Macro” fallback stays consistent across the
shared library and regular macro rows.
XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift (1)

225-234: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract repeated fallback-name logic to reduce duplication.

Same duplication pattern as in MacroListView.swift: script.name.isEmpty ? "Untitled Script" : script.name repeats 4 times (also duplicated with line 198's Text usage). Consider a computed property.

♻️ Proposed refactor
 struct ScriptRow: View {
     let script: Script
     var onEdit: () -> Void
     var onDelete: () -> Void

+    private var displayName: String {
+        script.name.isEmpty ? "Untitled Script" : script.name
+    }
+
     var body: some View {
...
-                Text(script.name.isEmpty ? "Untitled Script" : script.name)
+                Text(displayName)
...
                 .buttonStyle(.borderless)
-                .help("Edit \(script.name.isEmpty ? "Untitled Script" : script.name)")
-                .accessibilityLabel("Edit \(script.name.isEmpty ? "Untitled Script" : script.name)")
+                .help("Edit \(displayName)")
+                .accessibilityLabel("Edit \(displayName)")

                 Button(action: onDelete) {
                     Image(systemName: "trash")
                         .foregroundColor(.red.opacity(0.8))
                 }
                 .buttonStyle(.borderless)
-                .help("Delete \(script.name.isEmpty ? "Untitled Script" : script.name)")
-                .accessibilityLabel("Delete \(script.name.isEmpty ? "Untitled Script" : script.name)")
+                .help("Delete \(displayName)")
+                .accessibilityLabel("Delete \(displayName)")
🤖 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 `@XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift`
around lines 225 - 234, The fallback-name logic for scripts is duplicated across
the action labels in ScriptListView, so centralize it behind a single computed
property or helper on the view/model and reuse it for the Edit/Delete help and
accessibility labels, matching the pattern already used in MacroListView. Update
the Button-related strings in ScriptListView to reference that shared script
display name instead of repeating script.name.isEmpty ? "Untitled Script" :
script.name multiple times, and keep the same behavior for the Text usage
nearby.
🤖 Prompt for all review comments with 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.

Nitpick comments:
In `@XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift`:
- Around line 158-159: The fallback macro-name ternary is duplicated in
SharedMacroRow and MacroRow, so extract it into a shared computed property or
helper on the relevant row view and reuse it for both .help and
.accessibilityLabel. Update the edit button labels to reference that single
source of truth so the “Unnamed Macro” fallback stays consistent across the
shared library and regular macro rows.

In
`@XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift`:
- Around line 225-234: The fallback-name logic for scripts is duplicated across
the action labels in ScriptListView, so centralize it behind a single computed
property or helper on the view/model and reuse it for the Edit/Delete help and
accessibility labels, matching the pattern already used in MacroListView. Update
the Button-related strings in ScriptListView to reference that shared script
display name instead of repeating script.name.isEmpty ? "Untitled Script" :
script.name multiple times, and keep the same behavior for the Text usage
nearby.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 11ad7329-4486-468d-92ce-1d000ba80a9b

📥 Commits

Reviewing files that changed from the base of the PR and between c431981 and 648fe0f.

📒 Files selected for processing (4)
  • .Jules/palette.md
  • XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift
  • XboxControllerMapper/XboxControllerMapper/Views/MainWindow/GestureListViews.swift
  • XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant