Skip to content

Allow action and dynamicLayout as root template nodes#30

Merged
BernardGatt merged 5 commits into
mainfrom
root-container-types
May 29, 2026
Merged

Allow action and dynamicLayout as root template nodes#30
BernardGatt merged 5 commits into
mainfrom
root-container-types

Conversation

@BernardGatt

Copy link
Copy Markdown
Collaborator

Summary

  • Adds rootNode schema definition allowing layout, action, and dynamicLayout as root — previously only layout was permitted
  • New "card" example template demonstrating action-as-root across all three platforms
  • Fixes iOS renderer: horizontal layout children now expand to fill remaining space (matching web flex:1 and Android weight(1f)), and action view uses VStack + onTapGesture instead of Button so width propagates correctly
  • All iOS and Android snapshots re-recorded

Changes

  • Spec/SchemarootNode oneOf definition, updated root description
  • iOS RendererJistActionView rewritten as tappable VStack; JistLayoutView gains needsFlex for horizontal layout children; JistView applies full-width frame to root node
  • Shared fixtures — new card template + data added to templates.json/data.json
  • Example apps — all three (web, iOS, Android) updated with card template
  • Tests — card snapshot tests added (light + dark) on both iOS and Android

Test plan

  • iOS snapshot tests pass (20/20)
  • Android Paparazzi snapshot tests pass
  • Schema validates: card (action root) valid, existing templates valid, leaf-as-root rejected
  • All three example apps render card template correctly
  • Web example verified in browser

🤖 Generated with Claude Code

Bernard Gatt and others added 5 commits May 28, 2026 17:59
The template schema previously restricted root to layout nodes only.
This adds a rootNode definition that allows all three container types
(layout, action, dynamicLayout) as root, with a new "card" example
template demonstrating action-as-root.

Fixes iOS renderer to properly expand horizontal layout children
(matching web flex:1 and Android weight(1f)) and replaces the Button-
based action view with a VStack + onTapGesture so width propagates
correctly to children.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The renderer changes (needsFlex, action view rewrite) affect existing
templates but snapshots should be re-recorded on CI to match the pinned
runner environment. Only the new card snapshots are included.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Paparazzi's layoutlib can't render Coil AsyncImage content, so images
were blank in all Android snapshots. Switched to LocalJistImageProvider
with a synchronous ImageBitmap placeholder, bypassing AsyncImage
entirely. Removed unused coil-test dependency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@BernardGatt BernardGatt merged commit 87eb749 into main May 29, 2026
6 checks passed
@BernardGatt BernardGatt deleted the root-container-types branch May 29, 2026 10:40
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