Skip to content

Commit cdcca53

Browse files
waleedlatif1claude
andcommitted
fix(landing): address PR review issues and convention violations
- Fix auth modal race condition: show loading state instead of redirecting when provider status hasn't loaded yet - Fix auth modal HTTP error caching: reject non-200 responses so they aren't permanently cached - Replace <img> with next/image <Image> in auth modal - Use cn() instead of template literal class concatenation in hero, footer-cta - Remove commented-out dead code in footer, landing, sitemap - Remove unused arrow property from FooterItem interface - Convert relative imports to absolute in integrations/[slug]/page - Remove no-op sanitizedName variable in signup form - Remove unnecessary async from llms-full.txt route - Remove extraneous non-TSDoc comment in auth modal Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eb0e304 commit cdcca53

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ function SignupFormContent({ githubAvailable, googleAvailable, isProduction }: S
241241
return
242242
}
243243

244-
const sanitizedName = trimmedName
245-
246244
let token: string | undefined
247245
const widget = turnstileRef.current
248246
if (turnstileSiteKey && widget) {
@@ -265,7 +263,7 @@ function SignupFormContent({ githubAvailable, googleAvailable, isProduction }: S
265263
{
266264
email: emailValue,
267265
password: passwordValue,
268-
name: sanitizedName,
266+
name: trimmedName,
269267
},
270268
{
271269
headers: {

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

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

33
import { useCallback, useEffect, useState } from 'react'
44
import { Loader2, X } from 'lucide-react'
5+
import Image from 'next/image'
56
import { useRouter } from 'next/navigation'
67
import { Modal, ModalClose, ModalContent, ModalTitle, ModalTrigger } from '@/components/emcn'
78
import { GithubIcon, GoogleIcon } from '@/components/icons'
@@ -26,14 +27,23 @@ interface ProviderStatus {
2627

2728
let fetchPromise: Promise<ProviderStatus> | null = null
2829

30+
const FALLBACK_STATUS: ProviderStatus = {
31+
githubAvailable: false,
32+
googleAvailable: false,
33+
isProduction: false,
34+
}
35+
2936
function fetchProviderStatus(): Promise<ProviderStatus> {
3037
if (fetchPromise) return fetchPromise
3138
fetchPromise = fetch('/api/auth/providers')
32-
.then((r) => r.json())
39+
.then((r) => {
40+
if (!r.ok) throw new Error(`HTTP ${r.status}`)
41+
return r.json()
42+
})
3343
.then((data: ProviderStatus) => data)
3444
.catch(() => {
3545
fetchPromise = null
36-
return { githubAvailable: false, googleAvailable: false, isProduction: false }
46+
return FALLBACK_STATUS
3747
})
3848
return fetchPromise
3949
}
@@ -54,7 +64,7 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
5464

5565
const handleOpenChange = useCallback(
5666
(nextOpen: boolean) => {
57-
if (nextOpen && !hasSocial) {
67+
if (nextOpen && providerStatus && !hasSocial) {
5868
router.push(defaultView === 'login' ? '/login' : '/signup')
5969
return
6070
}
@@ -64,15 +74,14 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
6474
captureClientEvent('auth_modal_opened', { view: defaultView, source })
6575
}
6676
},
67-
[defaultView, hasSocial, router, source]
77+
[defaultView, hasSocial, providerStatus, router, source]
6878
)
6979

7080
const handleSocialLogin = useCallback(async (provider: 'github' | 'google') => {
7181
setSocialLoading(provider)
7282
try {
7383
await client.signIn.social({ provider, callbackURL: '/workspace' })
7484
} catch {
75-
// Redirect handles success; errors are typically cancelled flows
7685
} finally {
7786
setSocialLoading(null)
7887
}
@@ -107,11 +116,12 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
107116
) : (
108117
<>
109118
<div className='flex flex-col items-start gap-6 pe-10'>
110-
<img
119+
<Image
111120
src={brand.logoUrl || '/logo/sim-landing.svg'}
112121
alt={brand.name}
113122
width={71}
114123
height={22}
124+
unoptimized
115125
className='h-[22px] w-auto shrink-0 object-contain'
116126
/>
117127
<div className='flex flex-col gap-1 text-left'>

apps/sim/app/(landing)/components/footer/footer-cta.tsx

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

33
import { useCallback, useRef, useState } from 'react'
44
import { ArrowUp } from 'lucide-react'
5+
import { cn } from '@/lib/core/utils/cn'
56
import { captureClientEvent } from '@/lib/posthog/client'
67
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
78
import { useLandingSubmit } from '@/app/(landing)/components/landing-preview/components/landing-preview-panel/landing-preview-panel'
@@ -96,7 +97,7 @@ export function FooterCTA() {
9697
href='https://docs.sim.ai'
9798
target='_blank'
9899
rel='noopener noreferrer'
99-
className={`${CTA_BUTTON} border-[var(--landing-border-strong)] text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]`}
100+
className={cn(CTA_BUTTON, 'border-[var(--landing-border-strong)] text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]')}
100101
onClick={() =>
101102
trackLandingCta({
102103
label: 'Docs',
@@ -110,7 +111,7 @@ export function FooterCTA() {
110111
<AuthModal defaultView='signup' source='footer_cta'>
111112
<button
112113
type='button'
113-
className={`${CTA_BUTTON} gap-2 border-white bg-white text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]`}
114+
className={cn(CTA_BUTTON, 'gap-2 border-white bg-white text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]')}
114115
onClick={() =>
115116
trackLandingCta({
116117
label: 'Get started',

apps/sim/app/(landing)/components/footer/footer.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ interface FooterItem {
99
label: string
1010
href: string
1111
external?: boolean
12-
arrow?: boolean
1312
externalArrow?: boolean
1413
}
1514

@@ -26,10 +25,8 @@ const PRODUCT_LINKS: FooterItem[] = [
2625

2726
const RESOURCES_LINKS: FooterItem[] = [
2827
{ label: 'Blog', href: '/blog' },
29-
// { label: 'Templates', href: '/templates' },
3028
{ label: 'Docs', href: 'https://docs.sim.ai', external: true },
3129
{ label: 'Models', href: '/models' },
32-
// { label: 'Academy', href: '/academy' },
3330
{ label: 'Partners', href: '/partners' },
3431
{ label: 'Careers', href: 'https://jobs.ashbyhq.com/sim', external: true, externalArrow: true },
3532
{ label: 'Changelog', href: '/changelog' },

apps/sim/app/(landing)/components/hero/hero.tsx

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

33
import dynamic from 'next/dynamic'
4+
import { cn } from '@/lib/core/utils/cn'
45
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
56
import { DemoRequestModal } from '@/app/(landing)/components/demo-request/demo-request-modal'
67
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
@@ -16,7 +17,6 @@ const LandingPreview = dynamic(
1617
}
1718
)
1819

19-
/** Shared base classes for CTA link buttons — matches Deploy/Run button styling in the preview panel. */
2020
const CTA_BASE =
2121
'inline-flex items-center h-[32px] rounded-[5px] border px-2.5 font-[430] font-season text-sm'
2222

@@ -56,7 +56,7 @@ export default function Hero() {
5656
<DemoRequestModal theme='light'>
5757
<button
5858
type='button'
59-
className={`${CTA_BASE} border-[var(--landing-border-strong)] bg-transparent text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]`}
59+
className={cn(CTA_BASE, 'border-[var(--landing-border-strong)] bg-transparent text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]')}
6060
aria-label='Get a demo'
6161
onClick={() =>
6262
trackLandingCta({ label: 'Get a demo', section: 'hero', destination: 'demo_modal' })
@@ -68,7 +68,7 @@ export default function Hero() {
6868
<AuthModal defaultView='signup' source='hero'>
6969
<button
7070
type='button'
71-
className={`${CTA_BASE} gap-2 border-white bg-white text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]`}
71+
className={cn(CTA_BASE, 'gap-2 border-white bg-white text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]')}
7272
aria-label='Get started with Sim'
7373
onClick={() =>
7474
trackLandingCta({

apps/sim/app/(landing)/integrations/[slug]/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { notFound } from 'next/navigation'
55
import { getBaseUrl } from '@/lib/core/utils/urls'
66
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
77
import { TEMPLATES } from '@/app/workspace/[workspaceId]/home/components/template-prompts/consts'
8-
import { IntegrationIcon } from '../components/integration-icon'
9-
import { blockTypeToIconMap } from '../data/icon-mapping'
10-
import integrations from '../data/integrations.json'
11-
import type { AuthType, FAQItem, Integration } from '../data/types'
12-
import { IntegrationFAQ } from './components/integration-faq'
13-
import { TemplateCardButton } from './components/template-card-button'
8+
import { IntegrationIcon } from '@/app/(landing)/integrations/components/integration-icon'
9+
import { blockTypeToIconMap } from '@/app/(landing)/integrations/data/icon-mapping'
10+
import integrations from '@/app/(landing)/integrations/data/integrations.json'
11+
import type { AuthType, FAQItem, Integration } from '@/app/(landing)/integrations/data/types'
12+
import { IntegrationFAQ } from '@/app/(landing)/integrations/[slug]/components/integration-faq'
13+
import { TemplateCardButton } from '@/app/(landing)/integrations/[slug]/components/template-card-button'
1414

1515
const allIntegrations = integrations as Integration[]
1616
const INTEGRATION_COUNT = allIntegrations.length

apps/sim/app/(landing)/landing.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { martianMono } from '@/app/_styles/fonts/martian-mono/martian-mono'
33
import { season } from '@/app/_styles/fonts/season/season'
44
import {
55
Collaboration,
6-
// Enterprise,
76
Features,
87
Footer,
98
Hero,
@@ -31,7 +30,7 @@ import { LandingAnalytics } from '@/app/(landing)/landing-analytics'
3130
* - Section `id` attributes serve as fragment anchors for precise AI citations.
3231
* - Content ordering prioritizes answer-first patterns: definition (Hero) ->
3332
* examples (Templates) -> capabilities (Features) -> social proof (Collaboration) ->
34-
* enterprise (Enterprise) -> pricing (Pricing) -> testimonials (Testimonials).
33+
* pricing (Pricing) -> testimonials (Testimonials).
3534
*/
3635
export default async function Landing() {
3736
const blogPosts = await getNavBlogPosts()
@@ -65,7 +64,6 @@ export default async function Landing() {
6564
<Templates />
6665
<Features />
6766
<Collaboration />
68-
{/* <Enterprise /> */}
6967
<Pricing />
7068
<Testimonials />
7169
</article>

apps/sim/app/llms-full.txt/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { getBaseUrl } from '@/lib/core/utils/urls'
22

3-
export async function GET() {
3+
export function GET() {
44
const baseUrl = getBaseUrl()
55

66
const llmsFullContent = `# Sim — The AI Workspace | Build, Deploy & Manage AI Agents

apps/sim/app/sitemap.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
6666
url: `${baseUrl}/blog/tags`,
6767
lastModified: now,
6868
},
69-
// {
70-
// url: `${baseUrl}/templates`,
71-
// lastModified: now,
72-
// },
7369
{
7470
url: `${baseUrl}/changelog`,
7571
lastModified: now,

0 commit comments

Comments
 (0)