Skip to content

🎨 Palette: Bind search box accessible name to dynamic placeholder#382

Merged
AhmmedSamier merged 2 commits intomasterfrom
palette/dynamic-accessibility-name-18071346495318388443
May 10, 2026
Merged

🎨 Palette: Bind search box accessible name to dynamic placeholder#382
AhmmedSamier merged 2 commits intomasterfrom
palette/dynamic-accessibility-name-18071346495318388443

Conversation

@AhmmedSamier
Copy link
Copy Markdown
Owner

@AhmmedSamier AhmmedSamier commented Apr 22, 2026

💡 What
Updated the Visual Studio extension's Search TextBox to bind its accessibility name (AutomationProperties.Name) to the dynamic SearchPlaceholder property instead of using a hardcoded "Search query" string.

🎯 Why
Previously, sighted users would see a helpful, context-aware watermark when changing search scopes, but screen reader users would only hear "Search query" no matter what scope was selected. This change ensures that screen reader users receive the exact same contextual guidance as sighted users.

📸 Before/After

  • Before: Screen reader announces: "Search query, text box"
  • After: Screen reader announces: "Search in Current Document, text box" (or whichever scope is currently selected).

♿ Accessibility

  • Directly improves accessibility by synchronizing visual contextual hints with screen reader announcements.
  • Uses standard WPF AutomationProperties.Name binding to cleanly map the ViewModel property to the UI Automation tree.

PR created automatically by Jules for task 18071346495318388443 started by @AhmmedSamier

Summary by CodeRabbit

  • Bug Fixes

    • Updated search input accessibility labels to dynamically reflect current placeholder text, improving screen-reader experience.
  • Documentation

    • Added accessibility guidelines for dynamic UI elements.

Updates the Visual Studio extension Search TextBox to use the dynamic `SearchPlaceholder` property for its `AutomationProperties.Name` instead of a static "Search query" string, ensuring screen readers receive the same contextual guidance as sighted users.

Co-authored-by: AhmmedSamier <17784876+AhmmedSamier@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
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@AhmmedSamier has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 40 minutes and 19 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d8218825-9051-4a76-ad62-9bc9a759efdf

📥 Commits

Reviewing files that changed from the base of the PR and between 2d5915d and 4cef1e0.

📒 Files selected for processing (1)
  • .Jules/palette.md
📝 Walkthrough

Walkthrough

The PR documents a new accessibility rule requiring that when search placeholder text is bound to a dynamic view-model property, the screen-reader accessibility label (AutomationProperties.Name) must also bind to that same property. This pattern is then applied to SearchControl.xaml, binding the accessibility label to the dynamic placeholder instead of using a hardcoded string.

Changes

Cohort / File(s) Summary
Documentation
.Jules/palette.md
Added a new accessibility rule specifying that when visual placeholder text is bound to a dynamic property, the AutomationProperties.Name must bind to the same property to keep screen-reader labels in sync.
Search Control Accessibility
visual-studio-extension/DeepLensVisualStudio/DeepLensVisualStudio/ToolWindows/SearchControl.xaml
Changed AutomationProperties.Name from a fixed string ("Search query") to a data binding to SearchPlaceholder, ensuring screen-reader naming reflects the current placeholder content.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • PR #300: Modifies SearchControl.xaml for dynamic placeholder behavior; the main PR binds the accessibility label to the dynamic placeholder introduced in that PR.
  • PR #343: Modifies SearchControl.xaml to use the dynamic SearchPlaceholder binding and adds the underlying SearchPlaceholder property.
  • PR #289: Updates accessibility handling for the search control, specifically how placeholder and watermark text is exposed to assistive technologies.

Poem

🐰 A rabbit hops through fields of code so bright,
Where labels dance with placeholders in flight,
No longer static, no longer confined—
The screen-reader's voice now stays aligned!
Dynamic and bound, together they play,
Accessibility wins the day! 🎉

🚥 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 clearly and specifically describes the main change: binding the search box's accessible name to a dynamic placeholder, which matches the core objective of synchronizing screen reader announcements with visual placeholder text.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/dynamic-accessibility-name-18071346495318388443

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
visual-studio-extension/DeepLensVisualStudio/DeepLensVisualStudio/ToolWindows/SearchControl.xaml (1)

217-218: Move verbose placeholder text from AutomationProperties.Name to AutomationProperties.HelpText.

The current binding of SearchPlaceholder (example-laden strings like "Classes: Try 'UserService', 'IConfig', or 'AuthError'...") to AutomationProperties.Name creates an accessibility issue. Screen readers announce Name as the control's semantic identifier/purpose; using it for verbose hint text misleads screen readers into announcing the full suggestion string as a static label, which is noisy and doesn't match its intended use per UI Automation guidance.

A better mapping:

  • AutomationProperties.Name → concise scope label (e.g., "Search" or "Search classes")
  • AutomationProperties.HelpTextSearchPlaceholder (the contextual hint with examples)
♻️ Suggested change
-                            AutomationProperties.Name="{Binding SearchPlaceholder}"
+                            AutomationProperties.Name="Search"
+                            AutomationProperties.HelpText="{Binding SearchPlaceholder}"
                             ToolTip="{Binding SearchPlaceholder}" />

This preserves the accessibility intent while properly separating the control's identifier from its supplemental hint.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@visual-studio-extension/DeepLensVisualStudio/DeepLensVisualStudio/ToolWindows/SearchControl.xaml`
around lines 217 - 218, The SearchPlaceholder binding is currently assigned to
AutomationProperties.Name, which causes verbose hint text to be announced as the
control's label; change the XAML so AutomationProperties.Name is a concise label
(e.g., "Search" or "Search classes") and move the detailed SearchPlaceholder
binding to AutomationProperties.HelpText instead (update the element that
currently sets AutomationProperties.Name="{Binding SearchPlaceholder}" to set
AutomationProperties.Name to a short literal or a new concise binding and set
AutomationProperties.HelpText="{Binding SearchPlaceholder}"); ensure the control
still has ToolTip="{Binding SearchPlaceholder}" if desired.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@visual-studio-extension/DeepLensVisualStudio/DeepLensVisualStudio/ToolWindows/SearchControl.xaml`:
- Around line 217-218: The SearchPlaceholder binding is currently assigned to
AutomationProperties.Name, which causes verbose hint text to be announced as the
control's label; change the XAML so AutomationProperties.Name is a concise label
(e.g., "Search" or "Search classes") and move the detailed SearchPlaceholder
binding to AutomationProperties.HelpText instead (update the element that
currently sets AutomationProperties.Name="{Binding SearchPlaceholder}" to set
AutomationProperties.Name to a short literal or a new concise binding and set
AutomationProperties.HelpText="{Binding SearchPlaceholder}"); ensure the control
still has ToolTip="{Binding SearchPlaceholder}" if desired.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 32322878-7796-4223-a81d-578c17739b5f

📥 Commits

Reviewing files that changed from the base of the PR and between 32a2408 and 2d5915d.

📒 Files selected for processing (2)
  • .Jules/palette.md
  • visual-studio-extension/DeepLensVisualStudio/DeepLensVisualStudio/ToolWindows/SearchControl.xaml

@AhmmedSamier AhmmedSamier merged commit e1b2a9e into master May 10, 2026
1 of 2 checks passed
@AhmmedSamier AhmmedSamier deleted the palette/dynamic-accessibility-name-18071346495318388443 branch May 10, 2026 00:15
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