Skip to content

Core refactoring: extract base view, color palette, add showsUnspokenTraits#319

Merged
soroushsq merged 6 commits intomainfrom
soroush/swiftui-preview-1
Mar 17, 2026
Merged

Core refactoring: extract base view, color palette, add showsUnspokenTraits#319
soroushsq merged 6 commits intomainfrom
soroush/swiftui-preview-1

Conversation

@soroushsq
Copy link
Copy Markdown
Collaborator

@soroushsq soroushsq commented Mar 11, 2026

Summary

  • Extract AccessibilitySnapshotBaseView from AccessibilitySnapshotView as a shared base class
  • Replace DefaultColors with a new AccessibilityColorPalette / ColorPalette struct
  • Add LayoutEngine and LegendLayoutMetrics as dedicated Core files
  • Add showsUnspokenTraits property to AccessibilitySnapshotConfiguration
  • Update iOSSnapshotTestCase, SnapshotTesting, and Parser adapters for the above changes

This is a preparatory refactor with no new public-facing feature. Part 1 of 3.

🤖 Generated with Claude Code

Copy link
Copy Markdown
Collaborator

@johnnewman-square johnnewman-square left a comment

Choose a reason for hiding this comment

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

This looks good!

Comment on lines +108 to +111
init(modernColors: [UIColor]) {
guard let palette = Self(colors: modernColors,
fillOpacity: 0.25,
strokeOpacity: 0.8)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor: are there any concerns with this strokeOpacity being 0.8, while public static let modern uses a strokeOpacity of 1.0?

Comment thread Sources/AccessibilitySnapshot/Core/AccessibilitySnapshotBaseView.swift Outdated
@soroushsq soroushsq marked this pull request as ready for review March 13, 2026 18:45
soroushsq and others added 6 commits March 16, 2026 17:29
…Traits

- Extract AccessibilitySnapshotBaseView from AccessibilitySnapshotView
- Replace DefaultColors with AccessibilityColorPalette (new ColorPalette struct)
- Add showsUnspokenTraits to AccessibilitySnapshotConfiguration
- Add LayoutEngine and LegendLayoutMetrics as new Core files
- Update iOSSnapshotTestCase and SnapshotTesting adapters for Core changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These files add LayoutEngine support and import AccessibilitySnapshotPreviews,
which doesn't exist in this branch yet. Restore them to their master state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ew.swift

Co-authored-by: johnnewman-square <johnnewman@squareup.com>
@soroushsq soroushsq force-pushed the soroush/swiftui-preview-1 branch from 12cac75 to b67526d Compare March 16, 2026 21:29
@soroushsq soroushsq merged commit 95f3c80 into main Mar 17, 2026
7 checks passed
@soroushsq soroushsq deleted the soroush/swiftui-preview-1 branch March 17, 2026 13:11
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.

3 participants