Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(cyclops-cs): collapse account identity panel (#7138)

r33drichards284134f9f4e8
diff --git a/libs/fleet/e2e/settings.spec.ts b/libs/fleet/e2e/settings.spec.ts
index 807d2ae7a1..07d4f28462 100644
--- a/libs/fleet/e2e/settings.spec.ts
+++ b/libs/fleet/e2e/settings.spec.ts
@@ -34,6 +34,25 @@ for (const viewport of [
})
}
+test("keeps account identity in a collapsed drawer", async ({ page }) => {
+ await mockAuth(page)
+ await mockNamespacesApi(page)
+ await mockGitHubTrustPoliciesApi(page)
+ await page.goto("/settings")
+
+ const accountToggle = page.getByRole("button", { name: "Account" })
+ const settingsContent = page.getByRole("main")
+ await expect(accountToggle).toHaveAttribute("aria-expanded", "false")
+ await expect(settingsContent.getByText("testuser", { exact: true })).toBeHidden()
+ await expect(settingsContent.getByText("test-user-id", { exact: true })).toBeHidden()
+
+ await accountToggle.click()
+
+ await expect(accountToggle).toHaveAttribute("aria-expanded", "true")
+ await expect(settingsContent.getByText("testuser", { exact: true })).toBeVisible()
+ await expect(settingsContent.getByText("test-user-id", { exact: true })).toBeVisible()
+})
+
test.describe("Settings GitHub trust policies", () => {
test.beforeEach(async ({ page }) => {
await mockAuth(page)
diff --git a/libs/fleet/src/pages/Settings.tsx b/libs/fleet/src/pages/Settings.tsx
index 7155a4bf62..ed2bf7b9ac 100644
--- a/libs/fleet/src/pages/Settings.tsx
+++ b/libs/fleet/src/pages/Settings.tsx
@@ -245,47 +245,43 @@ steps:
description="Manage your identity, payment method, and automation access."
>
<SpaceBetween size="l">
- <Container
- header={
- <Header
- variant="h2"
- description="Identity details from your current Cua session."
- >
- Account
- </Header>
- }
+ <ExpandableSection
+ variant="container"
+ defaultExpanded={false}
+ headerText="Account"
+ headerDescription="Identity details from your current Cua session."
>
<SpaceBetween size="m">
- <FormField label="Username">
- {name ? (
- <CopyToClipboard
- variant="inline"
- textToCopy={name}
- textToDisplay={<code>{name}</code>}
- copyButtonAriaLabel="Copy username"
- copySuccessText="Username copied"
- copyErrorText="Failed to copy username"
- />
- ) : (
- <Box color="text-status-inactive">Unknown</Box>
- )}
- </FormField>
- <FormField label="Subject (sub)">
- {sub ? (
- <CopyToClipboard
- variant="inline"
- textToCopy={sub}
- textToDisplay={<code>{sub}</code>}
- copyButtonAriaLabel="Copy subject"
- copySuccessText="Subject copied"
- copyErrorText="Failed to copy subject"
- />
- ) : (
- <Box color="text-status-inactive">Unknown</Box>
- )}
- </FormField>
+ <FormField label="Username">
+ {name ? (
+ <CopyToClipboard
+ variant="inline"
+ textToCopy={name}
+ textToDisplay={<code>{name}</code>}
+ copyButtonAriaLabel="Copy username"
+ copySuccessText="Username copied"
+ copyErrorText="Failed to copy username"
+ />
+ ) : (
+ <Box color="text-status-inactive">Unknown</Box>
+ )}
+ </FormField>
+ <FormField label="Subject (sub)">
+ {sub ? (
+ <CopyToClipboard
+ variant="inline"
+ textToCopy={sub}
+ textToDisplay={<code>{sub}</code>}
+ copyButtonAriaLabel="Copy subject"
+ copySuccessText="Subject copied"
+ copyErrorText="Failed to copy subject"
+ />
+ ) : (
+ <Box color="text-status-inactive">Unknown</Box>
+ )}
+ </FormField>
</SpaceBetween>
- </Container>
+ </ExpandableSection>
{billing && <BillingSettings />}