fix(ui): give modal panels a width prop and restore the widths lost to it - #988
Merged
Merged
Conversation
wibus-wee
force-pushed
the
fix/dialog-content-width-prop
branch
2 times, most recently
from
September 26, 2026 07:37
fff9f39 to
56d1c8c
Compare
…o it
The @lody/ui migration replaced the fluid w-[calc(100vw-4rem)] + max-w-lg
panel with a fixed width: 512px StyleX declaration. Every dialog that had
widened itself with a lone max-w-* was silently clamped back to 512px,
because max-width can only narrow a fixed width, never raise it — the paste
preview (48rem), usage share image (56rem), file quick-open and the failed
detail and operation reply panels (42rem), and machine pairing (36rem) all
shrank. A w-* class could still win by cascade-layer order, but depending
on sheet order for the one layout dial a panel offers is exactly the trap
that shipped this.
ModalContentProps now takes width, merged onto the popup's inline style by
mergePanelWidth whether the caller's style is an object or a state callback.
Inline style always follows the panel and never displaces the rung's own
100vw-32px viewport cap. Every non-default panel width — restored ones and
the surviving w-[calc()]/style{{width}} spellings — goes through it, and
SETTINGS_EDITOR_DIALOG_LAYOUT splits its 620px out to the prop. The cmdk
palette keeps 512px on purpose.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Model: swe-2-high
wibus-wee
force-pushed
the
fix/dialog-content-width-prop
branch
from
September 26, 2026 07:59
56d1c8c to
666980d
Compare
wibus-wee
marked this pull request as ready for review
September 26, 2026 08:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@lody/ui'sModalContentPropsgains awidthprop (shared byDialog.ContentandAlertDialog.Content), merged onto the popup's inlinestylebymergePanelWidth— object and state-callbackstyleforms both compose.@lody/uimigration: a lonemax-w-*can only narrow the fixedwidth: 512pxtoken, never widen it. Paste preview 48rem, usage share image 56rem, file quick-open / failed detail / operation reply 42rem, machine pairing 36rem.chat-failed-detail,session-file-preview,chat-share-image,update-changelog,open-source-attributions,skill-detail, andSETTINGS_EDITOR_DIALOG_WIDTH(620px, split out ofSETTINGS_EDITOR_DIALOG_LAYOUT).stylebeats the panel's StyleX width regardless of sheet order and never displaces the rung'smax-width: calc(100vw - 32px)viewport cap, so narrow windows still bound the panel.DrawerkeepsdrawerSize.test/dialog.test.tsxpins the contract;components/src/ui/AGENTS.mddocumentswidthas the one way to state a non-default panel width; decision note in.agents/notes/implemented/bug-fix/2026-09-25-dialog-content-width-prop.md(+ zh).Test plan
pnpm --filter @lody/ui test(new test assertswidthlands as inline style and composes with callerstyle)pnpm check+pnpm format— not runnable in this nested checkout (deps not installed); please run before mergeGenerated with Devin