prose: code inline quebra no meio do identificador no celular (overflow-wrap: anywhere) e parte o chip
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 72/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
Rechercherichtung
Start with the .ca-prose inline code rule in packages/ui/src/lib/styles/prose.css and inspect the existing layout coverage in apps/docs/tests/layout.spec.ts. Reproduce the reported wrapping at 320, 390, and 768px, including narrow table cells. Done means inline code that fits the column stays on one line without splitting its chip, while longer tokens wrap only as specified.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problema
No .ca-prose, todo code inline recebe overflow-wrap: anywhere (packages/ui/src/lib/styles/prose.css, regra .ca-prose :where(:not(pre) > code), comentário "Long identifiers and URLs wrap instead of forcing horizontal scroll on phones"). Em coluna estreita isso quebra o identificador no meio da palavra e parte o chip (borda, fundo e raio) em dois pedaços.
Medido em docs reais (wiApi, @codeatlasdev/ui 4.6.0, viewport 390x844, coluna de texto de 314px; células de tabela de 85 a 158px):
disconnectviradisconnec/t;X-Total-CountviraX-Total-/Count;interactive_not_deliveredchega a 3 linhas numa coluna de 85px.- 220 tokens quebrados em 99 páginas, todos com largura natural menor que a coluna (cabiam inteiros na linha seguinte).
- A exceção existente (
td:first-child code { white-space: nowrap }) só vale para a primeira coluna:codeem célula de texto ou em parágrafo continua quebrando.
Reprodução
- Página de documentação com
.ca-prose, viewport 390px. <p>O WhatsApp recusou o vínculo. Chame <code>connect</code> de novo ou <code>disconnect</code> ...</p>dentro de coluna estreita (ou uma célula de tabela com 85px).- Inspecionar
getClientRects()docode: dois fragmentos em linhas diferentes;getComputedStyle(code).overflowWrap === "anywhere".
Comportamento esperado
Um identificador nunca quebra no meio da palavra, e o chip nunca se parte, a menos que o token seja mais largo que a coluna.
Proposta
- Padrão do
codeinline:white-space: nowrap; overflow-wrap: normal; hyphens: none. - Token longo (o consumidor marca com
data-wrap, ou o ui marca acima de N caracteres):display: inline-block; max-width: 100%; white-space: normal; overflow-wrap: break-word. Vira uma caixa atômica: vai inteira para a linha seguinte se não couber no resto da linha e só quebra dentro do próprio chip (nos pontos<wbr>depois de/ . _ - : , ? =) quando é mais larga que a coluna. - Medida no teste do ui: nenhum
codeinline com largura natural <= coluna ocupa mais de uma linha, em 320, 390 e 768px.
Regra geral
Código inline é um token: ele ou cabe inteiro, ou é a única coisa que quebra, e só em pontos de separação. O ui não deve resolver "não rolar na horizontal" quebrando identificadores.
Workaround local: apps/docs/src/app.css (ca-ui-workaround(#N)), teste apps/docs/tests/layout.spec.ts.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6
- Forks
- 3
- Ø Merge
- 5 Std. 21 Min.
- Gemergte PRs (30 T.)
- 378
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 codeatlasdev/ui
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
codeatlasdev/ui#1340 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:a11y area:components bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
codeatlasdev/ui#1336 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
codeatlasdev/ui#1329 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
codeatlasdev/ui#1292 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:components enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
codeatlasdev/ui#1198 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in codeatlasdev/ui
Ähnliche Issues
-
bug frontend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
CivicTechWR/accessible-housing-portal#578 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
nekko-labs/nekko-agent#2998 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
sandbox-quantum/switch#2163 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement ux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
lolimmlost/aidj#433 ·
Maintainer antworten meist innerhalb von 1 Tag
-
test: ipcShownDialogKeys.test.tsx can fail the unit run with 'window is not defined' after it endsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag