Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/desktop-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ on:
- '.github/workflows/desktop-release.yml'
- 'apps/desktop/**'
- 'apps/sim/app/_shell/desktop-update-*.tsx'
- 'apps/sim/app/workspace/**/home/hooks/use-mothership-resize.ts'
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
- 'apps/sim/app/workspace/**/home/hooks/use-resource-panel.ts'
- 'apps/sim/app/workspace/**/home/components/chat-panel-layout.tsx'
- 'apps/sim/stores/chat-panel/**'
- 'apps/sim/stores/constants.ts'
- 'apps/sim/lib/browser-agent/transport.ts'
- 'apps/sim/lib/core/utils/separator-keys.ts'
- 'apps/sim/scripts/fixtures/chat-panel.tsx'
Comment thread
waleedlatif1 marked this conversation as resolved.
- 'apps/sim/app/layout.tsx'
- 'apps/sim/hooks/use-desktop-update-state.ts'
- 'apps/sim/lib/desktop/**'
Expand Down
429 changes: 429 additions & 0 deletions apps/desktop/e2e/chat-panel.spec.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { useEffect, useState } from 'react'
import { cn } from '@sim/emcn'
import { ArrowRight } from '@sim/emcn/icons'
import Link from 'next/link'
import { HomeSection } from '@/components/home/home-section'
import { SettingsGuardedLink } from '@/components/settings/settings-guarded-link'
import { OAUTH_SEARCH_READ_SCOPE, oauthScopeSatisfies } from '@/lib/auth/oauth-provider'
import type { ResourceScope } from '@/lib/core/resource-scope'
import { organizationRoutes } from '@/lib/navigation/paths'
Expand Down Expand Up @@ -142,7 +142,11 @@ export function GetStarted() {
{steps.map((step, i) => {
const complete = completed[step.id]
return (
<Link key={step.id} href={hrefs[step.id]} className={cn(ROW_CLASS, i > 0 && 'border-t')}>
<SettingsGuardedLink
key={step.id}
href={hrefs[step.id]}
className={cn(ROW_CLASS, i > 0 && 'border-t')}
>
<StepMark complete={complete} />
<span
className={cn(
Expand All @@ -153,7 +157,7 @@ export function GetStarted() {
{step.label}
</span>
<ArrowRight className='size-[16px] shrink-0 text-[var(--text-icon)]' />
</Link>
</SettingsGuardedLink>
)
})}
</HomeSection>
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/o/[organizationId]/home/organization-home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function OrganizationHomeContent({
!hasChat && mothershipAvailable && canBuild && (searchAccess.memberScoped || planEnabled)
const liveSearch = getDeploymentShape().features.liveEnterpriseSearch === true
const assistantSearchLevel = 'fast'
const panel = useChatResourcePanel(chat, controller)
const panel = useChatResourcePanel(chat, controller, userId)
const addResource = panel.addResourceFromUser
/** Restore only an explicitly selected results tab on an empty Home; closing it clears the URL. */
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import { createContext, type ReactNode, useContext } from 'react'
import { SettingsGuardedLink } from '@/components/settings/settings-guarded-link'
import { ApiClientError } from '@/lib/api/client/errors'
import { useSession } from '@/lib/auth/auth-client'
import { organizationRoutes } from '@/lib/navigation/paths'
Expand Down Expand Up @@ -75,12 +76,12 @@ export function OrganizationSecretInputHost({
{organizationContext.viewer.isAdmin ? (
<>
Enable Generic Secrets in{' '}
<a
<SettingsGuardedLink
Comment thread
waleedlatif1 marked this conversation as resolved.
className='underline'
href={organizationRoutes(organizationId).settingsSection('integrations')}
>
organization Integrations settings
</a>
</SettingsGuardedLink>
, then return here to enter the keys.
</>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import {
parseSearchConnectionBody,
searchConnectionTargetSchema,
} from '@/lib/knowledge/search/connection-target'
import { rememberSettingsReturnUrl } from '@/lib/navigation/settings-return'
import { OAUTH_PROVIDERS } from '@/lib/oauth/oauth'
import { getServiceConfigByProviderId } from '@/lib/oauth/utils'
import { organizationSecretNameSchema } from '@/lib/organization-secrets/validation'
Expand Down Expand Up @@ -3488,6 +3489,7 @@ function UsageUpgradeDisplay({ data }: { data: UsageUpgradeTagData }) {
{canManageBilling ? (
<ChipLink
href={href}
onNavigate={() => rememberSettingsReturnUrl(href)}
variant='border'
rightIcon={hosted ? ArrowRight : SquareArrowUpRight}
target={hosted ? undefined : '_blank'}
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/workspace/[workspaceId]/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function HomeContent({ chatId, userName, userId }: HomeProps) {
dispatchingHeadId,
getCurrentRequestId,
} = chat
const panel = useChatResourcePanel(chat, controller)
const panel = useChatResourcePanel(chat, controller, userId)
const {
isResourceCollapsed,
skipResourceTransition,
Expand Down
5 changes: 5 additions & 0 deletions apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ import { getWorkflowById, getWorkflows } from '@/hooks/queries/utils/workflow-ca
import { getWorkflowListQueryOptions } from '@/hooks/queries/utils/workflow-list-query'
import { workflowKeys } from '@/hooks/queries/workflows'
import { snapAllSmoothText } from '@/hooks/use-smooth-text'
import { useChatPanelStore } from '@/stores/chat-panel/store'
import { useMothershipEffortStore } from '@/stores/mothership-effort/store'
import { useMothershipQueueStore } from '@/stores/mothership-queue/store'
import type {
Expand Down Expand Up @@ -1183,6 +1184,9 @@ export function useChat(
: pendingChatKeyRef.current
chatIdRef.current = chatId
const resolvedDesktopScopeId = desktopChatScopeId(scopeKey, chatId)
if (wasPending) {
useChatPanelStore.getState().migrate(pendingDesktopScopeId, resolvedDesktopScopeId)
Comment thread
waleedlatif1 marked this conversation as resolved.
}
const activeActivityTracker = resourceActivityTrackerRef.current
if (activeActivityTracker?.generation === streamGenRef.current) {
if (wasPending) {
Expand Down Expand Up @@ -1753,6 +1757,7 @@ export function useChat(
return
}

useChatPanelStore.getState().migrate(previousDesktopScopeId, resolvedChatId)
await migrateDesktopChatScopes(previousDesktopScopeId, resolvedChatId)
if (pendingChatKey) {
useMothershipQueueStore.getState().migrate(pendingChatKey, resolvedChatId)
Expand Down
Loading
Loading