Skip to content

feature: warning sanction UI - #621

Merged
lukepolo merged 3 commits into
mainfrom
feature/warning-sanction
Sep 29, 2026
Merged

lukepolo merged 3 commits into
mainfrom
feature/warning-sanction

Conversation

@lukepolo

@lukepolo lukepolo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Adds the web half of the informational warning sanction (api#436) and removes sanctions by id, so removing an expired ban no longer deletes every ban row.

  • SanctionPlayer: a Warning entry that hides the duration, sends duration: 0 and needs a non-blank reason; other types no longer mark the reason required
  • PlayerSanctions: a warning card gets a tac-amber bar and an "On record" pill, no Edit or permanence row, and never counts as active; every removal passes sanction_id
  • Notifications: PlayerWarning gets a tac-amber bar, title and icon and never folds into a stack; PlayerSanctioned gets the destructive tint only where it is certainly a ban
  • Localized sanction type labels; new i18n keys in all 16 locales
  • generated/zeus hand-patched for warning, PlayerWarning and unsanctionServerPlayer(sanction_id)

Merge/deploy: ship with api#436. Deploy after api#436 is deployed and its metadata applied and reloaded (every removal now sends $sanction_id, which an older Hasura rejects), then run yarn codegen.

Tests: removal by sanction_id (including an expired ban beside an active one), the end-date editor opening for a warning, warnings flagging the hero as active, a blank-reason error on bans, a stale duration on a warning and a warning hidden in the name-change stack all fail without the fix. Based on DEAFCS 47e4544, 9253f6b, 05656d4

- The sanction picker offers a Warning. It needs a reason, has no
  duration, and says it is saved to the record, notifies the player,
  and is never enforced and never expires.
- The sanctions sheet shows a warning as its own amber entry
  (TriangleAlert, "On record" pill) with no end-date edit and no
  Permanent/Expires row. Warnings never count toward the active/danger
  state on the profile hero.
- Removing a sanction passes its sanction_id: the api needs it for a
  warning and removes only that row.
- Sanction type labels are localized.
- PlayerWarning notifications get the amber accent bar, title and icon.
  PlayerSanctioned gets the destructive tint where it is certainly a ban
  (the admin alert and the banned player's own notice).
- generated/zeus is hand-patched for warning, PlayerWarning and
  sanction_id until the next codegen.
- A warning never folds into a notification stack. It keys on the
  player's own steam id, like name-change notices, so a newer one would
  have hidden it.
- A collapsed stack whose top card is a certain ban or a warning gets the
  same accent bar, title tint and icon as a single card. The tone rule
  now lives in utilities/sanctionNotificationTone.ts.
- Only a warning demands a reason. Other types no longer show a required
  error they never enforce. The check runs before submitting is set, so
  there is no async validation window.
- The drawer description, the dedicated-server note and the active
  status pill follow the brief: ban is destructive, milder types are
  tac-amber (no red-500 or yellow-500).
- One lucide name (TriangleAlert) in PlayerSanctions.
- Tests: a plain warning with no duration ever picked, a ban without a
  reason, pill tones, and the collapsed stack tint.
@lukepolo
lukepolo merged commit 3ac2e09 into main Sep 29, 2026
2 checks passed
@lukepolo
lukepolo deleted the feature/warning-sanction branch September 29, 2026 01:01
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