Skip to content

Commit 47e63e1

Browse files
committed
Merge remote-tracking branch 'origin/staging' into codex/remove-indexed-enterprise-search
2 parents 1bed203 + 9a2b64d commit 47e63e1

28 files changed

Lines changed: 1112 additions & 256 deletions

File tree

‎.github/workflows/desktop-e2e.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ on:
1111
- '.github/workflows/desktop-release.yml'
1212
- 'apps/desktop/**'
1313
- 'apps/sim/app/_shell/desktop-update-*.tsx'
14+
- 'apps/sim/app/workspace/**/home/hooks/use-mothership-resize.ts'
15+
- 'apps/sim/app/workspace/**/home/hooks/use-resource-panel.ts'
16+
- 'apps/sim/app/workspace/**/home/components/chat-panel-layout.tsx'
17+
- 'apps/sim/stores/chat-panel/**'
18+
- 'apps/sim/stores/constants.ts'
19+
- 'apps/sim/lib/browser-agent/transport.ts'
20+
- 'apps/sim/lib/core/utils/separator-keys.ts'
21+
- 'apps/sim/scripts/fixtures/chat-panel.tsx'
1422
- 'apps/sim/app/layout.tsx'
1523
- 'apps/sim/hooks/use-desktop-update-state.ts'
1624
- 'apps/sim/lib/desktop/**'

‎apps/desktop/e2e/chat-panel.spec.ts‎

Lines changed: 429 additions & 0 deletions
Large diffs are not rendered by default.

‎apps/sim/app/o/[organizationId]/home/components/get-started/get-started.tsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { useEffect, useState } from 'react'
44
import { cn } from '@sim/emcn'
55
import { ArrowRight } from '@sim/emcn/icons'
6-
import Link from 'next/link'
76
import { HomeSection } from '@/components/home/home-section'
7+
import { SettingsGuardedLink } from '@/components/settings/settings-guarded-link'
88
import { OAUTH_SEARCH_READ_SCOPE, oauthScopeSatisfies } from '@/lib/auth/oauth-provider'
99
import { organizationRoutes } from '@/lib/navigation/paths'
1010
import {
@@ -194,7 +194,11 @@ export function GetStarted() {
194194
{steps.map((step, i) => {
195195
const complete = completed[step.id]
196196
return (
197-
<Link key={step.id} href={hrefs[step.id]} className={cn(ROW_CLASS, i > 0 && 'border-t')}>
197+
<SettingsGuardedLink
198+
key={step.id}
199+
href={hrefs[step.id]}
200+
className={cn(ROW_CLASS, i > 0 && 'border-t')}
201+
>
198202
<StepMark complete={complete} />
199203
<span
200204
className={cn(
@@ -205,7 +209,7 @@ export function GetStarted() {
205209
{step.label}
206210
</span>
207211
<ArrowRight className='size-[16px] shrink-0 text-[var(--text-icon)]' />
208-
</Link>
212+
</SettingsGuardedLink>
209213
)
210214
})}
211215
</HomeSection>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function OrganizationHomeContent({
139139
const canSelectMode =
140140
!hasChat && mothershipAvailable && canBuild && (searchAccess.memberScoped || planEnabled)
141141
const assistantSearchLevel = 'fast'
142-
const panel = useChatResourcePanel(chat, controller)
142+
const panel = useChatResourcePanel(chat, controller, userId)
143143
const addResource = panel.addResourceFromUser
144144
/** Restore only an explicitly selected results tab on an empty Home; closing it clears the URL. */
145145
useEffect(() => {

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/organization-secret-input.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client'
22

33
import { createContext, type ReactNode, useContext } from 'react'
4+
import { SettingsGuardedLink } from '@/components/settings/settings-guarded-link'
45
import { ApiClientError } from '@/lib/api/client/errors'
56
import { useSession } from '@/lib/auth/auth-client'
67
import { organizationRoutes } from '@/lib/navigation/paths'
@@ -75,12 +76,12 @@ export function OrganizationSecretInputHost({
7576
{organizationContext.viewer.isAdmin ? (
7677
<>
7778
Enable Generic Secrets in{' '}
78-
<a
79+
<SettingsGuardedLink
7980
className='underline'
8081
href={organizationRoutes(organizationId).settingsSection('integrations')}
8182
>
8283
organization Integrations settings
83-
</a>
84+
</SettingsGuardedLink>
8485
, then return here to enter the keys.
8586
</>
8687
) : (

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import {
5353
parseSearchConnectionBody,
5454
searchConnectionTargetSchema,
5555
} from '@/lib/knowledge/search/connection-target'
56+
import { rememberSettingsReturnUrl } from '@/lib/navigation/settings-return'
5657
import { OAUTH_PROVIDERS } from '@/lib/oauth/oauth'
5758
import { getServiceConfigByProviderId } from '@/lib/oauth/utils'
5859
import { organizationSecretNameSchema } from '@/lib/organization-secrets/validation'
@@ -3488,6 +3489,7 @@ function UsageUpgradeDisplay({ data }: { data: UsageUpgradeTagData }) {
34883489
{canManageBilling ? (
34893490
<ChipLink
34903491
href={href}
3492+
onNavigate={() => rememberSettingsReturnUrl(href)}
34913493
variant='border'
34923494
rightIcon={hosted ? ArrowRight : SquareArrowUpRight}
34933495
target={hosted ? undefined : '_blank'}

‎apps/sim/app/workspace/[workspaceId]/home/home.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function HomeContent({ chatId, userName, userId }: HomeProps) {
178178
dispatchingHeadId,
179179
getCurrentRequestId,
180180
} = chat
181-
const panel = useChatResourcePanel(chat, controller)
181+
const panel = useChatResourcePanel(chat, controller, userId)
182182
const {
183183
isResourceCollapsed,
184184
skipResourceTransition,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ import { getWorkflowById, getWorkflows } from '@/hooks/queries/utils/workflow-ca
125125
import { getWorkflowListQueryOptions } from '@/hooks/queries/utils/workflow-list-query'
126126
import { workflowKeys } from '@/hooks/queries/workflows'
127127
import { snapAllSmoothText } from '@/hooks/use-smooth-text'
128+
import { useChatPanelStore } from '@/stores/chat-panel/store'
128129
import { useMothershipEffortStore } from '@/stores/mothership-effort/store'
129130
import { useMothershipQueueStore } from '@/stores/mothership-queue/store'
130131
import type {
@@ -1182,6 +1183,9 @@ export function useChat(
11821183
: pendingChatKeyRef.current
11831184
chatIdRef.current = chatId
11841185
const resolvedDesktopScopeId = desktopChatScopeId(scopeKey, chatId)
1186+
if (wasPending) {
1187+
useChatPanelStore.getState().migrate(pendingDesktopScopeId, resolvedDesktopScopeId)
1188+
}
11851189
const activeActivityTracker = resourceActivityTrackerRef.current
11861190
if (activeActivityTracker?.generation === streamGenRef.current) {
11871191
if (wasPending) {
@@ -1752,6 +1756,7 @@ export function useChat(
17521756
return
17531757
}
17541758

1759+
useChatPanelStore.getState().migrate(previousDesktopScopeId, resolvedChatId)
17551760
await migrateDesktopChatScopes(previousDesktopScopeId, resolvedChatId)
17561761
if (pendingChatKey) {
17571762
useMothershipQueueStore.getState().migrate(pendingChatKey, resolvedChatId)

0 commit comments

Comments
 (0)