Skip to content

Commit a7f14a0

Browse files
fix(subscription): size pricing dialogs with Reka props (#13633)
## Summary Fixes the legacy personal and legacy workspace pricing dialogs so Reka owns the dialog width and the pricing table no longer overflows the default 576px frame. ## Changes - **What**: Replace the shared PrimeVue-only `style` and `pt` dialog props with Reka `renderer`, `size`, and `contentClass` props for both legacy pricing paths. - **What**: Preserve `modal: false` for the legacy workspace path so its teleported PrimeVue plan-details popover remains interactive. - **What**: Add unit coverage for both routes and assert that ignored PrimeVue shell props are no longer passed. ## Review Focus - **Regression origin**: [#12593](#12593) made Reka the default dialog renderer. [#12666](#12666) then added shared PrimeVue `style` and `pt` props for these pricing dialogs. Reka ignored those props and fell back to `size="md"` (`max-w-xl`, 576px). [#13092](#13092) fixed the unified pricing path only and explicitly left the two legacy paths for follow-up. - **Sizing ownership**: The fix puts width on the Reka dialog frame with `size: 'full'` and `sm:max-w-7xl`. Pricing content no longer has to compensate for a narrow shell. - **Legacy workspace behavior**: `modal: false` remains intentional because the legacy table opens a PrimeVue popover teleported to `body`. - **Scope**: This PR contains only global subscription-dialog sizing. Agent side-panel behavior remains in [#13472](#13472). - **Validation**: Focused tests pass (41 tests), `pnpm typecheck` passes, and targeted ESLint passes. Chrome validation at 1352x705 rendered a 1280px dialog with no horizontal overflow in both the isolated PR preview and the combined agent-panel preview. The docked agent panel remained mounted behind the modal. ## Screenshots (if applicable) - Original report and screenshots: [Slack thread](https://comfy-organization.slack.com/archives/C0A8Z4U7Y1K/p1783967281397449?thread_ts=1783966866.227439&cid=C0A8Z4U7Y1K)
1 parent e6d1a9d commit a7f14a0

2 files changed

Lines changed: 41 additions & 21 deletions

File tree

src/platform/cloud/subscription/composables/useSubscriptionDialog.test.ts

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ vi.mock('@/platform/workspace/composables/useWorkspaceUI', () => ({
7979
})
8080
}))
8181

82+
function expectRekaPricingDialogProps(
83+
dialogComponentProps: Record<string, unknown>
84+
) {
85+
expect(dialogComponentProps).toMatchObject({
86+
renderer: 'reka',
87+
size: 'full'
88+
})
89+
expect(dialogComponentProps).not.toHaveProperty('style')
90+
expect(dialogComponentProps).not.toHaveProperty('pt')
91+
}
92+
8293
describe('useSubscriptionDialog', () => {
8394
beforeEach(() => {
8495
vi.clearAllMocks()
@@ -136,11 +147,7 @@ describe('useSubscriptionDialog', () => {
136147
showPricingTable()
137148

138149
const { dialogComponentProps } = mockShowLayoutDialog.mock.calls[0][0]
139-
// Reka (the default renderer) sizes via size/contentClass; a PrimeVue
140-
// `style` width is silently ignored and collapses the wide table to the
141-
// default md (576px) frame.
142-
expect(dialogComponentProps).toHaveProperty('contentClass')
143-
expect(dialogComponentProps).not.toHaveProperty('style')
150+
expectRekaPricingDialogProps(dialogComponentProps)
144151
})
145152

146153
it('defaults to the personal tab in a personal workspace', () => {
@@ -174,6 +181,8 @@ describe('useSubscriptionDialog', () => {
174181

175182
const props = mockShowLayoutDialog.mock.calls[0][0].props
176183
expect(props).toHaveProperty('onChooseTeam')
184+
const { dialogComponentProps } = mockShowLayoutDialog.mock.calls[0][0]
185+
expectRekaPricingDialogProps(dialogComponentProps)
177186
})
178187

179188
it('routes an existing per-member (legacy) team subscriber to the old team table', () => {
@@ -194,6 +203,21 @@ describe('useSubscriptionDialog', () => {
194203
expect(props).not.toHaveProperty('onChooseTeam')
195204
})
196205

206+
it('sizes the legacy workspace pricing dialog via Reka contentClass', () => {
207+
mockShouldUseWorkspaceBilling.value = true
208+
mockIsInPersonalWorkspace.value = false
209+
mockIsLegacyTeamPlan.value = true
210+
const { showPricingTable } = useSubscriptionDialog()
211+
212+
showPricingTable()
213+
214+
const { dialogComponentProps } = mockShowLayoutDialog.mock.calls[0][0]
215+
expect(dialogComponentProps).toMatchObject({
216+
modal: false
217+
})
218+
expectRekaPricingDialogProps(dialogComponentProps)
219+
})
220+
197221
it('keeps a non-legacy (credit-slider) team subscriber on the unified table', () => {
198222
mockShouldUseWorkspaceBilling.value = true
199223
mockIsInPersonalWorkspace.value = false

src/platform/cloud/subscription/composables/useSubscriptionDialog.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,12 @@ export const useSubscriptionDialog = () => {
8080

8181
trackModalOpened(options?.reason)
8282

83-
// Shared dialog shell styling for both variants.
84-
const dialogComponentProps = {
85-
style: 'width: min(1328px, 95vw); max-height: 958px;',
86-
pt: {
87-
root: {
88-
class: 'rounded-2xl bg-transparent h-full'
89-
},
90-
content: {
91-
class:
92-
'!p-0 rounded-2xl border border-border-default bg-secondary-background shadow-[0_25px_80px_rgba(5,6,12,0.45)] h-full'
93-
}
94-
}
95-
}
83+
const legacyPricingDialogProps = {
84+
renderer: 'reka',
85+
size: 'full',
86+
contentClass:
87+
'sm:max-w-7xl max-h-[90vh] rounded-2xl border border-border-default bg-secondary-background shadow-[0_25px_80px_rgba(5,6,12,0.45)]'
88+
} as const
9689

9790
// Jun-5 model: a single unified pricing table (personal/team plan toggle on
9891
// one workspace) for workspaces on the consolidated billing flow. Replaces
@@ -120,7 +113,10 @@ export const useSubscriptionDialog = () => {
120113
// The legacy table hosts a PrimeVue Popover teleported to body; Reka
121114
// modal mode traps focus and disables body pointer-events, making it
122115
// unclickable. The unified table has no such overlay.
123-
dialogComponentProps: { ...dialogComponentProps, modal: false }
116+
dialogComponentProps: {
117+
...legacyPricingDialogProps,
118+
modal: false
119+
}
124120
})
125121
return
126122
}
@@ -144,7 +140,7 @@ export const useSubscriptionDialog = () => {
144140
dialogComponentProps: {
145141
// Reka (the default renderer) sizes via size/contentClass; a PrimeVue
146142
// `style` width is ignored here and collapses the table to the default
147-
// `md` frame. `w-fit` lets each step hug its content the pricing
143+
// `md` frame. `w-fit` lets each step hug its content -- the pricing
148144
// table fills its 1280px content while the compact confirm/success
149145
// steps shrink (the content root sets its own width per checkoutStep).
150146
renderer: 'reka',
@@ -167,7 +163,7 @@ export const useSubscriptionDialog = () => {
167163
reason: options?.reason,
168164
onChooseTeam: () => startTeamWorkspaceUpgradeFlow()
169165
},
170-
dialogComponentProps
166+
dialogComponentProps: legacyPricingDialogProps
171167
})
172168
}
173169

0 commit comments

Comments
 (0)