GRI-2101: red buttons only for danger, not every secondary action #235

Merged
vivy merged 1 commit from fix/GRI-2101-neutral-secondary-buttons into dev 2026-11-15 17:45:41 +00:00
Member

Fixes #230

Red (gx-btn gx-btn--secondary) is @grimoirix/design's "urgent or
destructive" button. Expand, Edit, Open, Rename and a number of other
non-destructive actions across the app (Cancel, Back, Log out, Move
up/down, Test the connection, Use the server default, …) were using it
even though none of them is dangerous or permanent.

  • Added gx-btn--neutral in frontend-web/src/index.css — the shared
    design package only ships --primary and --secondary, so a neutral
    variant has to live here, following the border/text tokens.
  • Moved every non-destructive secondary action onto gx-btn--neutral.
    Kept gx-btn--secondary only for Delete, Block, Remove, and the
    network settings' "Restart now" (it interrupts every connected
    device immediately, which reads as urgent rather than merely
    inconvenient).
  • Added frontend-web/src/designSystemButtons.test.ts: it scans every
    .tsx file for gx-btn--secondary elements and fails when the
    element's visible label doesn't contain a danger word (delete,
    remove, block, restart). This is the "test or lint" the issue asks
    for — a future misuse of the danger class fails this test.

Verification

./scripts/local-gates.sh --frontend-only (prettier, oxlint, tsc,
vitest, build) — all green, from a clean install in a dedicated
worktree.

Visual check: widths 360px–1440px, light and dark theme, via the
design tokens only (no hard-coded colors). Buttons keep the shared
:focus-visible outline from @grimoirix/design; no new focus or
contrast behavior was introduced — the neutral style reuses
--border-strong/--text/--surface-overlay, the same tokens the
rest of the app already uses for secondary chrome.

Fixes https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/issues/230 Red (`gx-btn gx-btn--secondary`) is `@grimoirix/design`'s "urgent or destructive" button. Expand, Edit, Open, Rename and a number of other non-destructive actions across the app (Cancel, Back, Log out, Move up/down, Test the connection, Use the server default, …) were using it even though none of them is dangerous or permanent. - Added `gx-btn--neutral` in `frontend-web/src/index.css` — the shared design package only ships `--primary` and `--secondary`, so a neutral variant has to live here, following the border/text tokens. - Moved every non-destructive secondary action onto `gx-btn--neutral`. Kept `gx-btn--secondary` only for Delete, Block, Remove, and the network settings' "Restart now" (it interrupts every connected device immediately, which reads as urgent rather than merely inconvenient). - Added `frontend-web/src/designSystemButtons.test.ts`: it scans every `.tsx` file for `gx-btn--secondary` elements and fails when the element's visible label doesn't contain a danger word (delete, remove, block, restart). This is the "test or lint" the issue asks for — a future misuse of the danger class fails this test. ## Verification `./scripts/local-gates.sh --frontend-only` (prettier, oxlint, tsc, vitest, build) — all green, from a clean install in a dedicated worktree. Visual check: widths 360px–1440px, light and dark theme, via the design tokens only (no hard-coded colors). Buttons keep the shared `:focus-visible` outline from `@grimoirix/design`; no new focus or contrast behavior was introduced — the neutral style reuses `--border-strong`/`--text`/`--surface-overlay`, the same tokens the rest of the app already uses for secondary chrome.
GRI-2101: red buttons only for danger, not every secondary action
All checks were successful
CI / the pre-push hook (pull_request) Successful in 3s
CI / cargo fmt (pull_request) Successful in 3s
CI / install.sh client upgrade (pull_request) Successful in 7s
CI / cargo deny (pull_request) Successful in 18s
CI / cargo deny advisories (pull_request) Successful in 21s
CI / repository boundary (pull_request) Successful in 5s
CI / cargo clippy (pull_request) Successful in 1m23s
CI / frontend-web (pull_request) Successful in 1m9s
CI / cargo test (pull_request) Successful in 2m37s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 2s
c6e41ea435
Expand, Edit, Open, Rename, Cancel, Back, Log out, Move up/down and
similar used gx-btn--secondary, this design system's red/danger
button class, even though none of them is destructive or urgent.

Add a gx-btn--neutral class (the shared @grimoirix/design package
only ships primary and secondary) and move every non-danger action
onto it, keeping gx-btn--secondary for Delete, Block, Remove and
Restart now. A vitest check scans every .tsx file and fails when a
gx-btn--secondary element's label does not read as a danger action.
vivy merged commit 21eb1be5c6 into dev 2026-11-15 17:45:41 +00:00
vivy deleted branch fix/GRI-2101-neutral-secondary-buttons 2026-11-15 17:45:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!235
No description provided.