Skip to content

Commit 1bcfa12

Browse files
dante01yoonampagentgithub-actions
authored andcommitted
fix: reset native button styles on Manage plan (FE-1668) (#15419)
## Summary Fixes [FE-1668](https://linear.app/comfyorg/issue/FE-1668/): the **Manage plan** item in the profile popover inherited native browser `<button>` styling after #15266 changed it from a `<div>` to a `<button>` for accessibility. ## Root cause #15266 (`307c66ab5d`) added the correct keyboard and accessibility semantics, but the button did not reset its native appearance. The browser UA stylesheet therefore rendered a gray background, border, and shrink-wrapped width that made this row visually inconsistent with the neighboring menu items. ## Fix Reset the native button appearance with `appearance-none`, `border-0`, `bg-transparent`, `w-full`, and `text-left`. Preserve the existing hover state and add an equivalent focus-visible state for keyboard users. ## AS IS ![Manage plan row with native gray button background and border](https://ampcode.com/user-content/artifacts/7be125fa722503182ec4b6645552cbfc37c9ec66093f185e7ea2a6b8ada57151-file.png) ## TO BE ![Manage plan row matching the other transparent profile menu rows](https://ampcode.com/user-content/artifacts/cf8b6fab9ff1fbec51f840e2926599d97b6ac75db6f54a3cb52a0ee315373d6f-file.png) ## Testing - `pnpm exec vitest run src/platform/workspace/components/CurrentUserPopoverWorkspace.test.ts` (16/16 passed) - `PLAYWRIGHT_LOCAL=1 PLAYWRIGHT_TEST_URL=http://localhost:5173 pnpm exec playwright test browser_tests/tests/currentUserPopoverCredits.spec.ts --project=cloud --grep "plain full-width" --update-snapshots` - `pnpm typecheck:browser` - `pnpm typecheck` - `pnpm exec oxfmt --check browser_tests/tests/currentUserPopoverCredits.spec.ts src/platform/workspace/components/CurrentUserPopoverWorkspace.vue` --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: github-actions <github-actions@github.com>
1 parent 9d31653 commit 1bcfa12

4 files changed

Lines changed: 35 additions & 1 deletion

File tree

browser_tests/tests/currentUserPopoverCredits.spec.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import type {
88
import type { WorkspaceTokenResponse } from '@/platform/workspace/stores/workspaceAuthStore'
99
import type { operations } from '@/types/comfyRegistryTypes'
1010
import { comfyPageFixture } from '@e2e/fixtures/ComfyPage'
11+
import { APP_URL, setupCloudApp } from '@e2e/fixtures/utils/cloudAppSetup'
12+
import { workspace } from '@e2e/fixtures/utils/workspaceMocks'
1113

1214
type CustomerBalanceResponse = NonNullable<
1315
operations['GetCustomerBalance']['responses']['200']['content']['application/json']
@@ -164,4 +166,36 @@ test.describe('Current user popover credits row', { tag: '@cloud' }, () => {
164166
const resubscribeRight = resubscribeBox!.x + resubscribeBox!.width
165167
expect(resubscribeRight).toBeLessThanOrEqual(popoverRight)
166168
})
169+
170+
test(
171+
'renders Manage plan as a plain full-width menu row',
172+
{ tag: '@screenshot' },
173+
async ({ page }) => {
174+
test.setTimeout(60_000)
175+
await setupCloudApp(page, {
176+
workspace: workspace('personal', 'owner'),
177+
features: { subscription_required: false }
178+
})
179+
await page.goto(APP_URL)
180+
await page.waitForFunction(() => !!window.app?.extensionManager, null, {
181+
timeout: 45_000
182+
})
183+
await page.getByRole('button', { name: 'Close dialog' }).click()
184+
await expect(page.getByTestId('dialog-overlay')).toBeHidden()
185+
186+
await page.getByRole('button', { name: 'Current user' }).click()
187+
188+
const managePlan = page.getByRole('button', { name: 'Manage plan' })
189+
await expect(managePlan).toBeVisible()
190+
await expect(managePlan).toHaveScreenshot('manage-plan-menu-item.png')
191+
192+
await managePlan.focus()
193+
await page.keyboard.press('Shift+Tab')
194+
await page.keyboard.press('Tab')
195+
await expect(managePlan).toBeFocused()
196+
await expect(managePlan).toHaveScreenshot(
197+
'manage-plan-menu-item-focused.png'
198+
)
199+
}
200+
)
167201
})
1.75 KB
Loading
1.83 KB
Loading

src/platform/workspace/components/CurrentUserPopoverWorkspace.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
<button
154154
v-if="!accountActionsOnly && showManagePlan"
155155
type="button"
156-
class="flex cursor-pointer items-center gap-2 px-4 py-2 hover:bg-secondary-background-hover"
156+
class="flex w-full cursor-pointer appearance-none items-center gap-2 border-0 bg-transparent px-4 py-2 text-left hover:bg-secondary-background-hover focus-visible:bg-secondary-background-hover focus-visible:outline-none"
157157
data-testid="manage-plan-menu-item"
158158
@click="handleOpenPlanAndCreditsSettings"
159159
>

0 commit comments

Comments
 (0)