Skip to content

Arctic conf soroush branch#318

Draft
soroushsq wants to merge 23 commits intomainfrom
ARCtic-conf-soroush
Draft

Arctic conf soroush branch#318
soroushsq wants to merge 23 commits intomainfrom
ARCtic-conf-soroush

Conversation

@soroushsq
Copy link
Copy Markdown
Collaborator

Just checking any CI issues

RoyalPineapple and others added 23 commits March 11, 2026 15:56
New types:
- `AccessibilityRenderer` enum (.uikit, .swiftui) for selecting render backend
- `ColorPalette` with .legacy and .modern presets, unified UIColor/SwiftUI Color API
- `LegendLayoutMetrics` shared layout constants for UIKit and SwiftUI renderers
- `AccessibilitySnapshotBaseView` abstract base class for snapshot views

Changes to existing Core files:
- `AccessibilitySnapshotConfiguration` defaults to empty color array (palette handles fallback)
- `OverlayView` accepts separate fill/stroke colors from palette
- `LegendView` accepts fill color from palette
- `AccessibilitySnapshotView` uses ColorPalette for color management
- Deprecate `MarkerColors.defaultColors` in favor of `ColorPalette.legacy`

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Complete SwiftUI-based accessibility snapshot renderer:

View Components:
- `SwiftUIAccessibilitySnapshotView` - Main container for SwiftUI content
- `SwiftUIAccessibilitySnapshotContainerView` - UIKit wrapper for hosting
- `ElementView` - Overlay marker and shape rendering
- `ActivationPointView` - Crosshairs for activation points
- `DescriptionView` / `HintView` - Text content display

Legend Components:
- `SwiftUILegendView` - Multi-column legend layout
- `LegendEntryView` - Individual legend entry with marker and content
- `TraitsView` - Unspoken traits as pills (incl. supportsZoom)
- `CustomActionsView` / `CustomContentView` / `CustomRotorsView`
- `UserInputLabelsView` - Voice Control input labels

Layout Primitives:
- `PillFlowLayout` - Horizontal flow with wrapping
- `ColumnWrapLayout` - Multi-column balanced layout

Styling:
- `SwiftUIDesignTokens` - Centralized styling constants

Parser:
- Add `rotorResultLimit` support for custom rotor parsing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
FBSnapshotTestCase extensions:
- Add `renderer` parameter to `SnapshotVerifyAccessibility` functions
- Default to `.uikit` for backwards compatibility
- SwiftUI views can now specify `.swiftui` renderer
- Update `markerColors` defaults to use ColorPalette

SnapshotTesting extensions:
- Add `renderer` parameter to accessibility snapshot strategies
- Maintain existing API with default UIKit renderer

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Package.swift:
- Add SwiftUI_Experimental library target
- Add SwiftUI_Experimental dependency to iOSSnapshotTestCase

Example/Project.swift (Tuist):
- Add SwiftUI_Experimental framework target
- Add SwiftUIExperimentalDemo app target (iOS 18.0+)
- Add SwiftUIExperimentalTests test target (iOS 18.0+)
- Add SwiftUIExperimentalDemo scheme with test action
- FBSnapshotTestCase_Accessibility depends on SwiftUI_Experimental
- AccessibilitySnapshotDemo depends on SwiftUI_Experimental

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SwiftUIExperimentalDemo app:
- BasicAccessibilityDemo - Labels, values, hints, adjustable elements
- FormElementsDemo - Buttons, toggles, sliders, pickers, text fields
- CustomActionsDemo - Custom accessibility actions
- ContainersDemo - Data tables, list/landmark containers
- RotorsDemo - Custom accessibility rotors with search
- ColorPaletteDemo - Modern/legacy palette comparison
- InputLabelsDemo - Voice Control input labels
- SortPriorityDemo - Accessibility sort priority

SwiftUIExperimentalTests:
- SwiftUIExperimentalTestCase - Base class with device validation
- SwiftUIRendererTests - Snapshot tests for all demo views

AccessibilitySnapshotDemo:
- UnspokenTraitsDemoView - SwiftUI view showing unspoken traits

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reference images for SwiftUIExperimentalTests on:
- iOS 18.5 (402x874 @3x)
- iOS 26.2 (402x874 @3x)

Tests covered:
- testBasicAccessibilityDemo
- testContainersDemo
- testCustomActionsDemo
- testCustomRotorsDemo
- testInputLabelsDemo
- testSortPriorityDemo

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename AccessibilityRenderer enum to LayoutEngine
- Rename renderer: parameter to layoutEngine: in public APIs
- Rename cleanUpPreviousOverlays() to cleanup()
- Rename createOverlays(with:) to render(data:)
- Remove verbose AI-style comments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This completes the 2x2 matrix of layout engines × comparison libraries:

|                    | FBSnapshotTestCase | SnapshotTesting |
|--------------------|-------------------|-----------------|
| UIKit Layout       | ✅ Works          | ✅ Works        |
| SwiftUI Layout     | ✅ Works          | ✅ Works (NEW)  |

Changes:
- Add SwiftUI_Experimental dependency to AccessibilitySnapshot target
- Add layoutEngine parameter to .accessibilityImage() strategy
- Make LayoutEngine.default mutable for global configuration
- Consolidate SwiftUI Experimental demos from 7 to 4
- Lower SwiftUI_Experimental to iOS 16.0

Usage:
```swift
// Per-test override
assertSnapshot(of: view, as: .accessibilityImage(layoutEngine: .swiftui))

// Global default
LayoutEngine.default = .swiftui
assertSnapshot(of: view, as: .accessibilityImage())
```

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Cherry-picked from RoyalPineapple/swiftui-ui-iteration.
Changed availability from iOS 18 to iOS 16 to match project requirements.
Removed 26.0.1 test device config (not used in CI).

Original commit: effd1dc
- Rename module: SwiftUI_Experimental → AccessibilitySnapshotPreviews
- Rename demo app: SwiftUIExperimentalDemo → AccessibilitySnapshotPreviewsDemo
- Rename tests: SwiftUIExperimentalTests → AccessibilitySnapshotPreviewsTests
- Update Package.swift and Project.swift
- Update all imports
Update reference images with new test class naming and correct iOS 26.2
screen size (440x956 for iPhone 16 Pro Max).

Co-Authored-By: Claude Opus 4.5 <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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants