Skip to content

fix(web): pluralize twin badges and surface Undo button affordance#79

Merged
jayzalowitz merged 1 commit into
mainfrom
jayzalowitz/dashboard-polish-quickwins
Apr 26, 2026
Merged

fix(web): pluralize twin badges and surface Undo button affordance#79
jayzalowitz merged 1 commit into
mainfrom
jayzalowitz/dashboard-polish-quickwins

Conversation

@jayzalowitz

Copy link
Copy Markdown
Owner

Summary

Two quick-win polish fixes from #53:

  • Twin page badges: "1 things" / "1 prefs" / "1 inferences" now pluralize correctly. Pattern: `${n} ${n === 1 ? 'thing' : 'things'}`.
  • Decisions table Undo button: was using `.btn-ghost` (transparent border, muted text) so it was indistinguishable from a label. Switched to `.btn-outline` for visible affordance.

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

  • Eyeballed the badge templates — `thing`/`things`, `pref`/`prefs`, `inference`/`inferences` all conditional on count
  • `.btn-outline` exists in styles.css with hover state — undo button now has a visible border

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings April 26, 2026 20:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>

Copilot AI Apr 26, 2026

Copy link

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
<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>

Copilot AI Apr 26, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@jayzalowitz jayzalowitz merged commit c779a1b into main Apr 26, 2026
12 checks passed
@jayzalowitz jayzalowitz deleted the jayzalowitz/dashboard-polish-quickwins branch April 26, 2026 20:41
jayzalowitz added a commit that referenced this pull request Apr 27, 2026
…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>
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.

2 participants