Dialog with description + actions and no children: text touches the footer rule

Aberta Para iniciantes
#1,329 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
77/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
typescript
Domínio
design, frontend

Direção de pesquisa

Comece por Dialog.svelte, cujo exemplo na documentação usa o mesmo padrão de título, descrição e ações, e inspecione como o body e a descrição são estilizados quando não há children. Adicione um teste de regressão que monte esse caso e verifique o espaçamento antes das ações; o trabalho estará concluído quando o espaço for de pelo menos --ca-space-4 e o teste passar.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Version: @codeatlasdev/ui 4.6.0 (seen in Atlas Desktop, WKWebView; headless WebKit shot)

What is wrong

A Dialog with title, description and actions but no children draws the description touching the footer rule: no space between the last line of the description and the border-top of .ca-dialog__actions (about 8px instead of the body's 16px + 16px padding). The empty .ca-dialog__body seems to collapse to 0 (flex: 0 1 auto; min-height: auto; overflow-y: auto in a height: fit-content panel).

Minimal repro

<Dialog bind:open title="Unpair Phone A3F9?" size="sm"
  description="It is disconnected at once and can no longer reach this computer. To use it again, scan a new code.">
  {#snippet actions()}
    <Button variant="ghost">Cancel</Button>
    <Button variant="destructive">Unpair</Button>
  {/snippet}
</Dialog>

A confirm dialog is the most common use of exactly this shape (the usage example in Dialog.svelte's own doc comment is the same: title + description + actions).

Expected vs actual

Expected: the same breathing room above the footer as a dialog that has a body. Actual: text against the rule.

Workaround in Atlas

PhoneRow.svelte passes the sentence as a child (<p>) instead of description, so the body has content. Only one call site today; if more confirms appear, a ConfirmDialog wrapper goes under apps/desktop/src/lib/components/.

Proposed fix

Render .ca-dialog__body only when children exist, and give .ca-dialog__description a bottom padding (var(--ca-space-4)) when there is no body, so the footer rule is never closer than the body padding. A regression test: mount a Dialog with description and actions and no children, assert the distance between the description's bottom and the actions' top is at least --ca-space-4.

Linguagem predominante
TypeScript
Estrelas
6
Forks
3
Merge médio
5h 21min
PRs com merge (30d)
378

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de codeatlasdev/ui

Todas as issues de codeatlasdev/ui

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.