Skip to content

Render screens with an empty .safeAreaBar - #35

Merged
JosipAbacus merged 1 commit into
mainfrom
fix/render-empty-safe-area-bar
Oct 25, 2026
Merged

JosipAbacus merged 1 commit into
mainfrom
fix/render-empty-safe-area-bar

Conversation

@JosipAbacus

Copy link
Copy Markdown
Contributor

Fixes #30.

A screen with a .safeAreaBar whose content has no accessibility element failed with a bare "render failed". SwiftUI leaves an element with no frame for such a bar ({{inf, inf}, {0, 0}}), the kit put its inf frame in the tree, JSONEncoder refused it, and the kit answered {"ok":false} with nothing else.

  • The kit leaves out elements with no frame, since they're not on screen.
  • When the kit can't encode a reply it sends the encoder's error instead of a bare ok: false.
  • For apps still on an older kit, render and act explain the bare reply: "render failed: the host couldn't send the screen, most likely because an element on it has no frame (an empty .safeAreaBar, say); simless init updates SimlessKit, which leaves those out".

The reporter's five fixtures now render as expected: the three empty bars show "Body" only, and the text bar shows "Body" and "Bar". Demo app has the pattern from the report (CheckoutView: the action in a bar at regular sizes, inline at accessibility sizes, so the bar stays attached and empty). CheckoutView.Inline failed before and renders now, and CI renders it with render all and checks its button.

Users get the kit fix with simless init. Thanks @laplacacm for the clear repro.

@JosipAbacus
JosipAbacus merged commit d614181 into main Oct 25, 2026
5 checks passed
@JosipAbacus
JosipAbacus deleted the fix/render-empty-safe-area-bar branch October 25, 2026 20:03
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.

render fails with a bare "render failed" when a .safeAreaBar has no accessibility element

1 participant