swarm-ui: size dialogs to their own content width
Dialog previously forced every caller to a fixed width: 90vw; max-width: 44em shell regardless of content — fine for the create-agent form's wide two-panel layout (the only caller until now), but a ConfirmDialog's short paragraph then wrapped at its own narrower max-width while the shell stayed the wide default, leaving a dead gutter before the close button (mara filed a screenshot showing exactly this). First pass added a narrow prop/second CSS class for ConfirmDialog to opt into a smaller fixed width. Review pointed at the actual root cause one level up: width: 90vw is a forced width, not a cap — a native dialog's own UA default is width: fit-content. Switching .ui-dialog to width: fit-content; max-width: min(90vw, 44em) lets each caller size to its own content naturally: the create-agent form still hits the 44em cap (same rendered width as before, confirmed via screenshot), ConfirmDialog's paragraph settles at its own intrinsic width with no extra prop, no second CSS class, and no second hardcoded number to keep in sync with the first.
This commit is contained in:
parent
4544c458eb
commit
8d8ac72d98
1 changed files with 24 additions and 11 deletions
|
|
@ -1,5 +1,9 @@
|
|||
/* <ConfirmDialog> — body + button-row layout only; `Dialog.css` owns the
|
||||
surrounding modal chrome, `Button.css` owns the buttons themselves. */
|
||||
surrounding modal chrome, `Button.css` owns the buttons themselves.
|
||||
This `max-width` is the ONLY width decision for a confirm dialog now
|
||||
— `Dialog`'s shell sizes to `fit-content` (see Dialog.css), so
|
||||
whatever this wrapper caps itself at is exactly how wide the whole
|
||||
dialog renders, no second number to keep in sync. */
|
||||
.confirm-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
|||
Loading…
Reference in a new issue