Skip to content

fix(ui): Skip EDR Metal path on iOS Simulator - #118

Merged
philprime merged 1 commit into
mainfrom
fix/edr-qr-simulator-fallback
Apr 21, 2026
Merged

fix(ui): Skip EDR Metal path on iOS Simulator#118
philprime merged 1 commit into
mainfrom
fix/edr-qr-simulator-fallback

Conversation

@philprime

Copy link
Copy Markdown
Member

EDRMetalView.isSupported checked MTLCreateSystemDefaultDevice() != nil, which returns true on Apple Silicon iOS Simulator hosts. As a result, LinkDetailRenderView rendered the QR code through an MTKView on the simulator, which broke two things:

  1. Screenshot UI test at ScreenshotUITests.swift:97app.images["link-detail.qr-code.container"] can't find the container because the wrapping VStack no longer exposes as an accessibility image element when its child is an MTKView.
  2. App Store screenshotsMTKView doesn't render reliably into XCUIScreenshot PNGs, so the QR screen screenshot would be blank/incorrect even if the assertion weren't looking for .images.

Introduced by #116 (EDR bright display for QR codes).

isSupported now returns false under #if targetEnvironment(simulator), falling back to the SwiftUI Image(uiImage:) path. Real devices still get EDR Metal rendering.

This has been silently broken on main since #116 landed: the PR-level Screenshots job runs generate_screenshots_cifastlane capture_screenshots, which reports test failures in its own results table (❌) but still exits 0 and prints ✅ generated successfully. The failure surfaced now because the new parallel screenshot pipeline on #113 uses run_tests with fail_build: true. generate_screenshots_ci should be hardened to propagate test failures — tracking separately.

Unblocks #113.

MTLCreateSystemDefaultDevice() returns a valid device on Apple Silicon
iOS Simulator hosts, so EDRMetalView.isSupported returned true and
LinkDetailRenderView rendered the QR code through an MTKView. In the
simulator, Metal-backed views don't capture reliably via XCUIScreenshot
and the wrapping VStack stops exposing as an accessibility image,
which broke ScreenshotUITests.testScreenshots at the
"link-detail.qr-code.container" lookup. Always return false on
simulator so the SwiftUI Image(uiImage:) fallback is used.

This has been silently broken on main since #116 landed because the
build-test.yml Screenshots job (generate_screenshots_ci / capture_screenshots
on a single device) doesn't fail the lane on test failure.
@philprime
philprime enabled auto-merge (squash) April 21, 2026 16:46
@sentry

sentry Bot commented Apr 21, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
Flinky com.techprimate.Flinky 1.1.3 (52) --

⚙️ flinky Build Distribution Settings

@philprime
philprime disabled auto-merge April 21, 2026 18:18
@philprime
philprime merged commit 61fccd7 into main Apr 21, 2026
6 of 7 checks passed
@philprime
philprime deleted the fix/edr-qr-simulator-fallback branch April 21, 2026 18:18
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.

1 participant