fix(web): pluralize twin badges and surface Undo button affordance#79
Conversation
Two quick polish fixes from issue #53: - Twin page badges no longer say "1 things", "1 prefs", "1 inferences". Singularize when count is 1. - Decisions table Undo control was using .btn-ghost (transparent border, muted text) which made it indistinguishable from a label. Switch to .btn-outline so users can see it's interactive. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Polish fixes in the web dashboard to improve copy correctness on the Twin page and make the Decisions “Undo” action visually recognizable as a button.
Changes:
- Fix pluralization for the Twin page “things” badge when the total count is 1.
- Fix pluralization for per-domain Twin badges (“pref(s)”, “inference(s)”).
- Update the Decisions table “Undo” control styling from ghost to outline for clearer affordance.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/web/public/js/pages/twin.js | Adds conditional singular/plural rendering for summary and per-domain count badges. |
| apps/web/public/js/pages/decisions.js | Switches the Undo button to .btn-outline for a visible border/hover affordance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <div class="card-header"> | ||
| <span class="card-title">What I've learned about you</span> | ||
| <span class="badge badge-info">${preferences.length + inferences.length} things</span> | ||
| <span class="badge badge-info">${preferences.length + inferences.length} ${preferences.length + inferences.length === 1 ? 'thing' : 'things'}</span> |
There was a problem hiding this comment.
preferences.length + inferences.length is computed twice in the badge template. Consider assigning the total count to a local variable (or helper) and reusing it to improve readability and reduce duplication (especially if the expression ever changes).
| <div class="card-header"> | ||
| <span class="card-title">${domainName}</span> | ||
| <span class="badge badge-accent">${group.preferences.length} prefs, ${group.inferences.length} inferences</span> | ||
| <span class="badge badge-accent">${group.preferences.length} ${group.preferences.length === 1 ? 'pref' : 'prefs'}, ${group.inferences.length} ${group.inferences.length === 1 ? 'inference' : 'inferences'}</span> |
There was a problem hiding this comment.
The pluralization logic repeats group.preferences.length and group.inferences.length multiple times in a single template literal. Consider storing these counts in local variables (or using a small pluralize helper) to make the template easier to scan and less error-prone to modify.
…h work (#87) Captures eight PRs (#77, #78, #79, #81, #82, #83, #84, #85, #86) under an [Unreleased] section. No code changes — pure documentation. Bumping VERSION + cutting a tag is left as a separate decision so the release moment stays explicit. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Two quick-win polish fixes from #53:
Addresses two of the smaller items in #53 (P2 grammar bug, P3 unstyled Undo). The larger items (approvals pagination, decisions readability, home page polish) remain open for follow-up.
Test plan
🤖 Generated with Claude Code