macOS button text differs from SwiftUI in interaction snapshots
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 74/100
Rechercherichtung
Beginne mit renderKeyedText, das im Issue als die Funktion beschrieben wird, die Weiß zum Zeichnen der Alpha-only-Textmaske verwendet; vergleiche, wie sie die aufgelöste Vordergrundfarbe verwendet. Führe anschließend ButtonInteractionTests mit deaktivierten Referenzaktualisierungen aus und prüfe die Snapshot-Fälle für den aktivierten und deaktivierten Zustand. Fertig ist die Aufgabe, wenn alle sechs Aufnahmen mit den SwiftUI-Referenzen übereinstimmen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Swift
- Sterne
- 2.5k
- Forks
- 84
- Ø Merge
- 3 Std. 6 Min.
- Gemergte PRs (30 T.)
- 84
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus OpenSwiftUIProject/OpenSwiftUI
-
Implement ImageRendererOffenarea: rendering type: feature
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
OpenSwiftUIProject/OpenSwiftUI#1214 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: animation area: rendering type: feature
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
OpenSwiftUIProject/OpenSwiftUI#1206 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: graphics platform: visionOS priority: p2 type: feature
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
OpenSwiftUIProject/OpenSwiftUI#1178 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Track visionOS supportOffenarea: compatibility area: hosting-bridge area: rendering platform: visionOS priority: p1 type: feature
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
OpenSwiftUIProject/OpenSwiftUI#1171 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: text type: feature
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 48/100
OpenSwiftUIProject/OpenSwiftUI#1167 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in OpenSwiftUIProject/OpenSwiftUI
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
element-hq/element-x-ios#6405 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
apple/coreai-models#380 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug 🐞
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
mozilla-mobile/firefox-ios#36278 ·
Maintainer antworten meist innerhalb von 1 Tag
-
product / auth product / console product / sites product / storage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
peetzweg/opendisplay#413 ·
Maintainer antworten meist innerhalb von 1 Tag