Skip to content

Commit 586e0f1

Browse files
committed
Share what the lanes each wrote for themselves
Pass-through seam domains become barrels, so no module re-exports from a non-barrel. Prefetches share one naming scheme, one timeout and one failure path, and every server read now has a deadline. One failure notice, one credits modal, one plural helper and one set of role labels replace the copies. Saved preferences show loading and failure rather than a guessed value, Home stops reading the review queue for members the route refuses, and sign out reports a failure rather than bouncing off login.
1 parent af95eac commit 586e0f1

108 files changed

Lines changed: 621 additions & 714 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/sim/platform/app/(shell)/_components/chat/cards/assistant-review.tsx‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
AssistantReviewAction,
88
} from '@/platform/app/(shell)/_components/chat/model'
99
import { useChatRuntime } from '@/platform/app/(shell)/_components/session/chat-runtime'
10-
import { Button, InlineNotice, StatusTag } from '@/platform/design-system/components'
10+
import { Button, FailureNotice, InlineNotice, StatusTag } from '@/platform/design-system/components'
1111
import { Input, TextArea } from '@/platform/design-system/components/field/inputs'
1212

1313
type Edits = Record<string, Record<string, string>>
@@ -150,17 +150,7 @@ export function AssistantReview({ turnId }: { turnId: string }) {
150150
}
151151
}
152152
if (status === 'error')
153-
return (
154-
<InlineNotice
155-
intent='danger'
156-
message='Could not load action review'
157-
action={
158-
<Button variant='muted' size='compact' onClick={retry}>
159-
Retry
160-
</Button>
161-
}
162-
/>
163-
)
153+
return <FailureNotice message='Could not load action review' onRetry={retry} />
164154
if (!actions.length && !receipts.length) return null
165155
const allowDisabled = pending || actions.some((action) => action.account?.active === false)
166156
return (

‎apps/sim/platform/app/(shell)/_components/chat/message/markdown-content.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { memo, type ReactNode } from 'react'
44
import { Streamdown } from 'streamdown'
55
import styles from '@/platform/app/(shell)/_components/chat/message/markdown.module.css'
66
import { CopyButton } from '@/platform/design-system/components'
7-
import { extractTextContent } from '@/platform/lib/data/node-text'
7+
import { nodeText } from '@/platform/lib/data/node-text'
88

99
const COMPONENTS = {
1010
p: ({ children }: { children?: ReactNode }) => <p data-type='T048'>{children}</p>,
@@ -21,7 +21,7 @@ const COMPONENTS = {
2121
pre: ({ children }: { children?: ReactNode }) => (
2222
<div className={styles.code}>
2323
<span className={styles.copy}>
24-
<CopyButton label='Copy code' text={extractTextContent(children)} />
24+
<CopyButton label='Copy code' text={nodeText(children)} />
2525
</span>
2626
<pre>{children}</pre>
2727
</div>

‎apps/sim/platform/app/(shell)/_components/invite-modal/invite-modal.tsx‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useState } from 'react'
44
import { Modal, RecipientField, SelectField } from '@/platform/design-system/components'
5-
import { useInviteMembers } from '@/platform/lib/data/members'
5+
import { ORGANIZATION_ROLE_OPTIONS, useInviteMembers } from '@/platform/lib/data/members'
66
import { useOrganization } from '@/platform/lib/data/organization'
77

88
interface InviteModalProps {
@@ -15,12 +15,7 @@ interface Recipient {
1515
invalid?: boolean
1616
}
1717

18-
const ROLE_OPTIONS = [
19-
{ value: 'member', label: 'Member' },
20-
{ value: 'admin', label: 'Admin' },
21-
] as const
22-
23-
type InviteRole = (typeof ROLE_OPTIONS)[number]['value']
18+
type InviteRole = (typeof ORGANIZATION_ROLE_OPTIONS)[number]['value']
2419

2520
/**
2621
* Invites people to the organization. Workspace grants belong to the workspace entry points, which
@@ -76,7 +71,7 @@ export function InviteModal({ open, onOpenChange }: InviteModalProps) {
7671
/>
7772
<SelectField
7873
label='Role'
79-
options={viewer.isAdmin ? ROLE_OPTIONS : ROLE_OPTIONS.slice(0, 1)}
74+
options={viewer.isAdmin ? ORGANIZATION_ROLE_OPTIONS : ORGANIZATION_ROLE_OPTIONS.slice(0, 1)}
8075
value={role}
8176
onValueChange={(next) => setRole(next === 'admin' ? 'admin' : 'member')}
8277
disabled={!invite.canInvite}

‎apps/sim/platform/app/(shell)/_components/live-shell/live-shell.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ProductSession } from '@/platform/app/(shell)/_components/product-sessi
88
import { SessionState } from '@/platform/app/(shell)/_components/session-state/session-state'
99
import { resolveSettingsNavigation } from '@/platform/app/(shell)/_components/settings-navigation/destinations'
1010
import { hasOrganizationSurface, legacyRoutes } from '@/platform/lib/data/organization-model'
11-
import { prefetchShell } from '@/platform/lib/data/prefetch'
11+
import { prefetchShell } from '@/platform/lib/data/prefetch-shell'
1212
import { LiveProviders } from '@/platform/lib/data/providers'
1313
import { legacyUrl, loginUrl, readOrganizationSurface } from '@/platform/lib/data/surface'
1414

‎apps/sim/platform/app/(shell)/_components/model.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export interface ShellWorkspace {
3030
name: string
3131
/** Absolute: a workspace opens on the legacy surface. */
3232
href?: string
33-
logoUrl?: string | null
3433
permissions?: 'admin' | 'write' | 'read' | null
3534
isPinned?: boolean
3635
}
@@ -75,7 +74,6 @@ export interface ShellData {
7574
name: string
7675
memberCount: number
7776
id?: string
78-
slug?: string
7977
logo?: string | null
8078
}
8179
user: { name: string; id?: string; email?: string; image?: string | null }

‎apps/sim/platform/app/(shell)/_components/organization-menu/organization-menu.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
} from '@/platform/design-system/components'
1616
import { IdentityButton } from '@/platform/design-system/components/identity-button/identity-button'
1717
import { AnchoredPopover } from '@/platform/design-system/components/menu/anchored-popover'
18+
import { plural } from '@/platform/lib/plural'
1819

1920
/** Lazy because its form reads real data, which a fixture session never loads. */
2021
const InviteModal = dynamic(
@@ -164,9 +165,7 @@ export function OrganizationMenu({
164165
</span>
165166
)}
166167
{organization && (
167-
<span data-type='T050'>
168-
{organization.memberCount} {organization.memberCount === 1 ? 'member' : 'members'}
169-
</span>
168+
<span data-type='T050'>{plural(organization.memberCount, 'member')}</span>
170169
)}
171170
</div>
172171
{(!actions || actions.canInvite) && (

‎apps/sim/platform/app/(shell)/_components/search/search-results.tsx‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
Button,
1010
DateRangePicker,
1111
EmptyState,
12+
FailureNotice,
1213
InlineNotice,
1314
Select,
1415
} from '@/platform/design-system/components'
@@ -41,15 +42,7 @@ export function SearchResults({ results }: { results: SearchResultsData }) {
4142
)}
4243
{status === 'needs-range' && <p data-type='T052'>Choose the days to search.</p>}
4344
{status === 'error' && (
44-
<InlineNotice
45-
intent='danger'
46-
message='Search couldn’t run.'
47-
action={
48-
<Button variant='muted' size='compact' onClick={results.retry}>
49-
Try again
50-
</Button>
51-
}
52-
/>
45+
<FailureNotice message='Search couldn’t run.' onRetry={results.retry} />
5346
)}
5447
{filters && (
5548
<div className={styles.filters} role='group' aria-label='Search filters'>

‎apps/sim/platform/app/(shell)/_components/settings-navigation/settings-navigation.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { SETTINGS_DESTINATIONS } from '@/platform/app/(shell)/_components/settin
77
import styles from '@/platform/app/(shell)/_components/settings-navigation/settings-navigation.module.css'
88
import { Chip, SearchField } from '@/platform/design-system/components'
99
import { platformHref } from '@/platform/design-system/navigation'
10+
import { plural } from '@/platform/lib/plural'
1011

1112
interface SettingsNavigationProps {
1213
section?: string
@@ -83,7 +84,7 @@ export function SettingsNavigation({
8384
/>
8485
{filter ? (
8586
matches.length ? (
86-
group(`${matches.length} ${matches.length === 1 ? 'result' : 'results'}`, matches)
87+
group(plural(matches.length, 'result'), matches)
8788
) : (
8889
<div className={styles.result} role='status'>
8990
<strong data-type='T043'>No matching settings</strong>

‎apps/sim/platform/app/(shell)/home/_components/live-home/live-home-page.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { HydrationBoundary } from '@tanstack/react-query'
22
import { redirect } from 'next/navigation'
33
import { LiveHome } from '@/platform/app/(shell)/home/_components/live-home/live-home'
4-
import { prefetchHome, resolveHomeRedirect } from '@/platform/lib/data/home-server'
4+
import { resolveHomeRedirect } from '@/platform/lib/data/organization-model'
5+
import { prefetchHome } from '@/platform/lib/data/prefetch-home'
56
import { readOrganizationSurface } from '@/platform/lib/data/surface'
67

78
/** The live Home entry: the legacy page's gate, then its cheap reads for first paint. */

‎apps/sim/platform/app/(shell)/people/_components/directory/directory.tsx‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Button,
99
DataTable,
1010
EmptyState,
11+
FailureNotice,
1112
InlineNotice,
1213
PersonRow,
1314
RecipientTag,
@@ -97,15 +98,10 @@ export function PeopleDirectory({ organizationId }: PeopleDirectoryProps) {
9798
{directory.loading ? (
9899
<PeopleStatus>Loading people…</PeopleStatus>
99100
) : directory.error ? (
100-
<InlineNotice
101-
intent='danger'
101+
<FailureNotice
102102
title='Could not load people'
103103
message={directory.error.message}
104-
action={
105-
<Button size='compact' onClick={directory.retry}>
106-
Retry
107-
</Button>
108-
}
104+
onRetry={directory.retry}
109105
/>
110106
) : rows.length === 0 ? (
111107
!directory.query && !directory.hasDepartment ? (

0 commit comments

Comments
 (0)