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

Đang mở Phù hợp với người mới
#1,329 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
77/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
Lĩnh vực
design, frontend

Hướng nghiên cứu

Bắt đầu với Dialog.svelte, có ví dụ tài liệu sử dụng cùng mẫu tiêu đề, mô tả và hành động, rồi kiểm tra cách định kiểu cho body và mô tả khi không có children. Thêm một kiểm thử hồi quy mount trường hợp này và kiểm tra khoảng cách trước các hành động; hoàn tất khi khoảng cách ít nhất là --ca-space-4 và kiểm thử chạy thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codeatlasdev/ui

Tất cả issue của codeatlasdev/ui

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.