Fix Localhost Links in Most Popular Game Cards #765

Closed
opened 2026-06-19 14:22:04 -05:00 by Veilor · 2 comments
Member

The most popular game cards should link to real MyVideoGameList game and platform pages, not localhost URLs that only work in a local development environment.

The current-year and upcoming popular game cards are shown across public pages, so broken host-specific links make the ranked game lists unusable for visitors even when the card content renders correctly.

Scope

  • Current-year Most Popular Games card links.
  • Most Popular Upcoming Games card links.
  • Generated game detail URLs used for title and box art links.
  • Generated platform URLs shown under popular game rows.
  • Existing populated and empty-state card layouts.

Acceptance Criteria

  • Game title links in both popular cards navigate to the correct game detail route.
  • Box art links in both popular cards use the same valid game detail route as the title.
  • Platform links continue to navigate to the correct platform route when platform metadata is present.
  • Rendered popular-card HTML does not contain hardcoded localhost URLs.
  • Empty popular-card states continue to render when no games qualify.
  • The existing public page layout and light/dark styling are preserved.

Test Coverage Required

  • Extend MostPopularGamesCardTest to assert current-year game links are route-based and do not contain localhost.
  • Extend MostPopularUpcomingGamesCardTest to assert upcoming game links are route-based and do not contain localhost.
  • Preserve existing assertions for platform links, box art, ranking order, and empty states.
  • Run the focused popular-game card tests before closing the issue.
  • Run vendor/bin/pint --dirty --format agent before implementation closeout if PHP files change.

Progress Checklist

  • Identify where cached popular-game URLs are generated
  • Fix current-year popular game URL generation or rendering
  • Fix upcoming popular game URL generation or rendering
  • Confirm platform links remain valid
  • Add localhost regression coverage for both popular cards
  • Run focused popular-game card tests
  • Run vendor/bin/pint --dirty --format agent if PHP files changed
  • Move the issue out of Codex review once verification is complete
The most popular game cards should link to real MyVideoGameList game and platform pages, not localhost URLs that only work in a local development environment. The current-year and upcoming popular game cards are shown across public pages, so broken host-specific links make the ranked game lists unusable for visitors even when the card content renders correctly. ## Scope - Current-year Most Popular Games card links. - Most Popular Upcoming Games card links. - Generated game detail URLs used for title and box art links. - Generated platform URLs shown under popular game rows. - Existing populated and empty-state card layouts. ## Acceptance Criteria - Game title links in both popular cards navigate to the correct game detail route. - Box art links in both popular cards use the same valid game detail route as the title. - Platform links continue to navigate to the correct platform route when platform metadata is present. - Rendered popular-card HTML does not contain hardcoded localhost URLs. - Empty popular-card states continue to render when no games qualify. - The existing public page layout and light/dark styling are preserved. ## Test Coverage Required - Extend `MostPopularGamesCardTest` to assert current-year game links are route-based and do not contain `localhost`. - Extend `MostPopularUpcomingGamesCardTest` to assert upcoming game links are route-based and do not contain `localhost`. - Preserve existing assertions for platform links, box art, ranking order, and empty states. - Run the focused popular-game card tests before closing the issue. - Run `vendor/bin/pint --dirty --format agent` before implementation closeout if PHP files change. ## Progress Checklist - [x] Identify where cached popular-game URLs are generated - [x] Fix current-year popular game URL generation or rendering - [x] Fix upcoming popular game URL generation or rendering - [x] Confirm platform links remain valid - [x] Add localhost regression coverage for both popular cards - [x] Run focused popular-game card tests - [x] Run `vendor/bin/pint --dirty --format agent` if PHP files changed - [x] Move the issue out of Codex review once verification is complete
Codex changed title from The links in both most popular lists are set to localhost to Fix Localhost Links in Most Popular Game Cards 2026-06-19 14:43:32 -05:00
Codex self-assigned this 2026-06-19 17:02:18 -05:00
Member

Implemented in dev commit 982d9b3.

Summary:

  • Popular game metadata now stores root-relative game and platform route URLs instead of APP_URL-derived absolute URLs.
  • Current-year popular cache keys were bumped to v2 and upcoming popular cache keys to v4 to avoid reusing cached localhost links.
  • Current-year and upcoming card tests now assert title and box art share the same game href, platform links remain valid, and each card fragment does not contain localhost.

Verification:

  • php artisan test --compact tests/Feature/MostPopularGamesCardTest.php tests/Feature/MostPopularUpcomingGamesCardTest.php
  • vendor/bin/pint --dirty --format agent
Implemented in dev commit 982d9b3. Summary: - Popular game metadata now stores root-relative game and platform route URLs instead of APP_URL-derived absolute URLs. - Current-year popular cache keys were bumped to v2 and upcoming popular cache keys to v4 to avoid reusing cached localhost links. - Current-year and upcoming card tests now assert title and box art share the same game href, platform links remain valid, and each card fragment does not contain localhost. Verification: - php artisan test --compact tests/Feature/MostPopularGamesCardTest.php tests/Feature/MostPopularUpcomingGamesCardTest.php - vendor/bin/pint --dirty --format agent
Member

Final review notes:

  • The fix landed in dev at commit 982d9b3.
  • Current-year popular game links are generated by App\Support\PopularGameRanker; upcoming popular game links are generated by App\Support\UpcomingPopularGames.
  • Both services now store root-relative games.show and platform.show route URLs, so cached card metadata no longer depends on APP_URL and cannot cache http://localhost links for visitors.
  • Cache keys were intentionally bumped to site:most-popular-games:v2:* and site:most-popular-upcoming-games:v4:* so old cached absolute URLs are bypassed.
  • The rendered-card regression assertions are scoped to the popular-card fragments because the full homepage can include unrelated localhost strings from normal app configuration/assets in local test runs.

Verification re-run during review:

  • php artisan test --compact tests/Feature/MostPopularGamesCardTest.php tests/Feature/MostPopularUpcomingGamesCardTest.php — 12 passed, 102 assertions
  • vendor/bin/pint --dirty --format agent — passed
Final review notes: - The fix landed in `dev` at commit `982d9b3`. - Current-year popular game links are generated by `App\Support\PopularGameRanker`; upcoming popular game links are generated by `App\Support\UpcomingPopularGames`. - Both services now store root-relative `games.show` and `platform.show` route URLs, so cached card metadata no longer depends on `APP_URL` and cannot cache `http://localhost` links for visitors. - Cache keys were intentionally bumped to `site:most-popular-games:v2:*` and `site:most-popular-upcoming-games:v4:*` so old cached absolute URLs are bypassed. - The rendered-card regression assertions are scoped to the popular-card fragments because the full homepage can include unrelated localhost strings from normal app configuration/assets in local test runs. Verification re-run during review: - `php artisan test --compact tests/Feature/MostPopularGamesCardTest.php tests/Feature/MostPopularUpcomingGamesCardTest.php` — 12 passed, 102 assertions - `vendor/bin/pint --dirty --format agent` — passed
Codex 2026-06-19 19:14:06 -05:00
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#765
No description provided.