Skip to content

feat: add SwiftUI rendering support#706

Draft
BBC6BAE9 wants to merge 18 commits intogoogle:mainfrom
BBC6BAE9:feat/swiftui-renderer
Draft

feat: add SwiftUI rendering support#706
BBC6BAE9 wants to merge 18 commits intogoogle:mainfrom
BBC6BAE9:feat/swiftui-renderer

Conversation

@BBC6BAE9
Copy link

@BBC6BAE9 BBC6BAE9 commented Feb 24, 2026

Description

Add a native SwiftUI renderer for the A2UI protocol, enabling all Apple platforms (iOS 17+, macOS 14+, tvOS 17+, watchOS 10+, visionOS 1+) to render agent-generated UI from A2UI JSON payloads into native SwiftUI views..

#680

Pre-launch Checklist

If you need help, consider asking for advice on the discussion board.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive and well-architected SwiftUI renderer for A2UI. The use of modern SwiftUI features like @Observable and the Layout protocol is excellent, and the extensive test suite provides great coverage. I've identified a few critical issues related to error handling where errors are silently ignored, which could make debugging difficult. I've also suggested refactoring a particularly complex function to improve its maintainability and efficiency. Addressing these points will significantly enhance the robustness of the new renderer. Additionally, please note that the PR description template should be filled out as per the repository's contributing guidelines.

@BBC6BAE9 BBC6BAE9 changed the title feat: swiftUI render feat: add SwiftUI rendering support Feb 24, 2026
@BBC6BAE9 BBC6BAE9 force-pushed the feat/swiftui-renderer branch from 544281f to a10fea0 Compare February 24, 2026 18:50
Implements a complete native SwiftUI renderer covering the full A2UI v0.8
protocol: JSONL stream parsing, surface management, data binding with
path resolution, template expansion, action handling, and all 18
standard component types.

Includes 71 unit tests, a demo app with catalog/samples/live-agent
modes, an A2A networking client, and full Apple platform support
(iOS, macOS, tvOS, watchOS, visionOS) with conditional compilation.
@BBC6BAE9 BBC6BAE9 force-pushed the feat/swiftui-renderer branch from f3e04e6 to 73f0426 Compare February 24, 2026 19:16
@BBC6BAE9 BBC6BAE9 marked this pull request as draft February 25, 2026 09:26
@BBC6BAE9 BBC6BAE9 force-pushed the feat/swiftui-renderer branch from 0220bf2 to 0193e32 Compare February 25, 2026 15:50
@BBC6BAE9 BBC6BAE9 force-pushed the feat/swiftui-renderer branch from 0193e32 to 1a2ea60 Compare February 25, 2026 15:51
@BBC6BAE9 BBC6BAE9 marked this pull request as ready for review February 25, 2026 15:55
@BBC6BAE9 BBC6BAE9 marked this pull request as draft February 26, 2026 01:17
- Add ChecksEvaluator with 8 standard functions: required, email,
  regex, length, numeric, and, or, not (with nested composition)
- Integrate checks into all input components (TextField, CheckBox,
  Slider, DateTimeInput, ChoicePicker) with error message display
- Add Button checks support for auto-disable when validation fails
- Add contact_form.json sample based on official v0.9 spec test case
- Remove Live Agent tab (previously deleted feature)
- Add swiftui-component-review and swiftui-demo-roadmap docs

Made-with: Cursor
BBC6BAE9 and others added 5 commits February 26, 2026 21:10
- Switch Contact Lookup to AgentChatPage for conversational interface
- Merge Live Agent Card/Chat sections into single Live Agent section
- Fix SSE parser to handle single-line events without empty line separators
- Support both JSON-RPC wrapped and bare A2A event formats in streaming
- Add artifact.parts path to extractParts for streaming artifact events
- Auto-send initialQuery after connection in AgentChatPage
- Add CatalogFunctionEvaluator with formatString, formatNumber,
  formatCurrency, formatDate, pluralize, and openUrl
- Support FunctionCall in DynamicString/DynamicNumber/DynamicBoolean
  resolution (StringValue, NumberValue, BooleanValue)
- Add Button functionCall action for client-side execution (e.g. openUrl)
- Add accessibility attributes (label/description) parsing and rendering
- Add Icon custom SVG path support via SVGPathShape
- Support v0.10 ChildList template `path` key alongside v0.8 `dataBinding`
IconNameValue decoder incorrectly treated v0.8 {"literalString":"home"}
dictionaries as empty StringValue, causing all 59 standard icons to
show as questionmark.diamond fallback. Now delegates dictionary
decoding to StringValue and only treats {"path":"M..."} as SVG when
the value starts with an SVG move command.

Also updates AgentCardPage with hero/loading/result flow, fixes A2A
action payload structure, and adds SurfaceManager.clearAll().
- Add `.custom(String)` case to `ComponentType` for unknown component types
- Implement `CustomComponentRegistry` with environment-based renderer injection
- Handle flat dotted/bracket keys in `dataModelUpdate` (e.g. `chart.items[0].label`)
- Auto-create/extend arrays in `setValue` for nested data paths
- Remove throw on unknown components; resolve custom children from properties
- Fix A2A catalog negotiation: correct standard catalog ID and prefer custom catalogs
- Add `RizzchartChartView` (Swift Charts doughnut with drill-down)
- Add `RizzchartMapView` (MapKit with markers)
- Add `RizzchartsPage` static demo and live agent integration
- Add Chart/Map entries to CatalogPage
- Support `customRenderer` in `AgentChatPage` and `AgentCardPage`

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant