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

オープン 初心者向け
#1,329 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
77/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
design, frontend

調査の方向性

同じタイトル、説明、アクションのパターンを使っているドキュメント例の Dialog.svelte から始め、children がない場合に body と説明のスタイルがどうなっているかを確認してください。このケースを mount し、アクション前の間隔を確認する回帰テストを追加してください。間隔が少なくとも --ca-space-4 あり、テストが通れば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
6
フォーク
3
平均マージ
5時間 21分
マージ済み PR(30日)
378

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codeatlasdev/ui のほかの issue

codeatlasdev/ui の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。