Skip to content

improvement(landing): rebrand to AI workspace, add auth modal, harden PostHog tracking#4116

Merged
waleedlatif1 merged 13 commits intostagingfrom
improvement/landing
Apr 12, 2026
Merged

improvement(landing): rebrand to AI workspace, add auth modal, harden PostHog tracking#4116
waleedlatif1 merged 13 commits intostagingfrom
improvement/landing

Conversation

@emir-karabeg
Copy link
Copy Markdown
Collaborator

Summary

  • Rebrand landing + docs from "workflow tool / automation platform" to "AI workspace" — updates all user-facing copy, SEO metadata, structured data, llms.txt, robots.txt, sitemap.ts, and manifest.ts to reflect the new positioning
  • Add inline auth modal (AuthModal) for social login on landing CTAs — users can sign in with GitHub/Google without leaving the page; falls back to /login or /signup when social providers aren't available
  • Add /api/auth/providers route to power the auth modal's provider detection
  • Harden PostHog event tracking — replace fragile usePostHog() + useEffect([posthog]) pattern with captureClientEvent (fires exactly once on mount); tighten landing_cta_clicked.destination from bare string to an autocomplete-friendly union type; add auth_modal_opened event; add CTA tracking to templates and integration pages
  • Add constitution rules (.claude/rules/constitution.md, .cursor/rules/constitution.mdc) codifying language and positioning guidelines for AI-assisted copy editing

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: SEO / branding / analytics

Testing

  • Tested locally — landing page, auth modal, social login flow, PostHog events in dev tools
  • TypeScript compiles clean (tsc --noEmit)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 12, 2026 3:29am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 12, 2026

PR Summary

Medium Risk
Medium risk because it changes authentication entry points on the landing/integrations pages (new modal + provider-detection API) and adjusts analytics event typing/tracking, which can affect conversion flow and instrumentation but not core auth enforcement.

Overview
Updates Sim’s public positioning from “workflow/agentic workforce platform” to “open-source AI workspace” across landing, integrations/models/partners pages, docs content, SEO metadata, structured data/JSON-LD, manifests, llms.txt outputs, and other crawler-facing files (plus adds copywriting “constitution” rules for AI-assisted edits).

Introduces an AuthModal used by major landing CTAs to enable in-place GitHub/Google sign-in (with SSO/email fallbacks and registration-disabled handling) backed by a new GET /api/auth/providers endpoint.

Hardens and expands PostHog tracking by switching page-view events to captureClientEvent (one-time mount), adding auth_modal_opened and login_page_viewed, tightening landing_cta_clicked typings, and adding CTA tracking to templates, landing preview, and integrations pages.

Reviewed by Cursor Bugbot for commit 7151e98. Configure here.

- 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>
@waleedlatif1 waleedlatif1 changed the base branch from main to staging April 12, 2026 02:44
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- auth-modal: add @sim/logger, log social sign-in errors instead of swallowing silently
- auth-modal: extract duplicated social button classes into SOCIAL_BTN constant
- auth-modal: remove unused isProduction from ProviderStatus interface
- auth-modal: memoize getBrandConfig() call
- footer: remove stale arrow destructuring left after interface cleanup, use cn() throughout
- footer-cta: replace inline styles on submit button with Tailwind classes via cn()
- footer-cta: replace caretColor inline style with caret-white utility
- templates: fix incorrect section value 'landing_preview' → 'templates' for PostHog tracking
- events: add 'templates' to landing_cta_clicked section union
- integrations: replace "canvas" with "workflow builder" per constitution rules
- llms-full: replace "canvas" terminology with "visual builder"/"workflow builder"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These docs pages don't exist yet — link to docs.sim.ai until they are published.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@cursor review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 12, 2026

Greptile Summary

This PR rebrands all user-facing copy across the landing pages and docs from "workflow tool / automation platform" to "AI workspace", adds an inline AuthModal component for social (GitHub/Google) and SSO login on landing CTAs, introduces a /api/auth/providers endpoint to power provider detection, and hardens PostHog tracking with a type-safe event catalog and a fire-once captureClientEvent helper.

  • The auth_modal_opened event fires in handleOpenChange before providerStatus is guaranteed to have resolved. When the modal is opened while providerStatus === null (fetch in flight) and the server later returns registrationDisabled: true, the event is already recorded with view: 'signup' even though the useEffect subsequently forces view to 'login', making the tracked view inaccurate for that edge case.

Confidence Score: 5/5

Safe to merge — no functional regressions; both remaining findings are analytics edge-case P2s that do not affect the auth flow itself

The auth modal handles the previously-flagged race condition and isProduction leak correctly. All CTA tracking, provider detection, and redirect logic is sound. The two P2 comments concern analytics accuracy in narrow edge cases (modal opened before fetch resolves + registrationDisabled, and destination label when no social providers are configured) — neither blocks correct user authentication.

apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx — minor analytics timing issues around auth_modal_opened event and hasModalContent logic

Important Files Changed

Filename Overview
apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx New inline auth modal for social/SSO login on landing CTAs; module-level fetchPromise cache works correctly, but hasModalContent excludes emailEnabled and auth_modal_opened fires before providerStatus settles, causing minor analytics inaccuracies
apps/sim/app/api/auth/providers/route.ts New public endpoint returning GitHub/Google availability and registrationDisabled flag; isProduction leak from previous review is fixed, response shape is minimal and appropriate
apps/sim/lib/posthog/events.ts Adds auth_modal_opened event and tightens landing_cta_clicked.destination to an autocomplete-friendly union; all new source values align with component usage
apps/sim/app/(landing)/landing-analytics.tsx Simplifies landing analytics to fire-once pattern via captureClientEvent; cleaner than previous usePostHog/useEffect pattern
apps/sim/app/(landing)/components/hero/hero.tsx Hero CTA wired to AuthModal with correct source/destination tracking; copy updated to "AI workspace" branding
apps/sim/app/(landing)/components/navbar/navbar.tsx Desktop and mobile nav CTAs both use AuthModal with correct sources ('navbar', 'mobile_navbar'); tracking and redirect logic look correct
apps/sim/app/(landing)/components/collaboration/collaboration.tsx AuthModal added for collaboration CTA with correct source; copy updated to AI workspace branding; existing dangerouslySetInnerHTML for CSS keyframes is pre-existing pattern
apps/sim/app/(landing)/components/pricing/pricing.tsx All pricing tiers now use AuthModal; tier data still carries unused href fields for community/pro/max that are silently ignored by the render logic (minor dead data)

Sequence Diagram

sequenceDiagram
    participant User
    participant CTA as CTA Button (onClick)
    participant Modal as AuthModal (onOpenChange)
    participant API as /api/auth/providers
    participant PH as PostHog

    User->>CTA: click
    CTA->>PH: landing_cta_clicked { destination: 'auth_modal' }
    CTA->>Modal: handleOpenChange(true)

    alt providerStatus already loaded AND !hasModalContent
        Modal->>User: router.push('/login' or '/signup')
    else providerStatus loaded AND hasModalContent
        Modal->>PH: auth_modal_opened { view, source }
        Modal->>User: show social/SSO buttons
    else providerStatus === null (still fetching)
        Modal->>PH: auth_modal_opened { view: defaultView, source }
        Modal->>User: show spinner
        API-->>Modal: { githubAvailable, googleAvailable, registrationDisabled }
        alt hasModalContent
            Modal->>User: show social/SSO buttons
            Note over Modal: if registrationDisabled and view=signup setView('login')
        else !hasModalContent
            Modal->>User: router.push('/login' or '/signup')
        end
    end

    User->>Modal: click social button
    Modal->>Modal: client.signIn.social({ provider, callbackURL: '/workspace' })
    Modal->>User: redirect to /workspace
Loading

Reviews (3): Last reviewed commit: "fix(landing): prevent mobile auth modal ..." | Re-trigger Greptile

Remove "workflows" from the non-tagged blog meta description to
align with the AI workspace rebrand across the rest of the PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…te-resolve redirect

- Destructure only githubAvailable/googleAvailable from getOAuthProviderStatus
  so isProduction is not leaked to unauthenticated callers.
- Add useEffect to redirect away from the modal if provider status resolves
  after the modal is already open and no social providers are configured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SSO button when NEXT_PUBLIC_SSO_ENABLED is set
- Gate "Continue with email" behind EMAIL_PASSWORD_SIGNUP_ENABLED
- Expose registrationDisabled from /api/auth/providers and hide
  the "Sign up" toggle when registration is disabled
- Simplify skip-modal logic: redirect to full page when no social
  providers or SSO are available (hasModalContent)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a CTA passes defaultView='signup' but registration is disabled,
the modal now opens in login mode instead of showing "Create free
account" with social buttons that would fail on the backend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator

@cursor review

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@greptile

When the user opens the modal before providerStatus resolves and
registrationDisabled comes back true, the view was stuck on 'signup'.
Now the late-resolve useEffect also forces the view to 'login'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create IntegrationCtaButton client component that wraps AuthModal
and fires trackLandingCta on click, matching the pattern used by
every other landing section CTA.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@cursor review

Remove setMobileMenuOpen(false) from mobile AuthModal button onClick
handlers. Closing the mobile menu unmounts the AuthModal before it
can open. The modal overlay or page redirect makes the menu
irrelevant without needing to explicitly close it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7151e98. Configure here.

@waleedlatif1 waleedlatif1 merged commit bc31710 into staging Apr 12, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/landing branch April 12, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants