Skip to content

Fix blank error screen for unrecognized deck aspect ratios#2360

Merged
NKoech123 merged 5 commits into
mainfrom
ai_main_817488067b3c41ac805f
Jul 23, 2026
Merged

Fix blank error screen for unrecognized deck aspect ratios#2360
NKoech123 merged 5 commits into
mainfrom
ai_main_817488067b3c41ac805f

Conversation

@NKoech123

@NKoech123 NKoech123 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a crash that produced a blank error screen when opening or refining a deck with an unrecognized aspect ratio.

Problem

When a deck had an aspect ratio value that wasn't one of the recognized presets, getAspectRatioDims would return undefined, which caused the app to crash with a blank error screen instead of rendering the deck.

Solution

Made getAspectRatioDims resilient to unknown or invalid aspect ratio values by falling back to the default (16:9) instead of returning undefined. Also tightened the patch-deck action's validation so aspect ratio values are constrained to the known set at the API boundary.

Key Changes

  • getAspectRatioDims now falls back to ASPECT_RATIOS["16:9"] for any falsy or unrecognized aspect ratio input, rather than returning undefined.
  • patch-deck.ts now validates aspectRatio against ASPECT_RATIO_VALUES using a Zod enum instead of a plain string, preventing invalid values from being persisted.
  • Updated tests in aspect-ratios.test.ts to reflect the new fallback behavior for bogus and empty string values.
  • Added a changelog entry documenting the fix.

Edit in Builder  Preview


To clone this PR locally use the Github CLI with command gh pr checkout 2360

You can tag me at @BuilderIO for anything you want me to fix or change

@builder-io-integration builder-io-integration Bot changed the title Update from the Builder.io agent Fix blank error screen for unrecognized deck aspect ratios Jul 23, 2026
@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes — looks good ✅

Review Details

Incremental Code Review Summary

The updated PR addresses the previous review finding correctly. getAspectRatioDims now checks that a ratio is an own property of ASPECT_RATIOS, so malformed legacy values such as toString, constructor, and hasOwnProperty safely fall back to 16:9 rather than returning inherited functions. The added regression tests cover those keys along with unknown and empty values, while the shared Zod enum continues to constrain new patch-deck writes.

Two independent incremental reviews found no new reportable bugs; one noted only a low-severity cleanup opportunity in an unmodified PDF export caller (an outdated comment/dead nullish fallback), which is not actionable in this PR and is below the review threshold. One reviewer also reported that the full focused suite passed: 68 files and 353 tests, with formatting passing.

Risk remains standard because this changes shared rendering/export behavior and an action validation boundary. The previously reported inherited-key issue has been fixed and its review thread was resolved.

🧪 Browser testing: Will run after this review (PR touches UI code)

@NKoech123
NKoech123 requested a review from shomix July 23, 2026 19:34
@NKoech123
NKoech123 merged commit b1c9b9d into main Jul 23, 2026
51 checks passed
@NKoech123
NKoech123 deleted the ai_main_817488067b3c41ac805f branch July 23, 2026 19:56
@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

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.

3 participants