Repository navigation
fix(frontend): make the Home row Cancel an outlined destructive button - #1359
Merged
Merged
Conversation
PR LeanerCloud#765 defined the button system (quiet outlined default, .btn-danger, .btn-link, .btn-warning, .secondary), which fixed most of this issue. The Upcoming Scheduled Purchases rows on Home still used the filled `danger` class for Cancel, so a solid red block remained the loudest element on every row, ahead of View Details. Switch it to .btn-danger: red border and text so it still reads as destructive, filled only on hover. The detail dialog's "Cancel Purchase" keeps the filled style because there it is the dialog's main action. A jest test pins the class and a Playwright check verifies the painted background, text and border colors against the real stylesheet. Refs LeanerCloud#695 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Collaborator
Author
|
Independent review (IAmJSD's agent, fresh context, given only the diff, the issue and the PR text): APPROVE Blocking:
|
Collaborator
Author
|
Local verification at
|
IAmJSD
marked this pull request as ready for review
October 24, 2026 15:50
Collaborator
Author
|
Marked ready and merged by IAmJSD's agent, at IAmJSD's request (IAmJSD reviewed the before/after screenshots; cristim is traveling), after the independent review and local verification above, all at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most of this issue is already done on main by #765, which defined
.btn-danger,.btn-link,.btn-warningand.secondaryand made the default button a quiet outlined one. One named symptom remained: each Home "Upcoming Scheduled Purchases" row still used the filled reddangerclass for Cancel, so a solid red block was the loudest element on every row. This PR switches that Cancel to the outlined.btn-dangervariant.Refs #695
Partial: the issue's suggested collapse of the ~14 button variants into one
.btnsystem is not done here (#765 deferred it as well).What changed
frontend/src/dashboard.ts: the row-level Cancel button usesbtn-danger(red border and text, fills red on hover) instead ofdanger(always filled red). The detail dialog's "Cancel Purchase" stays filled, since there it is the dialog's main action.frontend/src/__tests__/dashboard.test.ts: class assertion.frontend/tests-e2e/upcoming-purchases-layout.spec.ts: a paint check against the real stylesheet (computed background is not the solid error red, text is not white, border is the error red).Why this approach
A one-class change that reuses the outlined destructive variant #765 introduced for this case ("fills on hover so the destructive action reads as such without being the loudest element in a row"). No new CSS. The variant collapse touches about 100 call sites across files that other open branches are also editing, and #765 explicitly put it out of scope.
Screenshots
Before is main (
a14dc8f2), after is this branch. Both are headless Chromium at 1440x900 against the repo's mocked e2e API.Home's Upcoming Scheduled Purchases with 3 mocked rows. Before, each row has a solid red Cancel, the loudest element on the row. After, Cancel is outlined red (still reads as destructive, fills on hover) and no longer outweighs View Details.
Verification
Run on this branch's head
082f53d5on top of maina14dc8f2.npm run lint: 0 errors (142 pre-existing warnings). Typecheck clean, build OK.--randomizeruns. Some seeds fail 2-3 pre-existing dashboard tests ("fetches dashboard summary...", "uses current provider filter", "90-day range") on unmodified main too (seed-1388931807reproduces it ona14dc8f2), so that order dependence is unrelated.scripts/test-git-secrets-allowlist.sh: 137 PASS, 0 FAIL.Notes for review
plans.ts:1161, classdanger) and the plan purchase remove button (plans.ts:761,btn-small danger) are still filled red. They are left alone because the issue only names Home rows..btn-small,.btn-secondary,.btn-primary,.btn-destructive,.btn-tertiaryand thebutton.primary/success/dangervariants into one.btnsystem..btn-smalland.btn-secondaryalso still use a grey#e8e8e8hover. The issue could close once there is a decision on whether the collapse gets its own issue.Overlaps
#713's branch edits
renderUpcominginfrontend/src/dashboard.tsnear the same lines, so expect a trivial textual conflict. #725 (CSS hygiene) and #743 (modal/card systems) may touch the button CSS if the variant collapse happens there.Note for the UI owner
This changes UI code that @cristim owns. IAmJSD reviewed the before/after screenshots and asked for it to be merged; any design point you disagree with can be a follow-up.
🤖 Generated with Claude Code