fix(stats): open game detail pages from stat lists, perfect games clickable

Add perfect games click-through on the dashboard. Remove Steam store
links from game lists. Stat numbers with count 0 are not clickable.
Tests cover the perfect-games click, zero guards, and owner versus
visitor behavior.
This commit is contained in:
lobo committed 2026-10-04 10:07:27 +02:00
1 parent 777ba87fd6
commit 8b94a25844
27 files changed
+270 -51

No files matched your search

+1 -5
View File
@@ -47,8 +47,4 @@ export async function fetchStatGames(source, params, ticket) {
export const libraryLink = (status) => `/library?hideDuplicates=true${status ? `&status=${status}` : ''}`;
// A visitor has no game page of the owner; the Steam store is the only public one. Manual games have no appid there.
export const gameHref = (appid, own) => {
if (own) return `/library/${appid}`;
return appid > 0 ? `https://store.steampowered.com/app/${appid}` : null;
};
export const gameHref = (appid) => `/library/${appid}`;
+3 -4
View File
@@ -27,9 +27,8 @@ describe('libraryLink', () => {
});
describe('gameHref', () => {
it('own_LinksTheLibraryPage', () => expect(gameHref(5, true)).toBe('/library/5'));
it('visitor_LinksTheStoreOnlyForSteamApps', () => {
expect(gameHref(5, false)).toBe('https://store.steampowered.com/app/5');
expect(gameHref(-3, false)).toBeNull();
it('linksTheLibraryPage', () => {
expect(gameHref(5)).toBe('/library/5');
expect(gameHref(-3)).toBe('/library/-3');
});
});