Repo header: star/watch buttons should be icon + count only (drop the words) #285
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#285
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's requested
On the repo page header, the star and watch toggle buttons should drop the words — icon + count is enough. The words are redundant (the icons already carry the meaning, and the filled/color state already shows whether it's active) and the pair takes up a lot of the narrow header row (they were the dominant elements in the mobile sweep, see #273-#278 context).
Current code
web/src/pages/Repo.jsx:366—★ {s().viewer?.starred ? "starred" : "star"} · {s().stars ?? 0}web/src/pages/Repo.jsx:212—{w().watching ? "[eye] watching" : "[eye] watch"} · {w().watchers ?? 0}Rendered today as
★ starred · 1and[eye] watching · 1(screenshot).Desired
Compact pill form:
★ 1and[eye-emoji] 1— icon plus count only. State continues to be communicated the way it already is:primaryclass toggle (Repo.jsx:361,:207),titleattributes ("Unstar this repo" / "Watch this repo",:363,:209),aria-pressedstays for assistive tech; add/keep anaria-labelcarrying the verb ("Star this repo"/"Unstar this repo") since the visible verb is gone.Acceptance criteria
★ <count>, watch as[eye icon] <count>— no words.primarytreatment) and still one-click togglable with optimistic flip + error reconcile (no behavior change).aria-labels carry the verb so the action remains discoverable and accessible.Fix up in PR #302 (#302): star/watch header buttons now icon + count only, aria-label/title carry the verb, aria-pressed + primary styling + optimistic flip unchanged. node --test green (581/581). Live-browser check left open for the reviewer (loopback blocked from the shared daemon).
Review of PR #302 (fix/issue-285, commit
216956f) — icon-only star/watch buttons. Verified in scratch worktree, main untouched.Words gone in all states: StarToggle (web/src/pages/Repo.jsx:368) is now single-expression '\u2605 {s().stars ?? 0}' — no starred/star branch remains; WatchToggle (:213) is '\ud83d\udc41 {w().watchers ?? 0}' — no watching/watch branch remains. Grep confirms no visible word strings and no '\u00b7' separator in either block. Both states (starred/unstarred, watching/unwatching) render through the same expression, so every render branch is covered.
Aria-labels + titles (Repo.jsx:209-211, :364-366): title and aria-label both carry the verb per state ('Star/Unstar this repo', 'Watch/Unwatch this repo') — they announce the action while aria-pressed (:210, :365) keeps the state. Correct pattern, matches #285 acceptance.
Counts live: s().stars ?? 0 / w().watchers ?? 0 signals unchanged. Optimistic flip + error reconcile untouched (flip fns :189-200, :343-355 identical to main). Active styling (classList primary :207, :362) + tooltips intact; button classes unchanged.
No new deps: diff is Repo.jsx (6 lines) + new test only; package.json/pnpm-lock untouched (law 1 ok). Dark+light: no class/style change — inherits existing btn/primary, dark default unaffected. Laws 7/8 n/a (no tasks, no seam touch). Law 12: searched docs/ — no doc pins the button words (only backend/API record shapes), so no doc change needed.
Tests: new web/test/unit/repo-social-toggles.test.js (3 tests, source-pinned per repo convention) passes. Full unit suite: 362+216 pass, 0 fail (smoke.test.js 3/3 pass when server up; its trailing file-level hang reproduces on main too — pre-existing environmental, not from this PR). vite build clean (2.15s), esbuild SDK clean. No browser pass per task constraints (no browser needed — text-only change inside unchanged buttons/classes); noted explicitly.
No fixes needed — nothing pushed.
MERGE RECOMMENDATION: ready to merge.
Fixed by PR #302 (review clean; all states wordless with verb aria-labels; tests green), merged. Closing.