macOS button text differs from SwiftUI in interaction snapshots
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 74/100
Direção de pesquisa
Comece por renderKeyedText, identificado no issue como usando branco para desenhar a máscara de texto somente alfa; compare como ele usa a cor de primeiro plano resolvida. Em seguida, execute ButtonInteractionTests com as atualizações de referência desativadas e inspecione os casos de snapshot habilitado e desabilitado. O trabalho estará concluído quando as seis capturas corresponderem às referências do SwiftUI.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Swift
- Estrelas
- 2.5k
- Forks
- 84
- Merge médio
- 5h 45min
- PRs com merge (30d)
- 70
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de OpenSwiftUIProject/OpenSwiftUI
-
area: tooling type: build type: ci
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 66/100
OpenSwiftUIProject/OpenSwiftUI#1254 ·
Mantenedores costumam responder em até 1 dia
-
Implement PickerAbertaarea: data-flow area: view type: feature
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
OpenSwiftUIProject/OpenSwiftUI#1225 ·
Mantenedores costumam responder em até 1 dia
-
Add Shader supportAbertaarea: graphics area: rendering type: feature
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 18/100
OpenSwiftUIProject/OpenSwiftUI#1223 · 3 reações ·
Mantenedores costumam responder em até 1 dia
-
Add MeshGradient supportAbertaarea: graphics area: rendering type: feature
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
OpenSwiftUIProject/OpenSwiftUI#1222 ·
Mantenedores costumam responder em até 1 dia
-
Implement ImageRendererAbertaarea: rendering type: feature
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
OpenSwiftUIProject/OpenSwiftUI#1214 · 1 reação ·
Mantenedores costumam responder em até 1 dia
Todas as issues de OpenSwiftUIProject/OpenSwiftUI
Issues semelhantes
-
[BUG] mo clean deletes Cypress test runner binaries in ~/Library/Caches/CypressTalvez já em andamento @viniciusdsandrade assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
area:data coverage
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
reacher-z/Awesome-CUA#5051 ·
Mantenedores costumam responder em até 19 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
rock3r/remozio#600 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Bug JSON
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 83/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
nightscout/Trio#1748 · 1 comentário ·
Mantenedores costumam responder em até 1 dia