Skip to content

design sweep round 2: make /account's two controls do what the comments above them say - #133

Merged
guarzo merged 1 commit into
mainfrom
design-sweep/2026-08-06-2
Aug 6, 2026
Merged

design sweep round 2: make /account's two controls do what the comments above them say#133
guarzo merged 1 commit into
mainfrom
design-sweep/2026-08-06-2

Conversation

@guarzo

@guarzo guarzo commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Round 2 of the autonomous design-sweep-loop run. One surface — /account. Both findings are the same shape: the code contradicts a comment sitting directly above it.

What this round resolved

The gold "Add character" CTA fires on three states its own comment excludes

The comment above it reads "Gold only in the nominal state." The condition was health.attention === 0. Those are not the same test. The verdict ladder at src/core/account-health.ts:163-177:

attention > 0   → "degraded"
stalled > 0     → "stalled"            ← attention === 0
discordStale    → "discord-stale"      ← attention === 0
firstSyncPending→ "first-sync-pending" ← attention === 0
                → "nominal"

Three of the four non-nominal verdicts satisfy attention === 0. Each of them renders a .verdict line at account/page.tsx:191-225 telling the member something is wrong — and directly beneath it the page rendered its single loudest control inviting them to add another character.

Cost to a user: a member whose contact sync has stopped, or whose Discord roles have gone stale, opens /account, sees a warning, and the brightest thing on the page is Add character. That is precisely the inversion DESIGN.md's gold rationing and the "state before action" principle exist to prevent — and the comment shows someone already knew it; the condition just never expressed it.

Now keyed off health.verdict === "nominal". The zero-character case the comment calls out explicitly (computeAccountHealth has no target and no fault to find → nominal) still gets gold, unchanged.

The standalone Discord unlink used the in-row 28px grade

DESIGN.md:228-233:

Hit targets: 36px for standalone controls (.btn), 28px for the in-row controls of the admin tables … density wins there and nowhere else. There are two sizes and no others.

The Discord unlink is in a <dd className="facts__lead"> — the facts grid, not a table row — and carried .btn--micro (min-height: 1.75rem).

The repo had already adjudicated this exact question. payouts/[id]/inline-edit.tsx:75-83:

DESIGN.md's 36px hit-target floor applies to a standalone control, and every use of this component in the page head and the facts/details grids … is exactly that.

.inline-edit--standalone (globals.css:1695) exists only to buy the floor back where a class had to keep its colouring. Nothing had to be kept here, so dropping --micro is the entire fix.

Cost to a user: a member on a phone gets a 28px target for the one control on the page that enqueues a deprovision stripping every managed role in the guild. The three character-row unlinks below it (page.tsx:483/517/530) are genuinely in-row and are untouched.

The "heavier at rest than the character-row unlinks" argument in the comment above is about .btn--quiet/.btn--danger-quiet — a colour grade — and never depended on the size. It still holds.

What was skipped

Nothing was skipped in this round. Both findings had an in-repo precedent that settled the fix rather than leaving it to taste, which is why they were cut together.

Checked before editing: no test in tests/ or e2e/ pins either behaviour. e2e/payouts.spec.ts:1838 asserts one .btn--primary at a time, but on /payouts, not here. e2e/account.spec.ts:411-450 drives the Discord unlink by accessible name and is indifferent to its size class.

What needs a human

Unchanged from PR #131 and still the more important half of the output. The one that lands on this surface:

Focus is dropped to <body> after every self-service action on /account. unlinkAction, setMainAction and unlinkDiscordAction all revalidate in place, and in each case the node holding focus is the one that unmounts on success. A keyboard or screen-reader member who just unlinked a character is silently returned to the top of the document with no confirmation it worked. PR #131 makes the Notice region able to announce; it does not give these three actions anything to announce, because they succeed by redirecting rather than by setting a message. Fixing it means deciding what receives focus and what it says — shape work, which needs a brief someone approves.

Gate results

Gate Result
scripts/check-node-version.sh pass
npm run typecheck pass
npm run lint pass
npm run format:check All matched files use Prettier code style!
npm run build exit 0
npm test 76 files, 1085 tests passed — identical to baseline
docker build . not run (slow, environment-bound)
npm run test:e2e not run (needs a migrated DB; known tree-dirtier)

Tree held only src/app/account/page.tsx after every gate.

Stack position

PR 2 of the stack, re-opened from #132 after #131 (round 1) was merged mid-run, which auto-closed #132 along with its base branch. Retargeted at main, which is correct now that round one is in main — this branch already contains it, so the diff shown here is round two alone.

The rest of the stack (#134#136#137#138) is still chained on the original branches and must merge in order after this one. Prefer a merge commit or rebase over squash: squashing rewrites the commits the later PRs are based on, and they will then show conflicts against changes that are, in substance, already there.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a9cd2c87-8149-489f-82af-4b219460da08

📥 Commits

Reviewing files that changed from the base of the PR and between b555c54 and 5eb7d9d.

📒 Files selected for processing (1)
  • src/app/account/page.tsx

Comment @coderabbitai help to get the list of available commands.

@guarzo
guarzo force-pushed the design-sweep/2026-08-06-2 branch from 9ebc812 to 84d0598 Compare August 6, 2026 04:13
@guarzo guarzo changed the title Design sweep/2026 08 06 2 design sweep round 2: make /account's two controls do what the comments above them say Aug 6, 2026
@guarzo

guarzo commented Aug 6, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…t excludes

Two findings on /account, both cases of the code contradicting a comment
sitting directly above it.

The "Add character" link took `.btn--primary` whenever `health.attention === 0`,
under a comment reading "Gold only in the nominal state." The verdict ladder
(core/account-health.ts:163-177) makes `stalled`, `discord-stale` and
`first-sync-pending` all satisfy `attention === 0` — so on three of the four
non-nominal states the page rendered its loudest control directly beneath a
`.verdict` line telling the member something was wrong. A member whose sync has
stopped opens the page and the brightest thing on it invites them to add another
character to the pile. Keyed off `health.verdict === "nominal"` instead, which
is the test the comment already describes. A zero-character account still
computes to `nominal`, so the case that comment calls out explicitly is
unchanged.

The standalone Discord unlink used `.btn--micro` — the 28px grade DESIGN.md:228
reserves for "the in-row controls of the admin tables... and nowhere else."
It sits in the facts grid, not a table row. inline-edit.tsx:75-83 already made
this exact call for this exact grid, and `.inline-edit--standalone`
(globals.css:1695) exists only to restore the floor where a class had to keep
its colouring; nothing had to be kept here, so dropping `--micro` is the whole
fix. A member on a phone gets a 36px target for the one control on the page
that strips every managed role in the guild. The heavier-at-rest argument in the
comment above it is a colour decision and is untouched.

Gates: node-version, typecheck, lint, format:check, build, npm test
(76 files / 1085 tests) all pass. docker build and test:e2e not run.
@guarzo
guarzo force-pushed the design-sweep/2026-08-06-2 branch from 9ed04eb to 5eb7d9d Compare August 6, 2026 06:14
@guarzo
guarzo merged commit 2e01af2 into main Aug 6, 2026
7 checks passed
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.

1 participant