prose: code inline quebra no meio do identificador no celular (overflow-wrap: anywhere) e parte o chip
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 6
- Fork
- 3
- Merge trung bình
- 5 giờ 21 phút
- Pull request đã merge (30 ngày)
- 378
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 codeatlasdev/ui
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
codeatlasdev/ui#1340 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:a11y area:components bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
codeatlasdev/ui#1336 ·
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 77/100
codeatlasdev/ui#1329 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
codeatlasdev/ui#1292 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:components enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
codeatlasdev/ui#1198 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codeatlasdev/ui
Issue tương tự
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
sandbox-quantum/switch#2163 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
automated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/dashboard kind/bug QA/dev-automation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug pydanty:is-working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pydantic/pydantic-ai#13939 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
self-host
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
funmusicplace/mirlo#2625 ·
Maintainer thường phản hồi trong vòng 1 ngày