refactor: simplify feedback reactions#518
Conversation
WalkthroughThis change refactors the feedback widget template to standardize its icon rendering system. The update replaces individual SVG markup for each reaction state (Good, Ok, Bad) with a unified icon-based architecture. Icon definitions now use per-reaction objects containing SVG paths, viewBox, and transform properties, rendered within a single shared SVG container. The markup is simplified by removing legacy mouth-specific code in favor of reusable icon structures. Spacing classes and divider logic are updated accordingly, with conditional dividers appearing between items except the last. 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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.
🧹 Nitpick comments (1)
wiki/templates/wiki/includes/feedback_widget.html (1)
7-10: Thumbs-down before thumbs-up is unconventional ordering.Most feedback widgets (YouTube, Google, GitHub, etc.) place the positive action (👍) first/left and the negative action (👎) second/right. Swapping the order would better match user expectations.
Proposed fix
{% set reactions = [ - {"type": "Bad", "icon": '<path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"/>', "transform": "translate(0, 2)", "viewBox": "0 1 24 24"}, - {"type": "Good", "icon": '<path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"/>', "transform": "translate(0, -2)", "viewBox": "0 -1 24 24"} + {"type": "Good", "icon": '<path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"/>', "transform": "translate(0, -2)", "viewBox": "0 -1 24 24"}, + {"type": "Bad", "icon": '<path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"/>', "transform": "translate(0, 2)", "viewBox": "0 1 24 24"} ] %}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@wiki/templates/wiki/includes/feedback_widget.html` around lines 7 - 10, The reactions array currently lists the negative ("Bad") reaction first and the positive ("Good") second which is counter to common UX conventions; reorder the entries in the reactions variable so the object with "type": "Good" comes before the object with "type": "Bad" (update the reactions list in wiki/templates/wiki/includes/feedback_widget.html), and ensure any code that relies on the original index order (e.g., template rendering or event handlers referencing reactions[0] / reactions[1]) still maps to the correct semantic action after the swap.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@wiki/templates/wiki/includes/feedback_widget.html`:
- Around line 7-10: The reactions array currently lists the negative ("Bad")
reaction first and the positive ("Good") second which is counter to common UX
conventions; reorder the entries in the reactions variable so the object with
"type": "Good" comes before the object with "type": "Bad" (update the reactions
list in wiki/templates/wiki/includes/feedback_widget.html), and ensure any code
that relies on the original index order (e.g., template rendering or event
handlers referencing reactions[0] / reactions[1]) still maps to the correct
semantic action after the swap.
|
Add a demo/screenshots @gajjug004 |
What
Why
Thumbs up/down is a more universally recognized feedback pattern and cleaner visually than smiley faces.
How
Summary by CodeRabbit