Skip to content

Fix platform aspect ratio not applying in gallery view#3083

Merged
gantoine merged 2 commits intomasterfrom
copilot/fix-aspect-ratio-for-platforms
Mar 8, 2026
Merged

Fix platform aspect ratio not applying in gallery view#3083
gantoine merged 2 commits intomasterfrom
copilot/fix-aspect-ratio-for-platforms

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 8, 2026

Changing a platform's cover aspect ratio had no effect in the Platform gallery view, even though it correctly applied on the home screen. The home screen worked because galleryView.getAspectRatio() resolves aspect ratio via platformsStore.get(platformId) — but setAspectRatio() in PlatformInfoDrawer only mutated romsStore.currentPlatform, leaving platformsStore stale.

Change

  • PlatformInfoDrawer.vuesetAspectRatio(): After updating currentPlatform.value.aspect_ratio, also call platformsStore.update(currentPlatform.value) to keep the platforms store in sync. This is the same pattern already used by updatePlatform() in the same file.
if (currentPlatform.value) {
  currentPlatform.value.aspect_ratio = selectedOption.name;
  platformsStore.update(currentPlatform.value); // was missing
}
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug] Covers not appearing in proper aspect ratio in Platform viewer</issue_title>
<issue_description>RomM version
4.7.0

Describe the bug
Platforms set to aspect ratios other than the default 2:3 will not show game covers in that aspect ratio on the Platform screen.
Game covers will still show in the proper aspect ratio on the home menu.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a Platform and set it's aspect ratio to anything other than 2:3.
  2. Observe no change in the Platform screen.
  3. Go to the Home Screen and find a game from that Platform.
  4. Observe that it has the selected aspect ratio there.

Expected behavior
When I select an Aspect Ratio for a Platform, I should instantly see it take effect everywhere games from that Platform are seen. (Currently with some exceptions)

Screenshots

Image Image

Server:

  • OS: TrueNAS SCALE (Technically HexOS, but I'm not really using it)
  • Version 25.10.1

Client:

  • Device: Lenovo ThinkBook
  • OS: Windows 11 Business (I'm at work don't judge) OS Build: 26200.7922
  • Browser: Chrome
  • Version: 145.0.7632.160

Additional context
More of a feature request, but could we get this functionality to apply everywhere? As far as I could tell back in v4.6.1 games were always 2:3 when viewed.

Image

Comments on the Issue (you are @copilot in this section)

@gantoine I'm getting the issue on FF for macOS so i'll tackle this one.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…reflects new ratio immediately

Co-authored-by: gantoine <[email protected]>
Copilot AI changed the title [WIP] Fix game covers aspect ratio in Platform viewer Fix platform aspect ratio not applying in gallery view Mar 8, 2026
@gantoine gantoine marked this pull request as ready for review March 8, 2026 00:35
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 8, 2026

Greptile Summary

This PR fixes a one-line bug where changing a platform's cover aspect ratio via PlatformInfoDrawer was not reflected in the Platform gallery view. The root cause was that setAspectRatio() mutated romsStore.currentPlatform but never synced the change into platformsStore, which is what galleryView.getAspectRatio() reads from. The fix adds a single call — platformsStore.update(currentPlatform.value) — immediately after the mutation, mirroring the exact pattern already used by updatePlatform() in the same file.

  • The change is minimal (one line), targeted, and consistent with existing patterns in the codebase.
  • No new logic is introduced; the fix simply closes the synchronization gap between romsStore and platformsStore.

Confidence Score: 5/5

  • Safe to merge — minimal, targeted fix that closes a store synchronization gap using an existing, proven pattern.
  • This PR is safe to merge. The change is a single line that follows an existing, proven pattern in the same file (updatePlatform() already calls platformsStore.update() on success). The fix directly addresses the described root cause, introduces no new logic, and cannot regress unrelated behavior. The code change is verified to correctly sync platformsStore after updating the aspect ratio, which galleryView.getAspectRatio() reads from to render covers.
  • No files require special attention.

Sequence Diagram

sequenceDiagram
    participant User
    participant PlatformInfoDrawer
    participant platformApi
    participant romsStore
    participant platformsStore
    participant GalleryView

    User->>PlatformInfoDrawer: selects new aspect ratio
    PlatformInfoDrawer->>platformApi: updatePlatform({ ...platform, aspect_ratio })
    platformApi-->>PlatformInfoDrawer: success
    PlatformInfoDrawer->>romsStore: currentPlatform.aspect_ratio = selectedOption.name
    PlatformInfoDrawer->>platformsStore: update(currentPlatform) ← NEW LINE
    GalleryView->>platformsStore: getAspectRatio() → get(platformId).aspect_ratio
    platformsStore-->>GalleryView: updated aspect ratio (was stale before fix)
    GalleryView->>User: re-renders covers with correct aspect ratio
Loading

Last reviewed commit: 3384e18

@gantoine gantoine merged commit 792b939 into master Mar 8, 2026
8 checks passed
@gantoine gantoine deleted the copilot/fix-aspect-ratio-for-platforms branch March 8, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Covers not appearing in proper aspect ratio in Platform viewer

2 participants