fix(admin-servers): surface copyable Server ID on server cards (#1504)#1523
Merged
Conversation
The v2.0 card-grid rewrite of the admin Servers list dropped the numeric Server ID from view, but the SourceMod plugin's sourcebans.cfg and the setup docs both tell operators to find it "in the admin panel -> servers". Add a labelled, copyable "Server ID" row to each server card so operators can wire the plugin's ServerID field without guessing. - page_admin_servers_list.tpl: labelled Server ID row + copy button (rides the existing document-level [data-copy] delegate in theme.js) - docs: point adding-server.md + quickstart.mdx at the card's Server ID (was a nonexistent "ID column"); fix the admin nav label (Servers, not Server Settings) - tests: PHPUnit markup contract (enabled + disabled tiles) + E2E render + critical-a11y coverage of the populated card
rumblefrog
enabled auto-merge
July 5, 2026 00:10
rumblefrog
disabled auto-merge
July 5, 2026 00:10
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Fixes #1504.
The SourceMod plugin's
sourcebans.cfgServerIDfield carries the inline comment "Check in the admin panel -> servers to find the ID of this server", and the setup docs tell operators to note the ID after adding a server. But the v2.0 card-grid rewrite ofpage_admin_servers_list.tplnever printed thesidanywhere an operator could read it (it only lived inside RCON/Edit/Admins hrefs and a muted no-icon fallback glyph). Operators had no way to find the value the plugin needs.This adds a labelled, copyable Server ID row to each server card:
web/themes/default/page_admin_servers_list.tpl— aServer ID<dt>/<dd>as the first row of each card's<dl>, with a monospace value span and a copy button that rides the existing document-level[data-copy]delegate intheme.js(secure-context clipboard +execCommandfallback). Button chrome uses the compliantbtn btn--ghost btn--icon btn--xschain, matching the sibling refresh button. Also swapped a pre-existing emdash in the "Disabled" pilltitlefor parens (user-facing-text rule).setup/adding-server.md+getting-started/quickstart.mdxnow point at the card's Server ID (previously referenced a nonexistent "ID column"/"row") and mention the copy button. Corrected the admin nav label to Servers (the actual nav entry; was "Server Settings").No backend/schema change:
sidis the existingintPK already carried throughAdminServersListViewto the template, and it's not user-controlled (Smarty global auto-escape covers the attribute/value renders regardless).Test plan
AdminServersListHydrationTest::testTileRendersCopyableServerId— asserts theserver-idtestid, the numeric value span, thedata-copy="<sid>"copy button (order-independent regex), and the visible<dt>Server ID</dt>label across both enabled and disabled tiles.flows/admin-server-id.spec.ts— seeds a server via theservers.addJSON API, then asserts the populated card renders the labelled Server ID row + value + copy-button payload, and runs the critical-axe gate on the populated card (the existing smoke spec only axe-checks the empty state)../sbpp.sh phpstan— clean (includes SmartyTemplateRule)../sbpp.sh test tests/integration/AdminServersListHydrationTest.php tests/integration/ButtonClassChainTest.php— green../sbpp.sh ts-check+tsc --noEmiton the E2E suite — clean for the touched files.Follow-ups (out of scope)
sid(operators land there too); the plugin comment points at the list, which this PR covers.