Skip to content

feat(admins): soft-retire, issuer names, and bulk actions - #15

Merged
maxijabase merged 24 commits into
mainfrom
feature/1509-ex-admin-deactivate
Aug 31, 2026
Merged

maxijabase merged 24 commits into
mainfrom
feature/1509-ex-admin-deactivate

Conversation

@maxijabase

Copy link
Copy Markdown
Collaborator

Port of sbpp#1549 (originally sbpp#1509).

Description

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.

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.
@github-actions

Copy link
Copy Markdown

Thanks for the PR! This change touches web/** (the SourceBans++ web panel),
which is covered by the project's Contributor License Agreement.

To sign, comment exactly the following line on this PR:

I have read the CLA Document and I hereby sign the CLA

You only need to sign once — your signature applies to every future
web-panel PR you open against this repo. Plugin-only PRs
(game/addons/sourcemod/**) don't need a signature.

See CONTRIBUTING.md
for the rationale.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@maxijabase

Copy link
Copy Markdown
Collaborator Author

recheck

Keep mods and admins mobile list rules, union spacing utilities, and the groups delete spec's trash icon plus confirm dialog. Route unsaved-group navigation through SBPP.confirm so the native confirm gate still passes.
@maxijabase
maxijabase merged commit eec18e1 into main Aug 31, 2026
9 checks passed
@maxijabase
maxijabase deleted the feature/1509-ex-admin-deactivate branch August 31, 2026 16:15
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