Conversation
There was a problem hiding this comment.
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.
renderers/swiftui/Sources/A2UISwiftUI/Models/ComponentTypes.swift
Outdated
Show resolved
Hide resolved
renderers/swiftui/Sources/A2UISwiftUI/Processing/SurfaceViewModel.swift
Outdated
Show resolved
Hide resolved
f3e04e6 to
73f0426
Compare
0193e32 to
1a2ea60
Compare
Implements a complete native SwiftUI renderer covering the full A2UI protocol: JSONL stream parsing, surface management, data binding with path resolution, template expansion, action handling, and all standard component types. Includes: - ChecksEvaluator with validation engine (required, email, regex, etc.) - CatalogFunctionEvaluator (formatString, formatNumber, formatCurrency, etc.) - Custom component support with CustomComponentRegistry - A2A networking client with SSE streaming - Icon SVG path support, accessibility attributes - RizzCharts demo (Swift Charts + MapKit) - Demo app with catalog/samples/live-agent modes - Full Apple platform support (iOS, macOS, tvOS, watchOS, visionOS) - 71+ unit tests
71513e2 to
ed589dc
Compare
- Rename renderers/swiftui/ → renderers/swift/, module A2UISwiftUI → A2UI to align with repo naming convention (angular, lit, flutter, swift) - Move demo app to samples/client/swift/ matching repo convention - Split tests into 5 focused files (84 tests, 74% core logic coverage) - Extract shared helpers in A2AClient (buildJSONRPCBody, parseSSEStream) - Fix README installation path and test count
d9a3ef5 to
2a7a618
Compare
Move data storage, path resolution, and read/write logic into a dedicated DataStore class to reduce SurfaceViewModel from 968 to 785 lines. Thin delegation methods preserve the existing public API so no call sites or tests require changes.
Align directory naming with framework convention (angular/, lit/, flutter/) rather than language name. Update path references in Xcode project, README, and docs. SPM module name A2UI remains unchanged.
28fda9e to
0ba163b
Compare
|
Hi @dmandar @gspencergoog @jacobsimionato @nan-yu @ditman @zeroasterisk @yjbanov — ready for review. Feedback welcome, happy to address any questions or concerns. |
Description
Native SwiftUI renderer for the A2UI protocol, enabling all Apple platforms to render agent-generated UI from A2UI JSON payloads into native SwiftUI views.
Resolves #680.
iOS 17+,macOS 14+,watchOS 10+,visionOS 1+、tvOS 17+formatString,formatNumber,formatCurrency,formatDate,pluralize,openUrl,required,email,regex,length,numeric,and,or,notCustomComponentRegistry@Observablewith per-keyObservableValuefor fine-grained SwiftUI updatesLazyVStack/LazyHStackfor scroll performanceAsyncThrowingStream-based JSONL parserA2UIStyle)AccessibilityModifierapplies labels/hints from component metadataTest coverage (core logic modules)
View layer (SwiftUI components) is not unit-testable without a host app — covered by the demo app's 11 pages.
All files are new additions. No existing files on
google:mainwere modified.Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.