Skip to content

improvement(landing): react-doctor health pass across the landing surface#5326

Merged
waleedlatif1 merged 5 commits into
stagingfrom
worktree-landing-react-perf
Jul 1, 2026
Merged

improvement(landing): react-doctor health pass across the landing surface#5326
waleedlatif1 merged 5 commits into
stagingfrom
worktree-landing-react-perf

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Shared <JsonLd> server component with HTML-safe serialization — replaces 32 inline dangerouslySetInnerHTML={{ __html: JSON.stringify(...) }} JSON-LD sites. Structured-data output is JSON-semantically identical (crawlers parse the same graph) and now XSS-hardened. SEO unchanged.
  • State/effect correctness: derive-instead-of-sync (auth-modal view clamping), single phase state machine for the chat reveal (flash-free), useSyncExternalStore for the desktop media query, handler-only state moved to refs (contact honeypot-widget, changelog page cursor).
  • Structural: one-component-per-file splits (hero workflow-block, model-primitives) and non-component export isolation (careers job-board utils, og-sim-logo, track-landing-cta) for fast-refresh cleanliness.
  • Mechanical, behavior-preserving: combined chained iterations, hoisted Intl formatters + static values to module scope, immutable sorts, stable content-derived keys, accessible labels, focus-visible rings, rounded SVG path precision.
  • apps/sim TS lib bumped to ES2023 to allow toSorted/toReversed (runtime already supports them).

react-doctor on app/(landing): score 52 → 66, 5 errors → 0, 150 findings → 32. Remaining are intentional animation/SSR patterns and correct semantic HTML; nothing hacky, no suppressions.

Type of Change

  • Improvement

Testing

Full tsc clean (0 errors), biome check clean, react-doctor re-run. JSON-LD output verified byte-lossless (parses back to identical graph). Behavioral diffs audited for regressions.

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)

…face

- shared JsonLd server component with HTML-safe serialization (replaces 32 inline dangerouslySetInnerHTML JSON-LD sites; structured-data output semantically identical, XSS hardened)
- state/effect fixes: derive-instead-of-sync, phase state machines, useSyncExternalStore for media query, handler-only state to refs
- structural splits for one-component-per-file and non-component export isolation
- mechanical: combined iterations, hoisted Intl formatters/static values, immutable sorts, stable keys, a11y labels, focus rings, SVG precision
- ES2023 lib for apps/sim to allow toSorted/toReversed
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 1, 2026 7:05pm

Request Review

@cursor

cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Mostly landing UI, SEO serialization, and refactors with no auth or billing logic changes; auth-modal open/registration routing is the only user-visible flow worth a quick smoke test.

Overview
This PR is a behavior-preserving landing health pass aimed at react-doctor (score 52→66, errors cleared) without changing visible product behavior.

Structured data: A shared server JsonLd component replaces dozens of inline dangerouslySetInnerHTML + JSON.stringify blocks across blog, models, integrations, pricing, and related pages. Serialization HTML-escapes dangerous characters so JSON-LD stays semantically the same for crawlers while closing an XSS footgun.

React correctness: auth-modal derives effectiveView instead of syncing signup→login in an effect, and uses refs so late provider fetches cannot reopen the modal or double-fire analytics. Landing preview chat uses a single reveal phase to avoid flashing the previous reply. Landing preview uses useSyncExternalStore for the desktop breakpoint instead of resize useEffect state. Changelog pagination and contact Turnstile readiness move to refs where state was unnecessary.

Structure & tooling: Splits (hero BlockHandles / WorkflowBlockContent, models primitives, careers utils, track-landing-cta, og-sim-logo) improve fast refresh. Careers fetches search params and Ashby jobs in parallel; shared filter helpers stay aligned between SSR fallback and client board.

Mechanical polish: Hoisted static callouts and JSON-LD graphs, module-scoped Intl formatters, toSorted/toReversed, stable list keys, aria-label on inputs, focus rings on decorative SVGs, and apps/sim lib: ES2023 for those array methods.

Reviewed by Cursor Bugbot for commit 5f55b8b. Configure here.

Comment thread apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx
@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR improves the landing surface and cleans up React health issues. The main changes are:

  • Shared JSON-LD rendering with safer inline script serialization.
  • Auth modal state handling for async provider status and disabled registration.
  • Landing component splits, import cleanup, and stable render data.
  • Accessibility and small behavior-preserving UI refinements.
  • TypeScript lib update for newer array helpers.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx Updates modal opening, dismissal, and signup routing so async provider status and disabled registration are handled consistently.
apps/sim/app/(landing)/components/json-ld/json-ld.tsx Adds a shared JSON-LD script component with HTML-safe serialization.

Reviews (4): Last reviewed commit: "style(landing): convert added inline com..." | Re-trigger Greptile

Comment thread apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx
Comment thread apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx
…ignup redirect)

- guard the pending provider-status fetch with openRequestedRef so a late resolve can't reopen the modal or re-fire the opened event after dismiss
- open synchronously (loader) when status is still loading so the click stays responsive
- route to /login instead of /signup when registration is disabled and no modal providers are available
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

- reactive isDesktop can re-run the demo effect on a 1024px resize; reset demoIndexRef to 0 so applyDemoStep(step 0) and scheduleNextStep read the same step, instead of replaying from a stale index and skipping beats
- clarify why the chat reveal's previous-value ref is safe here (timer-driven, no concurrent-interruption boundary)
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx
…mpt-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')
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 5f55b8b. Configure here.

@waleedlatif1 waleedlatif1 merged commit 42e3a03 into staging Jul 1, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the worktree-landing-react-perf branch July 1, 2026 19:12
waleedlatif1 added a commit that referenced this pull request Jul 1, 2026
…5340)

toSorted/toReversed require Safari 16+/iOS 16+ and Next.js/SWC does not polyfill prototype methods (vercel/next.js#58421 closed unmerged), so #5326 broke sorting on the models page and landing preview for Safari 15/iOS 15 with a runtime TypeError. Revert the 6 call sites to [...arr].sort()/[...arr].reverse() (immutable, universally supported, matches the existing codebase idiom) and drop the ES2023 tsconfig lib override that only existed to type-check them.
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.

1 participant