Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ Legend:
? = Other stuff
```

(20/10/26): Version 2.1.22-srcdslab
-----------------------
```
01. + Player drawer: the SteamID, Steam3 and Community values link to
the player's Steam Community profile
02. ? Default theme version 2.0.4
```

(20/10/26): Version 2.1.21-srcdslab
-----------------------
```
Expand Down
10 changes: 7 additions & 3 deletions web/tests/e2e/specs/responsive/drawer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,14 @@ test.describe('responsive: drawer', () => {
// `dt + dd` selector lands on the <dd> immediately after
// the matched <dt>. The <dd> contains the value text and a
// copy button (`[data-copy]`) — the assertion is that there
// is NO `<a>` descendant (which would mean an auto-detected
// link slipped in).
// is NO `tel:` / `sms:` anchor (which would mean an auto-detected
// link slipped in). The value itself IS an anchor to the Steam
// Community profile, which must survive.
const steam3Value = idGrid.locator('dt:has-text("Steam3") + dd');
await expect(steam3Value).toBeVisible();
await expect(steam3Value.locator('a')).toHaveCount(0);
await expect(steam3Value.locator('a[href^="tel:"], a[href^="sms:"]')).toHaveCount(0);
await expect(
steam3Value.locator('[data-testid="drawer-steam-profile-link"]'),
).toHaveAttribute('href', /^https:\/\/steamcommunity\.com\/profiles\/7\d{16}$/);
});
});
6 changes: 6 additions & 0 deletions web/themes/default/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,12 @@ dialog::backdrop {
has been dropped (#1208 review finding 2). */
.drawer .drawer__ids dd,
.drawer .drawer__ban dd { min-width: 0; overflow-wrap: anywhere; }
/* Steam identity values in the drawer link to the Steam Community
profile. Keep the mono value readable; the accent + underline only
show on hover / focus so the grid doesn't read as a wall of links. */
.drawer .drawer__id-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
.drawer .drawer__id-link:hover,
.drawer .drawer__id-link:focus-visible { color: var(--accent); text-decoration: underline solid; }
.drawer a[href^="tel:"],
.drawer a[href^="sms:"] { color: inherit; text-decoration: none; pointer-events: none; }
@media (max-width: 768px) {
Expand Down
16 changes: 15 additions & 1 deletion web/themes/default/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,15 @@
? player.country : '';
if (countryCode) idRows.push(['Country', countryDisplayName(countryCode) + ' (' + countryCode + ')']);

// The three Steam identity rows link to the player's Steam
// Community profile. Only a 17-digit Steam64 builds the URL, so a
// malformed authid (or an IP-only ban) renders as plain text.
const communityId = String(player.community_id || '');
const profileUrl = /^7\d{16}$/.test(communityId)
? 'https://steamcommunity.com/profiles/' + communityId
: '';
const steamRows = ['SteamID', 'Steam3', 'Community'];

const idHtml = idRows.length === 0 ? '' :
'<dl class="drawer__ids" data-testid="drawer-ids" style="display:grid;grid-template-columns:6rem 1fr;gap:0.25rem 0.75rem;margin:0;font-size:0.8125rem">'
+ idRows.map((row) =>
Expand All @@ -778,7 +787,12 @@
+ (row[0] === 'Country'
? '<img class="country-flag" src="images/country/' + countryCode.toLowerCase() + '.png" width="16" height="11" alt="" data-testid="drawer-country-flag" style="margin-right:0.375rem"> '
: '')
+ escapeHtml(row[1])
+ (profileUrl && steamRows.indexOf(row[0]) !== -1
? '<a class="drawer__id-link" href="' + escapeHtml(profileUrl) + '" target="_blank" rel="noopener noreferrer"'
+ ' data-testid="drawer-steam-profile-link" title="Open Steam profile">'
+ escapeHtml(row[1])
+ '</a>'
: escapeHtml(row[1]))
+ '<button class="btn btn--ghost btn--icon btn--xs" type="button" data-copy="' + escapeHtml(row[1]) + '" title="Copy" style="margin-left:0.25rem">'
+ '<i data-lucide="copy" style="width:12px;height:12px"></i>'
+ '</button>'
Expand Down
2 changes: 1 addition & 1 deletion web/themes/default/theme.conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// Theme version — independent of the panel's `SB_VERSION`. Bump
// when the theme's chrome / tokens change in a way fork maintainers
// should know about.
define('theme_version', '2.0.3');
define('theme_version', '2.0.4');

// Upstream link for the picker's "more info" affordance.
define('theme_link', 'https://github.com/srcdslab/sourcebans-pp');
Expand Down
Loading