Skip to content

Commit f713c73

Browse files
committed
improvement(sim-links): loading chrome until the first page, readonly resource props, docs match the UI
1 parent 05f8acc commit f713c73

6 files changed

Lines changed: 27 additions & 18 deletions

File tree

‎apps/docs/content/docs/search/sim-links.mdx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Open **Sim Links** in the organization sidebar to see every link in your organiz
99

1010
## Open a link
1111

12-
Go to `https://sim.ai/sim/<name>`, for example `https://sim.ai/sim/handbook`. On a self-hosted deployment, use your Sim address instead of `sim.ai`. Sim sends you to the link's destination. If you aren't signed in, Sim asks you to sign in first, then continues to the link.
12+
Go to `https://www.sim.ai/sim/<name>`, for example `https://www.sim.ai/sim/handbook`. On a self-hosted deployment, use your Sim address instead. Sim sends you to the link's destination. If you aren't signed in, Sim asks you to sign in first, then continues to the link.
1313

1414
Names ignore case and punctuation, so `sim/Team-Handbook`, `sim/team_handbook`, and `sim/teamhandbook` all open the same link. The destination still applies its own permissions.
1515

@@ -21,7 +21,7 @@ Add Sim as a site search shortcut in Chrome so you can type `sim handbook` inste
2121

2222
1. Open Chrome **Settings → Search engine → Manage search engines and site search**.
2323
2. Next to **Site search**, select **Add**.
24-
3. Enter `Sim` as the name, `sim` as the shortcut, and `https://sim.ai/sim/%s` as the URL.
24+
3. Enter `Sim` as the name, `sim` as the shortcut, and `https://www.sim.ai/sim/%s` as the URL.
2525

2626
Type `sim`, press **Space** or **Tab**, then type a link name such as `handbook` or `jira/123` and press **Enter**.
2727

@@ -30,7 +30,7 @@ Chrome administrators can add this shortcut for everyone with the `SiteSearchSet
3030
## Create a link
3131

3232
1. Open **Sim Links** and select **New link**.
33-
2. Enter the **Destination URL**, a full `https://` address.
33+
2. Enter the **Destination URL**, a full `https://` or `http://` address.
3434
3. Enter a **Name**. Use letters, numbers, and `. : @ & ~ - _`.
3535
4. Optionally add a **Description** so teammates know what the link is for.
3636
5. Select **Create**.
@@ -53,12 +53,12 @@ Each value fills the next `{*}` in order, and the last `{*}` takes everything th
5353

5454
## Control access
5555

56-
Under **Access**, the creator of a link can choose:
56+
The **Access** section of a link has two options. Only the link's creator and organization admins can change them:
5757

58-
- **Unlist**: hides the link from the Sim Links page for everyone except the creator and organization admins. Anyone who knows the name can still open it.
59-
- **Restrict editing**: only the creator and organization admins can edit or delete the link. Everyone can still open it.
58+
- **Hide from the Sim Links page for everyone except you and admins**: the link is listed only for its creator and organization admins. Anyone who knows the name can still open it.
59+
- **Restrict editing to you and admins**: only the creator and organization admins can edit or delete the link. Everyone can still open it.
6060

61-
Without restrictions, any member can edit or delete a link. Only the creator and organization admins can change its access settings. Creating, editing, and deleting links is recorded in your organization's [audit logs](/platform/enterprise/audit-logs).
61+
The **Access** column on the Sim Links page shows **Unlisted** or **Restricted** for links that use them. Without either option, any member can edit or delete a link. Creating, editing, and deleting links is recorded in your organization's [audit logs](/platform/enterprise/audit-logs).
6262

6363
## Related docs
6464

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type ChromeActionSpec,
66
ResourceChromeFallback,
77
} from '@/app/workspace/[workspaceId]/components/resource/components/resource-chrome-fallback'
8+
import type { ResourceColumn } from '@/app/workspace/[workspaceId]/components/resource/resource'
89

910
const COLUMNS = [
1011
{ id: 'name', header: 'Name' },
@@ -13,9 +14,11 @@ const COLUMNS = [
1314
{ id: 'owner', header: 'Created by' },
1415
{ id: 'access', header: 'Access' },
1516
{ id: 'updated', header: 'Updated' },
16-
]
17+
] as const satisfies readonly ResourceColumn[]
1718

18-
const ACTIONS: ChromeActionSpec[] = [{ text: 'New link', icon: Plus, variant: 'primary' }]
19+
const ACTIONS = [
20+
{ text: 'New link', icon: Plus, variant: 'primary' },
21+
] as const satisfies readonly ChromeActionSpec[]
1922

2023
export default function SimLinksLoading() {
2124
return (

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SIM_LINK_SORTS } from '@/lib/sim-links/validation'
33
import { createSortParams } from '@/lib/url-state'
44

55
/** `create` opens the new-link editor, prefilled with its value as the name. */
6-
export const simLinkViewParsers = { create: parseAsString } as const
6+
const simLinkViewParsers = { create: parseAsString } as const
77

88
export const serializeSimLinkView = createSerializer(simLinkViewParsers)
99

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useQueryStates } from 'nuqs'
88
import type { SimLink } from '@/lib/api/contracts/sim-links'
99
import { simLinkPath } from '@/lib/navigation/paths'
1010
import { SEARCH_DEBOUNCE_MS } from '@/lib/url-state'
11+
import SimLinksLoading from '@/app/o/[organizationId]/links/loading'
1112
import {
1213
simLinksParsers,
1314
simLinksSortParams,
@@ -38,14 +39,14 @@ import { useUrlSort } from '@/hooks/use-url-sort'
3839

3940
const logger = createLogger('SimLinks')
4041

41-
const COLUMNS: ResourceColumn[] = [
42+
const COLUMNS = [
4243
{ id: 'name', header: 'Name' },
4344
{ id: 'destination', header: 'Destination', widthMultiplier: 2 },
4445
{ id: 'description', header: 'Description', widthMultiplier: 1.4 },
4546
{ id: 'owner', header: 'Created by' },
4647
{ id: 'access', header: 'Access' },
4748
{ id: 'updated', header: 'Updated' },
48-
]
49+
] as const satisfies readonly ResourceColumn[]
4950

5051
const SORT_OPTIONS = [
5152
{ id: 'name', label: 'Name' },
@@ -130,6 +131,8 @@ export function SimLinks({ organizationId }: SimLinksProps) {
130131
const searching = Boolean(debouncedSearch.trim())
131132
const startCreate = () => void setView({ create: '' })
132133

134+
if (!links.data && !links.isLoadingError) return <SimLinksLoading />
135+
133136
return (
134137
<Resource>
135138
<Resource.Header
@@ -164,7 +167,7 @@ export function SimLinks({ organizationId }: SimLinksProps) {
164167
<p className='text-[var(--text-error)] text-small'>{links.error.message}</p>
165168
<Chip onClick={() => void links.refetch()}>Retry</Chip>
166169
</div>
167-
) : !links.data ? undefined : searching ? (
170+
) : searching ? (
168171
<ResourceNoResults
169172
search={debouncedSearch}
170173
filterCount={0}

‎apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-chrome-fallback/resource-chrome-fallback.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ interface ResourceChromeFallbackProps {
3333
*/
3434
breadcrumbs?: BreadcrumbItem[]
3535
/** Table column headers. Omit on bodies that don't render `Resource.Table` (the table editor). */
36-
columns?: ResourceColumn[]
36+
columns?: readonly ResourceColumn[]
3737
/** The page's exact header action chips (handlers wired to a no-op). */
38-
actions?: ChromeActionSpec[]
38+
actions?: readonly ChromeActionSpec[]
3939
/** Search placeholder. Omit to hide the search box (matches a page with no search). */
4040
searchPlaceholder?: string
4141
/** Paint the Sort chip (its menu never opens during the fallback, so the option list is irrelevant). */

‎apps/sim/app/workspace/[workspaceId]/components/resource/resource.tsx‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ const CHECKBOX_COLUMN_WIDTH = '52px'
153153
* virtualized grid layout reproduces the exact column widths. The checkbox
154154
* column, when present, is a fixed leading track.
155155
*/
156-
function buildGridTemplateColumns(columns: ResourceColumn[], hasCheckbox: boolean): string {
156+
function buildGridTemplateColumns(
157+
columns: readonly ResourceColumn[],
158+
hasCheckbox: boolean
159+
): string {
157160
const weights = columns.map(
158161
(col, colIdx) => (colIdx === 0 ? 2.5 : 1.0) * (col.widthMultiplier ?? 1)
159162
)
@@ -209,7 +212,7 @@ export interface ResourceTableHandle {
209212
}
210213

211214
interface ResourceTableProps {
212-
columns: ResourceColumn[]
215+
columns: readonly ResourceColumn[]
213216
rows: ResourceRow[]
214217
selectedRowId?: string | null
215218
/** Optional imperative handle exposing {@link ResourceTableHandle} (e.g. for keyboard-nav scrolling). */
@@ -639,7 +642,7 @@ const CellContent = memo(function CellContent({
639642

640643
interface DataRowProps {
641644
row: ResourceRow
642-
columns: ResourceColumn[]
645+
columns: readonly ResourceColumn[]
643646
selectedRowId?: string | null
644647
selectable?: SelectableConfig
645648
rowDragDrop?: RowDragDropConfig

0 commit comments

Comments
 (0)