Skip to content

Commit f93a574

Browse files
committed
improvement(links): rebuild the organization Links page in the new design system
Search, sort, paging, row click, the right-click menu, ?create= prefill, variable links, and the canEdit/canManage split all follow the current page. The extension-imported modal and shortcut stay as they are, and the source-card form keeps using them.
1 parent 3019c8e commit f93a574

16 files changed

Lines changed: 778 additions & 523 deletions

File tree

‎apps/sim/app/o/[organizationId]/links/columns.ts‎

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { ReactNode } from 'react'
2+
import { RedesignHost } from '@/app/o/[organizationId]/_redesign/redesign-host'
3+
4+
interface LinksSurfaceProps {
5+
children: ReactNode
6+
}
7+
8+
/** Fills the app's content slot, and the grid stretches the surface so its canvas reaches the end. */
9+
export function LinksSurface({ children }: LinksSurfaceProps) {
10+
return (
11+
<div className='grid h-full min-h-0 min-w-0 flex-1 grid-cols-[minmax(0,1fr)] overflow-y-auto'>
12+
<RedesignHost>{children}</RedesignHost>
13+
</div>
14+
)
15+
}
Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
1-
'use client'
2-
3-
import { Link } from '@sim/emcn/icons'
4-
import { useDeploymentShape } from '@/lib/core/config/deployment-shape'
1+
import { LinksSurface } from '@/app/o/[organizationId]/links/links-surface'
52
import {
6-
INSTALL_EXTENSION_ACTION,
7-
NEW_SIM_LINK_ACTION,
8-
SIM_LINK_COLUMNS,
9-
SIM_LINKS_SEARCH_PLACEHOLDER,
10-
} from '@/app/o/[organizationId]/links/columns'
11-
import { ResourceChromeFallback } from '@/app/workspace/[workspaceId]/components/resource/components/resource-chrome-fallback'
3+
LinkRowsSkeleton,
4+
LinksFrame,
5+
} from '@/platform/app/(shell)/links/_components/links-page/links-frame'
126

137
export default function SimLinksLoading() {
14-
const { hosted } = useDeploymentShape()
158
return (
16-
<div inert aria-busy className='contents'>
17-
<ResourceChromeFallback
18-
icon={Link}
19-
title='Links'
20-
columns={SIM_LINK_COLUMNS}
21-
actions={hosted ? [INSTALL_EXTENSION_ACTION, NEW_SIM_LINK_ACTION] : [NEW_SIM_LINK_ACTION]}
22-
searchPlaceholder={SIM_LINKS_SEARCH_PLACEHOLDER}
23-
hasSort
24-
/>
25-
</div>
9+
<LinksSurface>
10+
<LinksFrame loading>
11+
<LinkRowsSkeleton />
12+
</LinksFrame>
13+
</LinksSurface>
2614
)
2715
}

‎apps/sim/app/o/[organizationId]/links/page.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { getSession } from '@/lib/auth'
44
import { organizationRoutes } from '@/lib/navigation/paths'
55
import { isSimLinksEnabled } from '@/lib/sim-links/feature-flag'
66
import { buildAuthCrossLink } from '@/app/(auth)/auth-redirect'
7-
import { SimLinks } from '@/app/o/[organizationId]/links/sim-links'
7+
import { LinksSurface } from '@/app/o/[organizationId]/links/links-surface'
8+
import { LinksPage } from '@/platform/app/(shell)/links/_components/links-page/links-page'
89

910
export const metadata: Metadata = { title: 'Links' }
1011

@@ -23,5 +24,9 @@ export default async function SimLinksPage({ params }: SimLinksPageProps) {
2324
})
2425
)
2526
if (!(await isSimLinksEnabled(organizationId))) notFound()
26-
return <SimLinks organizationId={organizationId} />
27+
return (
28+
<LinksSurface>
29+
<LinksPage organizationId={organizationId} />
30+
</LinksSurface>
31+
)
2732
}

‎apps/sim/app/o/[organizationId]/links/search-params.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { createParser, createSerializer, parseAsString } from 'nuqs/server'
33
import { SIM_LINK_SEARCH_MAX_LENGTH, SIM_LINK_SORTS } from '@/lib/sim-links/validation'
44
import { createSortParams } from '@/lib/url-state'
55

6-
const boundedSearch = (value: string) => truncateAtCodePoint(value, SIM_LINK_SEARCH_MAX_LENGTH, '')
6+
export const boundedSearch = (value: string) =>
7+
truncateAtCodePoint(value, SIM_LINK_SEARCH_MAX_LENGTH, '')
78

89
/**
910
* `create` opens the new-link editor, prefilled with its value as the name. `search` filters by

‎apps/sim/app/o/[organizationId]/links/sim-link-context-menu.tsx‎

Lines changed: 0 additions & 76 deletions
This file was deleted.

‎apps/sim/app/o/[organizationId]/links/sim-link-icon.tsx‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)