Skip to content

Commit 897d9b2

Browse files
committed
fix(platform): restore the design system's activity and property lists after the merge
1 parent 5f4386f commit 897d9b2

11 files changed

Lines changed: 34 additions & 35 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.dom.test.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ const {
4949
>(),
5050
}))
5151

52-
vi.mock(
53-
'@/app/workspace/[workspaceId]/providers/feature-flags-provider',
54-
() => featureFlagsProviderMock
55-
)
52+
vi.mock('@/lib/core/config/feature-flags-context', () => featureFlagsProviderMock)
5653

5754
vi.mock('next/navigation', () => nextNavigationMock)
5855
vi.mock('@/lib/desktop', () => libDesktopMock)

‎apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.test.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ import type { ContentBlock } from '@/app/workspace/[workspaceId]/home/types'
2121

2222
nextNavigationMockFns.mockUsePathname.mockReturnValue('/workspace/workspace-1/home')
2323

24-
vi.mock(
25-
'@/app/workspace/[workspaceId]/providers/feature-flags-provider',
26-
() => featureFlagsProviderMock
27-
)
24+
vi.mock('@/lib/core/config/feature-flags-context', () => featureFlagsProviderMock)
2825

2926
vi.mock('next/navigation', () => nextNavigationMock)
3027

‎apps/sim/platform/design-system/components/data-display/data-display.module.css‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
}
77
.metrics {
88
display: grid;
9-
grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--spacing-96)), 1fr));
10-
gap: var(--spacing-24);
9+
grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--spacing-128)), 1fr));
10+
gap: var(--spacing-32);
1111
}
1212
.metric {
1313
display: grid;

‎apps/sim/platform/design-system/components/disclosure/disclosure.module.css‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
.activity {
3030
display: grid;
3131
min-inline-size: 0;
32-
gap: var(--ui-stack-gap);
33-
}
34-
.activityPanel {
35-
margin-block-start: var(--ui-section-gap);
32+
gap: var(--ui-section-gap);
3633
}
3734
.activity > .summary {
3835
color: var(--ui-secondary);
@@ -66,7 +63,7 @@
6663
.collectionActions {
6764
position: absolute;
6865
inset-block-start: 0;
69-
inset-inline-end: calc((var(--spacing-app-chip) - var(--spacing-24)) / 2);
66+
inset-inline-end: 0;
7067
min-block-size: var(--spacing-28);
7168
display: flex;
7269
align-items: center;

‎apps/sim/platform/design-system/components/disclosure/disclosure.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function Disclosure({
5454
{title}
5555
</Collapsible.Trigger>
5656
{introduction}
57-
<Collapsible.Panel className={styles.activityPanel}>{children}</Collapsible.Panel>
57+
<Collapsible.Panel>{children}</Collapsible.Panel>
5858
</Collapsible.Root>
5959
)
6060
const disclosure = (

‎apps/sim/platform/design-system/components/empty-state/empty-state.module.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
.empty {
1010
justify-content: center;
1111
min-height: calc(var(--spacing-56) * 2);
12-
padding-block: var(--spacing-16);
12+
padding: var(--spacing-16) var(--spacing-8);
1313
color: var(--ui-ink);
1414
}
1515

‎apps/sim/platform/design-system/components/property-list/property-list.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export function PropertyList({ title, titleHidden, properties }: PropertyListPro
2828
<div className={styles.row} key={property.id}>
2929
<dt data-type='T050'>{property.label}</dt>
3030
<dd data-type='T060' data-kind={property.kind}>
31-
{property.kind === 'person' && (
32-
<Avatar name={property.value} src={property.src} decorative />
33-
)}
31+
{property.kind === 'person' && <Avatar name={property.value} src={property.src} />}
3432
{property.kind === 'link' ? (
3533
<Link href={property.href}>{property.value}</Link>
3634
) : (

‎apps/sim/scripts/org-redesign-e2e/checks/screenshots.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
sql,
1818
withSession,
1919
} from '@/scripts/org-redesign-e2e/harness'
20-
import { expectPageNotFound, orgChip } from '@/scripts/org-redesign-e2e/locators'
20+
import { expectPageNotFound, openOrgCard, orgChip } from '@/scripts/org-redesign-e2e/locators'
2121

2222
interface StateShot {
2323
name: string
@@ -90,13 +90,13 @@ const STATE_SHOTS: readonly StateShot[] = [
9090
{
9191
name: 'flyout-organization',
9292
path: 'home',
93-
open: (page) => orgChip(page).click(),
93+
open: (page) => openOrgCard(page),
9494
openOnPhone: async (page) => {
9595
await page
9696
.getByRole('button', { name: /open (sidebar|menu|navigation)/i })
9797
.first()
9898
.click()
99-
await orgChip(page).click()
99+
await openOrgCard(page)
100100
},
101101
},
102102
{

‎apps/sim/scripts/org-redesign-e2e/checks/sidebar.ts‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import {
4040
menuEntry,
4141
navigateWithinDocument,
4242
navLabels,
43+
openMenu,
44+
openOrgCard,
4345
openRowMenu,
4446
orgCard,
4547
orgChip,
@@ -335,8 +337,7 @@ export async function sidebarChecks() {
335337
await onHome(MEMBER, async ({ page }) => {
336338
const chip = orgChip(page)
337339
await expect(chip).toContainText(ORGANIZATION_NAME)
338-
await chip.click()
339-
const card = orgCard(page)
340+
const card = await openOrgCard(page)
340341
await expect(card.getByText(/\d+ members?/)).toBeVisible()
341342
await expect(card.getByRole('button', { name: 'Rename organization' })).toHaveCount(0)
342343
await expect(card.getByRole('button', { name: 'Change organization logo' })).toHaveCount(0)
@@ -358,7 +359,7 @@ export async function sidebarChecks() {
358359
return card.getByRole('textbox', { name: 'Organization name' })
359360
}
360361
const renamed = `${ORGANIZATION_NAME} Group`
361-
await chip.click()
362+
await openOrgCard(page)
362363
const field = await startRename()
363364
await field.fill('Discarded name')
364365
await field.press('Escape')
@@ -369,7 +370,7 @@ export async function sidebarChecks() {
369370
await expect(chip).toContainText(renamed)
370371
await page.reload()
371372
await expect(chip).toContainText(renamed)
372-
await chip.click()
373+
await openOrgCard(page)
373374
const restore = await startRename()
374375
await restore.fill(ORGANIZATION_NAME)
375376
await restore.press('Enter')
@@ -393,7 +394,7 @@ export async function sidebarChecks() {
393394
: route.continue()
394395
)
395396
await page.goto(orgUrl('/home'))
396-
await orgChip(page).click()
397+
await openOrgCard(page)
397398
const card = orgCard(page)
398399
await card.getByRole('button', { name: 'Rename organization' }).click()
399400
const field = card.getByRole('textbox', { name: 'Organization name' })
@@ -410,7 +411,7 @@ export async function sidebarChecks() {
410411
() => sql`update organization set logo = null where id = ${ORGANIZATION_ID}`,
411412
() =>
412413
onHome(ADMIN, async ({ page }) => {
413-
await orgChip(page).click()
414+
await openOrgCard(page)
414415
const card = orgCard(page)
415416
await expect(card.getByRole('button', { name: 'Change organization logo' })).toBeEnabled()
416417
const started = page.waitForResponse(
@@ -442,13 +443,13 @@ export async function sidebarChecks() {
442443
)
443444
await check('Invite follows the default group, and an admin invites when it allows', async () => {
444445
await onHome(ADMIN, async ({ page }) => {
445-
await orgChip(page).click()
446+
await openOrgCard(page)
446447
await expect(orgCard(page).getByRole('button', { name: 'Invite', exact: true })).toHaveCount(
447448
0
448449
)
449450
await sql`update permission_group set config = config - 'disableInvitations' where id = ${STANDARD_GROUP_ID}`
450451
await page.reload()
451-
await orgChip(page).click()
452+
await openOrgCard(page)
452453
await orgCard(page).getByRole('button', { name: 'Invite', exact: true }).click()
453454
const modal = dialog(page, 'Invite people')
454455
await expect(modal).toBeVisible()
@@ -729,8 +730,7 @@ export async function sidebarChecks() {
729730
const chip = accountChip(page)
730731
await expect(chip).toContainText(MEMBER.name)
731732
await expect(chip).toHaveAccessibleName(`${MEMBER.name}, account menu`)
732-
await chip.click()
733-
const menu = dialog(page, 'Account menu')
733+
const menu = await openMenu(chip, dialog(page, 'Account menu'))
734734
await expect(menu.getByRole('button', { name: 'Sign out', exact: true })).toBeVisible()
735735
await menu.getByRole('button', { name: 'Settings', exact: true }).click()
736736
await expect(page).toHaveURL(orgUrl('/settings/general'))

‎apps/sim/scripts/org-redesign-e2e/locators.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from 'node:assert/strict'
2-
import type { Page } from '@playwright/test'
2+
import type { Locator, Page } from '@playwright/test'
33
import { expect } from '@/scripts/org-redesign-e2e/harness'
44

55
declare global {
@@ -21,6 +21,15 @@ export const searchField = (page: Page) =>
2121
export const dialog = (page: Page, name: string | RegExp) => page.getByRole('dialog', { name })
2222
export const orgChip = (page: Page) => page.getByRole('button', { name: 'Organization menu' })
2323
export const orgCard = (page: Page) => dialog(page, 'Organization menu')
24+
/** Clicks until its menu opens, since a click that lands before the rail hydrates does nothing. */
25+
export async function openMenu(trigger: Locator, menu: Locator) {
26+
await expect(async () => {
27+
await trigger.click()
28+
await expect(menu).toBeVisible({ timeout: 1_000 })
29+
}).toPass({ timeout: 20_000 })
30+
return menu
31+
}
32+
export const openOrgCard = (page: Page) => openMenu(orgChip(page), orgCard(page))
2433
/** Outside the sidebar, which has a section with the same name as Home's Workspaces. */
2534
export const homeRegion = (page: Page, name: string) =>
2635
page.getByRole('main').getByRole('region', { name, exact: true })

0 commit comments

Comments
 (0)