feature: warning sanction UI - #621
Merged
Merged
Conversation
- 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.
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.
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, sendsduration: 0and needs a non-blank reason; other types no longer mark the reason requiredPlayerSanctions: 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 passessanction_idPlayerWarninggets a tac-amber bar, title and icon and never folds into a stack;PlayerSanctionedgets the destructive tint only where it is certainly a bangenerated/zeushand-patched forwarning,PlayerWarningandunsanctionServerPlayer(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 runyarn 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