Skip to content

feat(admins): soft-retire, durable issuer names, and bulk actions (#1509) - #1549

Open
maxijabase wants to merge 23 commits into
sbpp:mainfrom
maxijabase:feature/1509-ex-admin-deactivate
Open

feat(admins): soft-retire, durable issuer names, and bulk actions (#1509)#1549
maxijabase wants to merge 23 commits into
sbpp:mainfrom
maxijabase:feature/1509-ex-admin-deactivate

Conversation

@maxijabase

@maxijabase maxijabase commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #1509. This branch hardens admin lifecycle end-to-end (panel + SourceMod + schema), then layers the admins-list UX and shared chrome work that grew while shipping it.

Soft-retire (admins.enabled)

  • Migration 811 adds :prefix_admins.enabled (1 active / 0 inactive), idempotent via information_schema.
  • JSON actions admins.deactivate / admins.reactivate flip the flag (owner + self guards).
  • Panel auth fail-closed for inactive admins (NormalAuthHandler, SteamAuthHandler, UserManager::HasAccess).
  • Sbpp\Auth\AdminsSchema probes for the column so /updater/ can boot before 811 has run.
  • SourceMod admin load in sbpp_main.sp filters a.enabled = 1.
  • Admins list chips: Active / Inactive / All.
  • Deactivate / reactivate trigger admin rehash when configured (same contract as other admin mutations).

Durable issuer attribution

  • Migration 811 also adds :prefix_bans.admin_name and :prefix_comms.admin_name, with backfill from live admins.user.
  • Panel + plugin write paths snapshot the issuer name on insert; hard delete re-snapshots before the row goes away.
  • Banlist / commslist Admin cells prefer the snapshot (or Unknown), never a misleading "deleted admin" for the issuer.
  • Export / docs updated for the new columns (Manifest format bump as needed).

Bulk actions on the admins list

  • Row checkboxes + sticky bulk bar (desktop + mobile parity).
  • admins.bulk supports deactivate | reactivate | remove | set_web_group | set_srv_group.
  • Partial results via applied / skipped; self and owner guards match single-row ops.
  • Themed group selects in the bulk bar (.ssel / overflow / flex width fixes).

Shared chrome / form UX (same branch)

  • Progressive themed single-selects (.ssel) matching multi-select (.msel) chrome; flip panels when they would overflow.
  • Add Admin and Edit Admin → Servers: server groups + individual servers as data-multiselects (g{gid} / s{sid} wire values unchanged); live hostname hydrate via Actions.ServersHostPlayers.
  • Add-admin password visibility toggle.
  • window.SBPP.confirm replaces native confirm() / several alert paths (groups, servers, protests/submissions archive, settings, edit-ban, etc.) with panel dialogs + backdrop; NativeConfirmRegressionTest pins the contract.
  • Banlist / commslist density and affordance pass (icon-only actions, inline comment chips, Steam search always substring LIKE, styled delete dialogs) — landed here as commit refine ban list and communications block list (#1546).

Docs / tooling

  • Operator docs for soft-retire + attribution (admins-and-groups, data-export notes).
  • AGENTS.md / ARCHITECTURE.md updated for the new surfaces.
  • Windows PowerShell note for running quality gates via docker compose (no ./sbpp.sh on this host).
  • Dev seeder fix for coherent admin rows.

Motivation and Context

Ex-admins need a reversible soft-retire path that does not wipe historical issuer names, and operators need multi-select lifecycle / group assign on the admins list. Hard delete alone forced either orphan "deleted" labels or keeping dead accounts live in-game. Fixes #1509.

How Has This Been Tested?

  • PHPUnit: AdminsTest, PermissionMatrixTest, AdminEnabledAttributionTest, AddAdminServerHostHydrationTest, EditAdminServersMultiselectTest, ThemedSelectEnhancerTest, NativeConfirmRegressionTest, export unit tests touched by attribution columns
  • Playwright: admin-deactivate-bulk.spec.ts (deactivate/reactivate, hard-delete issuer snapshot on banlist, bulk deactivate, bulk assign web group), plus updated admins-add-form, add-admin-server-host-hydration, admin-groups-delete, banlist/comms affordance specs
  • Contract: regenerated api-contract.js + new admin API snapshots (deactivate_*, reactivate_*, bulk_deactivate_partial)
  • Local stack: MariaDB via Docker; panel at :8080

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

Screenshots

Before

image
image
chrome_g3gLZiS0lT.mp4

After

EWq0crA4mM.mp4

image
chrome_sqOVIiBsbk.mp4

…pp#1509)

Close deactivate/reactivate polish plus admins.bulk with list checkboxes,
keeping ban/comm Admin cells on snapshot names after hard delete.
Use the same ghost icon button pattern as deactivate/delete so inactive
rows do not show a bordered labeled control.
Replace OS caret inconsistency with a progressive .ssel enhancer sharing Lucide chevron chrome with .msel, and keep narrow grid tracks from overflowing.
One eye control reveals password and confirm together; generate still resets to masked.
Open upward when there is more room above the trigger, and shrink max-height to the available viewport space.
@Rushaway

Rushaway commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

CI/CD did not pass yet @maxijabase

Comment thread web/includes/Export/Manifest.php Outdated
* entity column layout, manifest shape, or per-field contracts.
*/
public const FORMAT_VERSION = 1;
public const FORMAT_VERSION = 2;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't really be blindly bumping this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also caught my eye. Double checked and reverted it, I believe I followed AGENTS.md's instructions regarding bumping it too conservatively.

@maxijabase
maxijabase requested a review from a team August 5, 2026 19:49
@Rushaway

Rushaway commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Lgtm at the first quick look. But this pr should be merged only for 2.1.0.
We need to release 2.0.3 before. Cc @rumblefrog

@maxijabase

Copy link
Copy Markdown
Contributor Author

Lgtm at the first quick look. But this pr should be merged only for 2.1.0. We need to release 2.0.3 before. Cc @rumblefrog

I don't really think there is much else to do, so we can probably release 2.1 right away once all PRs are reviewed.

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.

Add a flag for ex-admins to avoid banned by "admin deleted" when admin has been removed

3 participants