macOS button text differs from SwiftUI in interaction snapshots
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
Hướng nghiên cứu
Bắt đầu với renderKeyedText, được xác định trong issue là dùng màu trắng để vẽ mặt nạ văn bản chỉ có alpha; so sánh cách nó sử dụng màu nền trước đã phân giải. Sau đó chạy ButtonInteractionTests khi tắt cập nhật tham chiếu và kiểm tra các trường hợp snapshot bật và tắt. Hoàn tất khi cả sáu ảnh chụp khớp với các tham chiếu SwiftUI.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
Default button labels rendered by OpenSwiftUI differ from SwiftUI at the glyph
edges on macOS. Both enabled and disabled buttons are affected. The differences
remain when the reference and actual images use the same macOS version.
Button actions work: repeated presses update the count, and disabled buttons do
not run their actions. The failures are snapshot mismatches, with no crash.
Reproduction
- Platform: macOS 15.7.3 (24G419), arm64.
- Configuration: OpenSwiftUI renderer with IAG.
- References: SwiftUI snapshots recorded on macOS 15.7.3.
- Source: The Button implementation merged in #1138.
Run the existing
ButtonInteractionTests
with reference updates disabled. The two cases capture the initial appearance
and the appearance after each of two presses:
actionUpdatesCount: The enabled button displays counts 0, 1, and 2.disabledButtonDoesNotRunAction: The disabled button keeps count 0.
Expected and actual results
All six captures should match the SwiftUI references. Instead, each capture has
differences confined to the text. The button backgrounds and borders match.
| Case | Initial | After first press | After second press |
|---|---|---|---|
| Enabled | 604 | 543 | 556 |
| Disabled | 583 | 583 | 583 |
Values are the number of changed RGBA pixels in each reference/actual pair from
the focused CI run.
The reference, actual, and difference images are available in the snapshot
artifact of the CI run linked above.
Findings
A local comparison on macOS 15.7.3 reproduced the CI images. View and layer
geometry, glyph positions, fonts, transforms, and text color matched between the
two renderers.
The difference comes from the fill color used to draw the alpha-only text mask
in renderKeyedText. OpenSwiftUI uses white. On macOS, font smoothing depends on
the fill color even in an alpha-only context, so this changes glyph coverage.
Using the resolved foreground RGB for a solid fill removes the differences in
these button snapshots.
A standalone text probe confirmed that black and white fills produce different
alpha masks on macOS 15.7.3 with font smoothing enabled. The masks match with
smoothing disabled. The same probe on iOS 18.5 produced identical masks for both
colors.
- Ngôn ngữ chính
- Swift
- Star
- 2.5k
- Fork
- 84
- Merge trung bình
- 2 giờ 8 phút
- Pull request đã merge (30 ngày)
- 62
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenSwiftUIProject/OpenSwiftUI
-
Add Accessibility supportCó thể đã có người làm @Kyle-Ye đã nhận 15 ngày trước. Đang mởarea: accessibility area: hosting-bridge type: feature
OpenSwiftUIProject/OpenSwiftUI#1112 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add Gauge supportĐang mởarea: rendering area: view type: feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
OpenSwiftUIProject/OpenSwiftUI#1022 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: animation area: rendering contrib: help wanted impact: visual-diff type: bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
OpenSwiftUIProject/OpenSwiftUI#984 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add List supportĐang mởarea: layout area: rendering area: view type: feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
OpenSwiftUIProject/OpenSwiftUI#919 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add ScrollView supportĐang mởarea: layout area: rendering area: view type: feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
OpenSwiftUIProject/OpenSwiftUI#918 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của OpenSwiftUIProject/OpenSwiftUI
Issue tương tự
-
P2 package platform-ios team-ios
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
altic-dev/FluidVoice#1117 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
omacom/try-omarchy#343 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
install.ps1: Windows PowerShell 5.1 aborts after a successful cosign verification (NativeCommandError on 'Verified OK')Có thể đã có người làm @sly321-pixel đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
OneBusAway/onebusaway-ios#1518 ·
Maintainer thường phản hồi trong vòng 2 ngày