Skip to content

Commit ecca2a1

Browse files
committed
fix(landing): single-shot auth open, stable connector keys, exact prompt-row lookup
- auth-modal: consume openRequestedRef on resolve so a queued double-click (or the shared mount prefetch) can't run openWithStatus twice (no duplicate auth_modal_opened / redundant setView) - landing-preview-knowledge: key connector icons by a stable slug instead of a component name that can be mangled/emptied under minification - workflow-data getEditorPrompt: single ordered pass preserves the original find() first-match-in-order semantics (Map lookup had preferred 'Prompt' over an earlier 'System Prompt')
1 parent 1f3fcb9 commit ecca2a1

3 files changed

Lines changed: 36 additions & 12 deletions

File tree

apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
126126
fetchProviderStatus().then((status) => {
127127
setProviderStatus(status)
128128
if (!openRequestedRef.current) return
129+
// Consume the request so a queued double-click (or the mount prefetch resolving
130+
// on the same promise) can't run openWithStatus twice - no duplicate
131+
// `auth_modal_opened`, no redundant setView.
132+
openRequestedRef.current = false
129133
openWithStatus(status)
130134
})
131135
}

apps/sim/app/(landing)/components/landing-preview/components/landing-preview-knowledge/landing-preview-knowledge.tsx

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,28 @@ import { LandingPreviewResource } from '@/app/(landing)/components/landing-previ
1818

1919
const DB_ICON = <Database className='size-[14px]' />
2020

21-
function connectorIcons(icons: React.ComponentType<{ className?: string }>[]) {
21+
/** Connector icons keyed by a stable slug so list keys never depend on array index
22+
* or a component name that could be mangled/emptied under minification. */
23+
const CONNECTOR_ICONS: Record<string, React.ComponentType<{ className?: string }>> = {
24+
airtable: AirtableIcon,
25+
asana: AsanaIcon,
26+
confluence: ConfluenceIcon,
27+
'google-docs': GoogleDocsIcon,
28+
'google-drive': GoogleDriveIcon,
29+
jira: JiraIcon,
30+
salesforce: SalesforceIcon,
31+
slack: SlackIcon,
32+
zendesk: ZendeskIcon,
33+
}
34+
35+
function connectorIcons(slugs: string[]) {
2236
return {
2337
content: (
2438
<div className='flex items-center gap-1'>
25-
{icons.map((Icon) => (
26-
<Icon key={Icon.displayName ?? Icon.name} className='size-3.5 flex-shrink-0' />
27-
))}
39+
{slugs.map((slug) => {
40+
const Icon = CONNECTOR_ICONS[slug]
41+
return <Icon key={slug} className='size-3.5 flex-shrink-0' />
42+
})}
2843
</div>
2944
),
3045
}
@@ -45,7 +60,7 @@ const ROWS: PreviewRow[] = [
4560
name: { icon: DB_ICON, label: 'Product Documentation' },
4661
documents: { label: '847' },
4762
tokens: { label: '1,284,392' },
48-
connectors: connectorIcons([AsanaIcon, GoogleDocsIcon]),
63+
connectors: connectorIcons(['asana', 'google-docs']),
4964
created: { label: '2 days ago' },
5065
},
5166
},
@@ -55,7 +70,7 @@ const ROWS: PreviewRow[] = [
5570
name: { icon: DB_ICON, label: 'Customer Support KB' },
5671
documents: { label: '234' },
5772
tokens: { label: '892,104' },
58-
connectors: connectorIcons([ZendeskIcon, SlackIcon]),
73+
connectors: connectorIcons(['zendesk', 'slack']),
5974
created: { label: '1 week ago' },
6075
},
6176
},
@@ -65,7 +80,7 @@ const ROWS: PreviewRow[] = [
6580
name: { icon: DB_ICON, label: 'Engineering Wiki' },
6681
documents: { label: '1,203' },
6782
tokens: { label: '2,847,293' },
68-
connectors: connectorIcons([ConfluenceIcon, JiraIcon]),
83+
connectors: connectorIcons(['confluence', 'jira']),
6984
created: { label: 'March 12th, 2026' },
7085
},
7186
},
@@ -75,7 +90,7 @@ const ROWS: PreviewRow[] = [
7590
name: { icon: DB_ICON, label: 'Marketing Assets' },
7691
documents: { label: '189' },
7792
tokens: { label: '634,821' },
78-
connectors: connectorIcons([GoogleDriveIcon, AirtableIcon]),
93+
connectors: connectorIcons(['google-drive', 'airtable']),
7994
created: { label: 'March 5th, 2026' },
8095
},
8196
},
@@ -85,7 +100,7 @@ const ROWS: PreviewRow[] = [
85100
name: { icon: DB_ICON, label: 'Sales Playbook' },
86101
documents: { label: '92' },
87102
tokens: { label: '418,570' },
88-
connectors: connectorIcons([SalesforceIcon]),
103+
connectors: connectorIcons(['salesforce']),
89104
created: { label: 'February 28th, 2026' },
90105
},
91106
},

apps/sim/app/(landing)/components/landing-preview/components/landing-preview-workflow/workflow-data.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,15 @@ export interface EditorPromptData {
342342
export function getEditorPrompt(workflow: PreviewWorkflow): EditorPromptData | null {
343343
for (const block of workflow.blocks) {
344344
if (!AGENT_BLOCK_TYPES.has(block.type)) continue
345-
const rowsByTitle = new Map(block.rows.map((row) => [row.title, row]))
346-
const promptRow = rowsByTitle.get('Prompt') ?? rowsByTitle.get('System Prompt')
345+
// Single ordered pass: the first row matching either prompt title (in row order)
346+
// and the first Model row - preserving the original find() first-match semantics.
347+
let promptRow: (typeof block.rows)[number] | undefined
348+
let modelRow: (typeof block.rows)[number] | undefined
349+
for (const row of block.rows) {
350+
if (!promptRow && (row.title === 'Prompt' || row.title === 'System Prompt')) promptRow = row
351+
if (!modelRow && row.title === 'Model') modelRow = row
352+
}
347353
if (promptRow) {
348-
const modelRow = rowsByTitle.get('Model')
349354
return {
350355
blockId: block.id,
351356
blockName: block.name,

0 commit comments

Comments
 (0)