🎨 Palette: [UX improvement] Replace interactive anchor with semantic button - #602
🎨 Palette: [UX improvement] Replace interactive anchor with semantic button#602sheepdestroyer wants to merge 4 commits into
Conversation
Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe annotation clear control now uses a native button instead of an href="#" anchor, preventing unintended scrolling while improving semantics and keyboard accessibility; styling preserves the existing link-like appearance and the rationale is documented. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments### Comment 1
<locationpath="router/static/visualizer.html"line_range="328" />
<code_context>
<buttononclick="saveNote(${idx})">Save Note</button>
</div>
- ${ann ? `<div style="margin-top:8px;font-size:0.75em;color:#64b5f6">✓ Reviewed as <b>${escapeHtml(ann.tier)}</b> · <a href="#" onclick="clearAnnotation(${idx})" style="color:#f44336">clear</a></div>` : ''}+ ${ann ? `<div style="margin-top:8px;font-size:0.75em;color:#64b5f6">✓ Reviewed as <b>${escapeHtml(ann.tier)}</b> · <button type="button" onclick="clearAnnotation(${idx})" style="display: inline-block; width: auto; text-align: left; background: transparent; color: #f44336; border: none; font-family: inherit; font-size: inherit; padding: 0; cursor: pointer; text-decoration: underline;" aria-label="Clear review">clear</button></div>` : ''}
</div>
`;
</code_context>
<issue_to_address>
**issue (testing):** The existing end-to-end test still searches for `.human-review a`, but this change removes the only anchor and renders a button instead, so `test_visualizer_clear_annotation` fails at its visibility assertion before exercising the clear action.
**Triggers:** When the visualizer end-to-end test suite runs.
**Suggested fix:** Update the test locator to target the new button, such as `.human-review button[aria-label="Clear review"]`.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: router/static/visualizer.html:328
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| <button onclick="saveNote(${idx})">Save Note</button> | ||
| </div> | ||
| ${ann ? `<div style="margin-top:8px;font-size:0.75em;color:#64b5f6">✓ Reviewed as <b>${escapeHtml(ann.tier)}</b> · <a href="#" onclick="clearAnnotation(${idx})" style="color:#f44336">clear</a></div>` : ''} | ||
| ${ann ? `<div style="margin-top:8px;font-size:0.75em;color:#64b5f6">✓ Reviewed as <b>${escapeHtml(ann.tier)}</b> · <button type="button" onclick="clearAnnotation(${idx})" style="display: inline-block; width: auto; text-align: left; background: transparent; color:#f44336; border: none; font-family: inherit; font-size: inherit; padding: 0; cursor: pointer; text-decoration: underline;" aria-label="Clear review">clear</button></div>` : ''} |
There was a problem hiding this comment.
issue (testing): The existing end-to-end test still searches for .human-review a, but this change removes the only anchor and renders a button instead, so test_visualizer_clear_annotation fails at its visibility assertion before exercising the clear action.
Triggers: When the visualizer end-to-end test suite runs.
Suggested fix: Update the test locator to target the new button, such as .human-review button[aria-label="Clear review"].
…cus outline Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>
…cus outline Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>
…cus outline Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>
💡 What: Replaced the interactive
<a href="#">for clearing annotations with a semantic<button type="button">.🎯 Why: Clicking
<a href="#">tags forces an unintended scroll to the top of the page, disrupting the user experience. Using a semantically correct button prevents this page jump.📸 Before/After: Visual appearance remains the same.
♿ Accessibility: Improved semantic markup and keyboard navigation.
PR created automatically by Jules for task 14054697372291538011 started by @sheepdestroyer
Summary by Sourcery
Replace the annotation-clearing link with an accessible button to prevent unintended navigation and improve interaction semantics.
Bug Fixes:
Enhancements:
Chores: