Show game-list platform breakdown on user profiles #19

Open
opened 2024-01-14 14:24:32 -06:00 by jimmyb · 2 comments
Owner

User profiles should show a breakdown of how many games a user has listed for each platform/console.

The original issue was blocked because the old list table did not store platform IDs, making the breakdown expensive to calculate. In the current Laravel checkout, game_lists now stores platform_id, profile pages already render public user stats, and the profile sidebar already has a “My Consoles” section based on manually selected console IDs. This issue tracks adding a separate game-list platform breakdown using the actual games on the user’s list rather than the manually selected console list.

Scope

  • Public user profile pages.
  • game_lists.platform_id based counts.
  • Active/non-deleted game-list rows only.
  • Platform names/icons where available.
  • Clear distinction between “My Consoles” and “Games by Platform” breakdown.
  • Light/dark-mode UI consistent with the existing profile sidebar cards.

Acceptance Criteria

  • Public profiles show a “Games by Platform” or equivalent section when the user has active games on their list.
  • Counts are grouped by game_lists.platform_id.
  • Counts exclude soft-deleted game-list rows.
  • Counts exclude unavailable, deleted, or soft-deleted platforms where appropriate.
  • Platforms render in a stable useful order, such as highest count first with platform name as a tie-breaker.
  • Each row shows platform name and count.
  • Platform icons render where available, with the same safe fallback behavior used by profile console icons.
  • Users with no games on their list see a clear empty state or the section is hidden consistently.
  • The existing “My Consoles” manually selected platform section remains unchanged.
  • The query avoids N+1 behavior and does not require joining through games for every profile render.
  • User-facing UI supports light/dark mode and follows existing Laravel/Tailwind profile layout patterns.

Test Coverage Required

  • Feature test confirming a profile renders platform breakdown counts from game_lists.platform_id.
  • Feature test confirming counts are grouped correctly across multiple platforms.
  • Feature test confirming soft-deleted game-list rows are excluded.
  • Feature test confirming missing, deleted, or soft-deleted platforms do not break profile rendering.
  • Regression test confirming ordering is stable by count and platform name.
  • Regression test confirming platform icons and fallback text render correctly.
  • Regression test confirming the existing “My Consoles” section remains based on console_lists and is not replaced by the breakdown.
  • Tests should use Pest and focused profile feature coverage.
  • Run the focused affected tests, then run vendor/bin/pint --dirty before closing the issue.

Progress Checklist

  • Public user profile page exists
  • Profile sidebar stats section exists
  • “My Consoles” profile section exists
  • game_lists.platform_id exists and is indexed
  • Game list create/update paths populate platform_id
  • Platform icon URL helper exists on the profile controller
  • Add grouped platform-count query for active user game-list rows
  • Pass platform breakdown data to the profile view
  • Render Games by Platform profile section with icons/counts/fallbacks
  • Keep My Consoles separate from game-list platform counts
  • Handle empty lists and unavailable platforms
  • Add tests for counts, ordering, filtering, icons, fallback rendering, and existing console-list behavior
  • Confirm the breakdown is efficient and profile rendering remains fast
User profiles should show a breakdown of how many games a user has listed for each platform/console. The original issue was blocked because the old list table did not store platform IDs, making the breakdown expensive to calculate. In the current Laravel checkout, `game_lists` now stores `platform_id`, profile pages already render public user stats, and the profile sidebar already has a “My Consoles” section based on manually selected console IDs. This issue tracks adding a separate game-list platform breakdown using the actual games on the user’s list rather than the manually selected console list. ## Scope - Public user profile pages. - `game_lists.platform_id` based counts. - Active/non-deleted game-list rows only. - Platform names/icons where available. - Clear distinction between “My Consoles” and “Games by Platform” breakdown. - Light/dark-mode UI consistent with the existing profile sidebar cards. ## Acceptance Criteria - Public profiles show a “Games by Platform” or equivalent section when the user has active games on their list. - Counts are grouped by `game_lists.platform_id`. - Counts exclude soft-deleted game-list rows. - Counts exclude unavailable, deleted, or soft-deleted platforms where appropriate. - Platforms render in a stable useful order, such as highest count first with platform name as a tie-breaker. - Each row shows platform name and count. - Platform icons render where available, with the same safe fallback behavior used by profile console icons. - Users with no games on their list see a clear empty state or the section is hidden consistently. - The existing “My Consoles” manually selected platform section remains unchanged. - The query avoids N+1 behavior and does not require joining through games for every profile render. - User-facing UI supports light/dark mode and follows existing Laravel/Tailwind profile layout patterns. ## Test Coverage Required - Feature test confirming a profile renders platform breakdown counts from `game_lists.platform_id`. - Feature test confirming counts are grouped correctly across multiple platforms. - Feature test confirming soft-deleted game-list rows are excluded. - Feature test confirming missing, deleted, or soft-deleted platforms do not break profile rendering. - Regression test confirming ordering is stable by count and platform name. - Regression test confirming platform icons and fallback text render correctly. - Regression test confirming the existing “My Consoles” section remains based on `console_lists` and is not replaced by the breakdown. - Tests should use Pest and focused profile feature coverage. - Run the focused affected tests, then run `vendor/bin/pint --dirty` before closing the issue. ## Progress Checklist - [x] Public user profile page exists - [x] Profile sidebar stats section exists - [x] “My Consoles” profile section exists - [x] `game_lists.platform_id` exists and is indexed - [x] Game list create/update paths populate `platform_id` - [x] Platform icon URL helper exists on the profile controller - [ ] Add grouped platform-count query for active user game-list rows - [ ] Pass platform breakdown data to the profile view - [ ] Render Games by Platform profile section with icons/counts/fallbacks - [ ] Keep My Consoles separate from game-list platform counts - [ ] Handle empty lists and unavailable platforms - [ ] Add tests for counts, ordering, filtering, icons, fallback rendering, and existing console-list behavior - [ ] Confirm the breakdown is efficient and profile rendering remains fast
Author
Owner

After working on this, I would not recommend we move forward with this one at this time. It's going to be extremely expensive on resources given the way the database is currently set up. Currently, we have no relationship of platforms in the lists table so we would need to fetch this information from another table. It would likely be best to start storing the platform ID in the lists table so it could be more quickly referenced.

We could likely write a script to add this platform data into the table once the field has been added.

After working on this, I would not recommend we move forward with this one at this time. It's going to be extremely expensive on resources given the way the database is currently set up. Currently, we have no relationship of platforms in the `lists` table so we would need to fetch this information from another table. It would likely be best to start storing the platform ID in the `lists` table so it could be more quickly referenced. We could likely write a script to add this platform data into the table once the field has been added.
Author
Owner

Moving this back as it's going to require more thought and time than I currently have at the moment.

Moving this back as it's going to require more thought and time than I currently have at the moment.
Codex changed title from Add Console Breakdown on User Profiles to Show game-list platform breakdown on user profiles 2026-05-26 00:37:13 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
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#19
No description provided.