Skip to content

Commit 9a4cd95

Browse files
waleedlatif1claude
andauthored
feat(logs): trace span tree rewrite with resizable split, provider icons, and execution improvements (#4292)
* improvement(trace-spans): rewrite trace span pipeline with per-iteration enrichment Unify tool calls under span.children, capture dual-clock timing, and surface per-iteration model content (assistant text, thinking, tool calls, finish reason, tokens, cost, ttft, provider, errors) across all 12 LLM providers. UI renders the new fields on model child spans; old logs degrade gracefully since every field is optional. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * improvement(logs): add Trace tab with two-pane tree+detail view - Wrap log-details drawer in Overview | Trace tabs; Overview unchanged - New TraceView with hierarchical tree on the left and detail pane on the right - Keyboard nav, span filter, expand/collapse all - Bump min drawer width 400->600 and clamp persisted widths on rehydrate Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(logs): retry failed runs + show workflow input in detail Brings PR #4181 inline: persists workflowInput on successful runs, adds useRetryExecution mutation (streaming read-one-chunk-and-cancel), Retry entrypoints in the row context menu and the detail sidebar, and extractRetryInput with fallback to starter block state for older logs. Also surfaces the captured input in a new "Workflow Input" section above Workflow Output in the detail Overview tab, guarded so older logs without the field don't render an empty block. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(ui): use inverted popover scheme for usage-control popovers Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(logs): trace view chevron padding, section state leak, and tab-scoped keyboard nav - Pad tree rows from panel edge so the root chevron isn't visually clipped. - Key DetailCodeSection by label so collapse state belongs to the section purpose, preventing isOpen from leaking across span changes when positional slots happened to align. - Ignore log-to-log arrow-key nav while the Trace tab is active so TraceView owns span navigation; filter inputs keep native caret movement. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(logs): align trace tree rows to 14px content grid Chevron at depth 0 and the timeline bars now sit on the same 14px left/right grid as the trace view's header strip and the rest of the log details panel, removing the stagger where bars extended further left than chevrons and the chevron appeared cramped against the panel edge. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(logs): restore scroll in log-details panel Overview tab's scroll container (SModalTabsContent) was wrapped around a non-overflow inner div that held the scrollAreaRef, so the scroll-reset on log change targeted a non-scrolling element. Collapse the wrapper into the Tabs.Content element itself and move the ref there. Add min-h-0 to the Trace detail pane wrapper so its scrolling child can shrink inside the horizontal-flex row. * fix(logs): hide inactive Overview tab panel Tailwind's `.flex` utility overrides the UA `[hidden]` rule, so applying `flex` to SModalTabsContent caused the inactive Overview panel to still participate in the Tabs flex column and push the Trace view down. Keep SModalTabsContent as a plain overflow container (no `flex` class) with the scroll ref on it, and restore the inner flex-col wrapper for the Overview content so it still stacks with gap spacing. * fix(logs): trace view padding, section cutoff, keyboard visibility - Tree pane now has top padding so the first row has breathing room under the header strip instead of sitting flush against the border. - DetailCodeSection dropped its wrapper `overflow-hidden`. Per CSS, a flex item with `overflow: hidden` resolves `min-height: auto` to `0`, so when Input and Output were both expanded the flex algorithm shrank each section below its content, cutting off rows. Without the clip, sections size to content and the surrounding pane's `overflow-y-auto` takes over. - Selected span row now scrolls into view on selection change, so arrow-key navigation always keeps the active row visible in the tree pane. * fix(logs): inline Workflow State row and lift search dropdown z-index Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(logs): use emcn Button for View Snapshot action Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * minor improvements * fix(logs): trace view resizable split, bar visibility, provider icons, cleanup - Resizable tree/detail split in trace view (default 360px, drag to resize) - Resizable right panel in preview snapshot (280–600px) - Fix Gantt bar invisibility for late-run spans (clamp offsetPct to 100-MIN_BAR_PCT) - Propagate model+provider to child model spans in span-factory for correct icons - Fix icon contrast on light provider backgrounds (luminance-based color class) - Replace custom status badges with emcn Badge component - Lighten jump-to-error button to ghost variant - Remove double X button in modal snapshot (showBlockCloseButton prop) - Fix emcn subpath imports → barrel in trace-view, log-details, execution-snapshot - Fix hover: → hover-hover: on resize handles - Add body style cleanup on resize unmount - Fix React Query key factory naming (stats/stat convention) - Remove unnecessary useCallback/useMemo in preview and execution-snapshot * fix(ui): scroll guard, credentials UX, design token fixes, input padding - logs: only scroll-into-view on keyboard nav, not on click selection - resource: stable scrollbar gutter, wider first column - credentials: toast success/error feedback, remove useMemo for personalEnvData, allow editing conflict rows, fix disabled state visibility, use --text-error token - integrations: use --text-error token for error state - input: increase right padding (px-2 → pl-2 pr-3) * chore(skills): add /ship command to claude, cursor, and agents * fix(input): add scroll-pr-1 to keep caret visible when text overflows * fix(logs): address PR review — iteration name guard, cost race, mothership retry * improvement(logs): cleanup pass — remove anti-patterns, fix design tokens, simplify state * fix(trace-spans): extend final model segment by position not by stale constant name * fix(modal): restore sidebar-width padding on non-workflow pages * fix(secrets): eliminate slow save by parallelizing DB ops and fixing stuck button Sequential per-variable, per-workspace DB round-trips in syncPersonalEnvCredentialsForUser caused O(W×K) latency (800–1600ms for 10 workspaces). Replaced with parallel workspace processing and batched upserts. Also parallelized secret decryption in the GET handler. On the client, removed the changeToken bug that left the Save button permanently disabled after a failed save, split the shared hasSavedRef into two independent flags to eliminate ordering races, and moved ref updates to after mutation success so optimistic state can never get stuck. * updated sap block * fix(sap): remove slash from S4HANA name, set white bgColor, regenerate docs * fix(logs): prevent log-row arrow navigation when trace tab is active * fix(logs): aggregate cost onto workflow root span; stabilize onActiveTabChange callback * improvement(logs): fix Gantt time bounds to walk full span tree; cleanup effects, memos, callbacks, React Query mutations * fix(logs): reset detail panel tab to overview on log switch * chore(logs): remove extraneous comments * fix(logs): restore useEffect for async setActiveWorkflow and useMemo on rowProps - resource-content.tsx: revert render-time setActiveWorkflow call to useEffect; the store action is async and performs network ops, calling it during render violates React purity - logs-list.tsx: restore useMemo on rowProps to prevent virtualized list rows from re-rendering on every parent render * fix(queries): forward AbortSignal in mothership-admin query functions All queryFn callbacks must forward signal for request cancellation per project React Query standards. --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent ed206ed commit 9a4cd95

88 files changed

Lines changed: 5153 additions & 2186 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.

.agents/skills/ship/SKILL.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: ship
3+
description: Commit, push, and open a PR to staging in one shot
4+
---
5+
6+
# Ship Command
7+
8+
You help ship code by creating commits, pushing to the remote branch, and creating PRs in the user's voice.
9+
10+
## Your Task
11+
12+
When the user runs `/ship`:
13+
14+
1. **Check git status** - See what files have changed
15+
2. **Generate a commit message** following this format: `type(scope): description`
16+
- Types: `fix`, `feat`, `improvement`, `chore`
17+
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
18+
- Keep it concise
19+
20+
3. **Run lint** - Run `bun run lint` from the repo root to fix formatting issues before staging
21+
22+
4. **Stage and commit** the changes with the generated message
23+
24+
5. **Push to origin** using the current branch name
25+
26+
6. **Create a PR** to staging with a description in the user's voice
27+
28+
## Commit Message Format
29+
30+
Based on the repo's commit history:
31+
```
32+
fix(scope): description for bug fixes
33+
feat(scope): description for new features
34+
improvement(scope): description for enhancements
35+
chore(scope): description for maintenance
36+
```
37+
38+
## PR Description Format
39+
40+
Use this exact template in the user's voice (concise, bullet points):
41+
42+
```markdown
43+
## Summary
44+
- bullet point describing what changed
45+
- another bullet point if needed
46+
47+
## Type of Change
48+
- [x] Bug fix (or appropriate type)
49+
50+
## Testing
51+
Tested manually (or describe testing)
52+
53+
## Checklist
54+
- [x] Code follows project style guidelines
55+
- [x] Self-reviewed my changes
56+
- [ ] Tests added/updated and passing
57+
- [x] No new warnings introduced
58+
- [x] I confirm that I have read and agree to the terms outlined in the [Contributor License Agreement (CLA)](./CONTRIBUTING.md#contributor-license-agreement-cla)
59+
```
60+
61+
## PR Creation Command
62+
63+
Use this command structure:
64+
```bash
65+
gh pr create --base staging --title "COMMIT_MESSAGE" --body "PR_BODY"
66+
```
67+
68+
## Important Notes
69+
70+
- Always confirm the commit message and PR description with the user before executing
71+
- The PR should be created against `staging` branch
72+
- Keep descriptions concise and in active voice
73+
- Match the user's previous PR style: direct, no fluff, bullet points
74+
- **DO NOT add "Co-Authored-By" lines to commits** - keep commit messages clean
75+
76+
## User's Voice Characteristics (based on previous PRs)
77+
78+
- Short, direct bullet points
79+
- No unnecessary explanation
80+
- "Tested manually" is acceptable for testing section
81+
- Checkboxes filled in appropriately
82+
- No screenshots section unless UI changes

.claude/commands/ship.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
description: Commit, push, and open a PR to staging in one shot
3+
argument-hint: [optional context or scope notes]
4+
---
5+
6+
# Ship Command
7+
8+
You help ship code by creating commits, pushing to the remote branch, and creating PRs in the user's voice.
9+
10+
## Your Task
11+
12+
When the user runs `/ship`:
13+
14+
1. **Check git status** - See what files have changed
15+
2. **Generate a commit message** following this format: `type(scope): description`
16+
- Types: `fix`, `feat`, `improvement`, `chore`
17+
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
18+
- Keep it concise
19+
20+
3. **Run lint** - Run `bun run lint` from the repo root to fix formatting issues before staging
21+
22+
4. **Stage and commit** the changes with the generated message
23+
24+
5. **Push to origin** using the current branch name
25+
26+
6. **Create a PR** to staging with a description in the user's voice
27+
28+
## Commit Message Format
29+
30+
Based on the repo's commit history:
31+
```
32+
fix(scope): description for bug fixes
33+
feat(scope): description for new features
34+
improvement(scope): description for enhancements
35+
chore(scope): description for maintenance
36+
```
37+
38+
## PR Description Format
39+
40+
Use this exact template in the user's voice (concise, bullet points):
41+
42+
```markdown
43+
## Summary
44+
- bullet point describing what changed
45+
- another bullet point if needed
46+
47+
## Type of Change
48+
- [x] Bug fix (or appropriate type)
49+
50+
## Testing
51+
Tested manually (or describe testing)
52+
53+
## Checklist
54+
- [x] Code follows project style guidelines
55+
- [x] Self-reviewed my changes
56+
- [ ] Tests added/updated and passing
57+
- [x] No new warnings introduced
58+
- [x] I confirm that I have read and agree to the terms outlined in the [Contributor License Agreement (CLA)](./CONTRIBUTING.md#contributor-license-agreement-cla)
59+
```
60+
61+
## PR Creation Command
62+
63+
Use this command structure:
64+
```bash
65+
gh pr create --base staging --title "COMMIT_MESSAGE" --body "PR_BODY"
66+
```
67+
68+
## Important Notes
69+
70+
- Always confirm the commit message and PR description with the user before executing
71+
- The PR should be created against `staging` branch
72+
- Keep descriptions concise and in active voice
73+
- Match the user's previous PR style: direct, no fluff, bullet points
74+
- **DO NOT add "Co-Authored-By" lines to commits** - keep commit messages clean
75+
76+
## User's Voice Characteristics (based on previous PRs)
77+
78+
- Short, direct bullet points
79+
- No unnecessary explanation
80+
- "Tested manually" is acceptable for testing section
81+
- Checkboxes filled in appropriately
82+
- No screenshots section unless UI changes

.cursor/commands/ship.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Ship Command
2+
3+
You help ship code by creating commits, pushing to the remote branch, and creating PRs in the user's voice.
4+
5+
## Your Task
6+
7+
When the user runs `/ship`:
8+
9+
1. **Check git status** - See what files have changed
10+
2. **Generate a commit message** following this format: `type(scope): description`
11+
- Types: `fix`, `feat`, `improvement`, `chore`
12+
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
13+
- Keep it concise
14+
15+
3. **Run lint** - Run `bun run lint` from the repo root to fix formatting issues before staging
16+
17+
4. **Stage and commit** the changes with the generated message
18+
19+
5. **Push to origin** using the current branch name
20+
21+
6. **Create a PR** to staging with a description in the user's voice
22+
23+
## Commit Message Format
24+
25+
Based on the repo's commit history:
26+
```
27+
fix(scope): description for bug fixes
28+
feat(scope): description for new features
29+
improvement(scope): description for enhancements
30+
chore(scope): description for maintenance
31+
```
32+
33+
## PR Description Format
34+
35+
Use this exact template in the user's voice (concise, bullet points):
36+
37+
```markdown
38+
## Summary
39+
- bullet point describing what changed
40+
- another bullet point if needed
41+
42+
## Type of Change
43+
- [x] Bug fix (or appropriate type)
44+
45+
## Testing
46+
Tested manually (or describe testing)
47+
48+
## Checklist
49+
- [x] Code follows project style guidelines
50+
- [x] Self-reviewed my changes
51+
- [ ] Tests added/updated and passing
52+
- [x] No new warnings introduced
53+
- [x] I confirm that I have read and agree to the terms outlined in the [Contributor License Agreement (CLA)](./CONTRIBUTING.md#contributor-license-agreement-cla)
54+
```
55+
56+
## PR Creation Command
57+
58+
Use this command structure:
59+
```bash
60+
gh pr create --base staging --title "COMMIT_MESSAGE" --body "PR_BODY"
61+
```
62+
63+
## Important Notes
64+
65+
- Always confirm the commit message and PR description with the user before executing
66+
- The PR should be created against `staging` branch
67+
- Keep descriptions concise and in active voice
68+
- Match the user's previous PR style: direct, no fluff, bullet points
69+
- **DO NOT add "Co-Authored-By" lines to commits** - keep commit messages clean
70+
71+
## User's Voice Characteristics (based on previous PRs)
72+
73+
- Short, direct bullet points
74+
- No unnecessary explanation
75+
- "Tested manually" is acceptable for testing section
76+
- Checkboxes filled in appropriately
77+
- No screenshots section unless UI changes

apps/docs/content/docs/en/tools/sap_s4hana.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
---
2-
title: SAP S/4HANA
3-
description: Read and write SAP S/4HANA Cloud business data via OData
2+
title: SAP S4HANA
3+
description: Read and write SAP S4HANA Cloud business data via OData
44
---
55

66
import { BlockInfoCard } from "@/components/ui/block-info-card"
77

88
<BlockInfoCard
99
type="sap_s4hana"
10-
color="#0A6ED1"
10+
color="#FFFFFF"
1111
/>
1212

1313
{/* MANUAL-CONTENT-START:intro */}
14-
[SAP S/4HANA](https://www.sap.com/products/erp/s4hana.html) is SAP's flagship intelligent ERP suite, running on the in-memory HANA database. It powers finance, supply chain, procurement, sales, and manufacturing for organizations of every size, and exposes its business data through a broad catalog of OData services on SAP Business Technology Platform (BTP).
14+
[SAP S4HANA](https://www.sap.com/products/erp/s4hana.html) is SAP's flagship intelligent ERP suite, running on the in-memory HANA database. It powers finance, supply chain, procurement, sales, and manufacturing for organizations of every size, and exposes its business data through a broad catalog of OData services on SAP Business Technology Platform (BTP).
1515

16-
With SAP S/4HANA, you can:
16+
With SAP S4HANA, you can:
1717

1818
- **Run core business processes**: Manage finance, procurement, sales, logistics, inventory, and manufacturing on a single source of truth.
1919
- **Model master data at scale**: Maintain business partners, customers, suppliers, products, and organizational structures across multiple company codes, sales organizations, and plants.
2020
- **Execute transactional flows end to end**: Create and update sales orders, purchase requisitions, purchase orders, deliveries, billing documents, supplier invoices, and stock movements with full audit trails.
2121
- **Govern access cleanly**: Use Communication Arrangements, Communication Systems, and Communication Scopes to scope OAuth client credentials to exactly the services each integration needs.
2222
- **Integrate via standard OData**: Every entity supported here speaks OData v2 with consistent paging, filtering, expansion, and ETag-based optimistic concurrency.
2323

24-
In Sim, the SAP S/4HANA integration lets your agents read and write directly against your tenant's OData services using per-tenant OAuth 2.0 client credentials. Agents can list and fetch master data, create and update transactional documents, run stock and material document queries, and execute arbitrary OData v2 calls against any whitelisted Communication Scenario — all routed through a single internal proxy that handles token acquisition, CSRF fetch-and-retry, and OData error normalization. Use it to automate order-to-cash, procure-to-pay, and inventory workflows, keep SAP in sync with the rest of your stack, or trigger downstream agent logic from SAP business events.
24+
In Sim, the SAP S4HANA integration lets your agents read and write directly against your tenant's OData services using per-tenant OAuth 2.0 client credentials. Agents can list and fetch master data, create and update transactional documents, run stock and material document queries, and execute arbitrary OData v2 calls against any whitelisted Communication Scenario — all routed through a single internal proxy that handles token acquisition, CSRF fetch-and-retry, and OData error normalization. Use it to automate order-to-cash, procure-to-pay, and inventory workflows, keep SAP in sync with the rest of your stack, or trigger downstream agent logic from SAP business events.
2525
{/* MANUAL-CONTENT-END */}
2626

2727

2828
## Usage Instructions
2929

3030
{/* MANUAL-CONTENT-START:usage */}
31-
Connect any SAP S/4HANA tenant — **Cloud Public Edition**, **Cloud Private Edition (RISE)**, or **on-premise** — and read or write business data through the official OData v2 services. Each tool routes through a single internal proxy that handles token acquisition, CSRF fetch-and-retry for write operations, and OData error normalization.
31+
Connect any SAP S4HANA tenant — **Cloud Public Edition**, **Cloud Private Edition (RISE)**, or **on-premise** — and read or write business data through the official OData v2 services. Each tool routes through a single internal proxy that handles token acquisition, CSRF fetch-and-retry for write operations, and OData error normalization.
3232

3333
### Deployment modes
3434

3535
Pick the deployment that matches your tenant in the **Deployment** dropdown:
3636

37-
- **S/4HANA Cloud Public Edition** — provide your **BTP subaccount subdomain** and **region** (e.g., `eu10`, `us10`). The host is derived automatically as `{subdomain}-api.s4hana.ondemand.com`, and OAuth tokens are fetched from the matching BTP UAA endpoint. Authentication is OAuth 2.0 client credentials configured in a Communication Arrangement.
38-
- **S/4HANA Cloud Private Edition (RISE)** — provide your **OData Base URL** (e.g., `https://my-tenant.s4hana.cloud.sap`). Authenticate with **OAuth 2.0 client credentials** (provide the tenant's UAA `tokenUrl`, `clientId`, `clientSecret`) or **HTTP Basic** with a Communication User (`username`, `password`).
39-
- **On-premise S/4HANA** — provide your **OData Base URL** (e.g., `https://sap.internal.company.com:44300`). Authenticate with **OAuth 2.0 client credentials** issued by your on-prem identity provider, or **HTTP Basic** with a service user.
37+
- **S4HANA Cloud Public Edition** — provide your **BTP subaccount subdomain** and **region** (e.g., `eu10`, `us10`). The host is derived automatically as `{subdomain}-api.s4hana.ondemand.com`, and OAuth tokens are fetched from the matching BTP UAA endpoint. Authentication is OAuth 2.0 client credentials configured in a Communication Arrangement.
38+
- **S4HANA Cloud Private Edition (RISE)** — provide your **OData Base URL** (e.g., `https://my-tenant.s4hana.cloud.sap`). Authenticate with **OAuth 2.0 client credentials** (provide the tenant's UAA `tokenUrl`, `clientId`, `clientSecret`) or **HTTP Basic** with a Communication User (`username`, `password`).
39+
- **On-premise S4HANA** — provide your **OData Base URL** (e.g., `https://sap.internal.company.com:44300`). Authenticate with **OAuth 2.0 client credentials** issued by your on-prem identity provider, or **HTTP Basic** with a service user.
4040

4141
### What you can do
4242

@@ -48,7 +48,7 @@ All update tools accept an optional `ifMatch` ETag. When omitted, `If-Match` def
4848
{/* MANUAL-CONTENT-END */}
4949

5050

51-
Connect SAP S/4HANA Cloud Public Edition with per-tenant OAuth 2.0 client credentials configured in your Communication Arrangements. Read and create business partners, customers, suppliers, sales orders, deliveries (inbound/outbound), billing documents, products, stock and material documents, purchase requisitions, purchase orders, and supplier invoices, or run arbitrary OData v2 queries against any whitelisted Communication Scenario.
51+
Connect SAP S4HANA Cloud Public Edition with per-tenant OAuth 2.0 client credentials configured in your Communication Arrangements. Read and create business partners, customers, suppliers, sales orders, deliveries (inbound/outbound), billing documents, products, stock and material documents, purchase requisitions, purchase orders, and supplier invoices, or run arbitrary OData v2 queries against any whitelisted Communication Scenario.
5252

5353

5454

apps/sim/app/(auth)/signup/signup-form.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,7 @@ function SignupFormContent({ githubAvailable, googleAvailable, isProduction }: S
9898
const [showEmailValidationError, setShowEmailValidationError] = useState(false)
9999
const [formError, setFormError] = useState<string | null>(null)
100100
const turnstileRef = useRef<TurnstileInstance>(null)
101-
const [turnstileSiteKey, setTurnstileSiteKey] = useState<string | undefined>()
102-
103-
useEffect(() => {
104-
setTurnstileSiteKey(getEnv('NEXT_PUBLIC_TURNSTILE_SITE_KEY'))
105-
}, [])
101+
const [turnstileSiteKey] = useState(() => getEnv('NEXT_PUBLIC_TURNSTILE_SITE_KEY'))
106102
const rawRedirectUrl = searchParams.get('redirect') || searchParams.get('callbackUrl') || ''
107103
const isValidRedirectUrl = rawRedirectUrl ? validateCallbackUrl(rawRedirectUrl) : false
108104
const invalidCallbackRef = useRef(false)

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

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

3-
import { useCallback, useEffect, useMemo, useState } from 'react'
3+
import { useEffect, useMemo, useState } from 'react'
44
import { createLogger } from '@sim/logger'
55
import { Loader2, X } from 'lucide-react'
66
import Image from 'next/image'
@@ -88,24 +88,21 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
8888
}
8989
}, [open, providerStatus, hasModalContent, defaultView, router, view])
9090

91-
const handleOpenChange = useCallback(
92-
(nextOpen: boolean) => {
93-
if (nextOpen && providerStatus && !hasModalContent) {
94-
router.push(defaultView === 'login' ? '/login' : '/signup')
95-
return
96-
}
97-
setOpen(nextOpen)
98-
if (nextOpen) {
99-
const initialView =
100-
defaultView === 'signup' && providerStatus?.registrationDisabled ? 'login' : defaultView
101-
setView(initialView)
102-
captureClientEvent('auth_modal_opened', { view: initialView, source })
103-
}
104-
},
105-
[defaultView, hasModalContent, providerStatus, router, source]
106-
)
91+
function handleOpenChange(nextOpen: boolean) {
92+
if (nextOpen && providerStatus && !hasModalContent) {
93+
router.push(defaultView === 'login' ? '/login' : '/signup')
94+
return
95+
}
96+
setOpen(nextOpen)
97+
if (nextOpen) {
98+
const initialView =
99+
defaultView === 'signup' && providerStatus?.registrationDisabled ? 'login' : defaultView
100+
setView(initialView)
101+
captureClientEvent('auth_modal_opened', { view: initialView, source })
102+
}
103+
}
107104

108-
const handleSocialLogin = useCallback(async (provider: 'github' | 'google') => {
105+
async function handleSocialLogin(provider: 'github' | 'google') {
109106
setSocialLoading(provider)
110107
try {
111108
await client.signIn.social({ provider, callbackURL: '/workspace' })
@@ -114,17 +111,17 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
114111
} finally {
115112
setSocialLoading(null)
116113
}
117-
}, [])
114+
}
118115

119-
const handleSSOLogin = useCallback(() => {
116+
function handleSSOLogin() {
120117
setOpen(false)
121118
router.push('/sso')
122-
}, [router])
119+
}
123120

124-
const handleEmailContinue = useCallback(() => {
121+
function handleEmailContinue() {
125122
setOpen(false)
126123
router.push(view === 'login' ? '/login' : '/signup')
127-
}, [router, view])
124+
}
128125

129126
return (
130127
<Modal open={open} onOpenChange={handleOpenChange}>

0 commit comments

Comments
 (0)