Skip to content

chore(cleanup): react-doctor dead code elimination, landing + docs overhaul, component modernization#4544

Merged
waleedlatif1 merged 19 commits intostagingfrom
fix/react-doc
May 10, 2026
Merged

chore(cleanup): react-doctor dead code elimination, landing + docs overhaul, component modernization#4544
waleedlatif1 merged 19 commits intostagingfrom
fix/react-doc

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

Dead code elimination (react-doctor)

  • Stripped export keyword from 500+ unused type aliases and interfaces across contracts, tools, stores, copilot, and component files — zero external importers confirmed
  • Deleted 60+ files with zero remaining references: unused barrel index.ts files (stores/chat, stores/folders, stores/logs, stores/modals/search, stores/operation-queue, stores/sidebar, stores/variables, connectors, executor/handlers, lib/a2a, lib/invitations, lib/pptx-renderer, lib/core/async-jobs/backends, etc.)
  • Deleted unused UI components: snapshot-context-menu.tsx, chat-history-skeleton.tsx, logs-list.tsx, trace-spans.tsx (UI layer — the lib/logs/execution/trace-spans utility is kept), template-profile.tsx
  • Deleted unused hooks: hooks/use-stream-cleanup.ts, hooks/queries/status.ts, hooks/queries/a2a/tasks.ts
  • Deleted unused lib utilities: lib/execution/buffered-stream.ts, lib/workflows/executor/queued-workflow-execution.ts, lib/workflows/training/compute-edit-sequence.ts, lib/uploads/utils/blob-to-data-url.ts, lib/copilot/generated/mothership-stream-v1-schema.ts, lib/api/contracts/boundary-exceptions.ts
  • Deleted unused type file: app/_types/creator-profile.ts (type now lives in contracts)
  • Deleted dead blog content components: content/blog/enterprise/components.tsx, content/blog/v0-5/components.tsx, content/blog/v0-5/components/diff-controls-demo.tsx

Landing page

  • Removed dead enterprise section (access-control-panel, audit-log-preview, enterprise.tsx) — never exported from barrel, never used
  • Removed dead product-dropdown navbar component — no references anywhere
  • Wrapped animation-heavy sections (features, templates, landing preview) in LazyMotion + domAnimation for smaller initial bundle
  • Replaced all motion.X with m.X inside LazyMotion boundaries
  • Replaced h-X w-X pairs with size-X shorthand across landing components
  • Refactored navbar scroll/hash detection from useEffect to useSyncExternalStore — fixes SSR hydration mismatch
  • Deleted Soehne font files (woff2 + ts config) — zero references in codebase

Docs app

  • Deleted apps/docs/components/ui/button.tsx — zero usages in docs app
  • Converted dropdown-menu.tsx from React.forwardRef to function-with-ref pattern (React 19)
  • Replaced inline-block with block w-full in image/video lightbox wrappers — more predictable layout
  • Used useEffectEvent in lightbox for stable event handlers — eliminates stale onClose closure
  • Hardened docs search route: better input validation, enforced limit bounds, switched to POST (fumadocs standard), performance — O(n) .find()O(1) Map lookups on large result sets
  • Deleted 27 tool docs pages that had internal schema fields (workspace_id, object_id, etc.) stripped from response tables — all tool integrations still present in sim
  • sim-logo.tsx SVG paths rounded to 2 decimal places — 24% smaller path strings, visually identical

apps/sim component modernization

  • playground/page.tsx: Replaced useState + useEffect dark mode with useSyncExternalStore — eliminates hydration flash
  • resume-page-client.tsx: Moved non-render input cache from useState to useRef — removes unnecessary re-renders
  • components/emcn/icons/wordmark.tsx + components/ui/verified-badge.tsx: SVG coordinate precision rounded to 2dp — same path command sequence, smaller strings
  • Added lib/academy/local-progress.ts: localStorage bridge using useSyncExternalStore for lesson completion tracking
  • Typography: ... (proper ellipsis) across loading states and UI copy
  • CSS: px-N py-Np-N, space-x-Ngap-x-N consolidations (equivalent classes)
  • React Query: useGeneralSettings() always warms cache on workspace entry — removed unnecessary session guard

Type of Change

  • Refactor / cleanup (dead code removal, modernization)
  • Performance improvement
  • Bug fix (SSR hydration mismatches)

Testing

Tested manually — type-check passes clean (source-only), lint passes with zero warnings.

Safety audit

All 7 commits were audited by parallel agents across 6 categories:

  • Dead file deletions: Zero remaining references to every deleted file confirmed by grep
  • Export stripping: TypeScript source-only check passes — no broken imports
  • SVG precision: Path command counts identical before/after on all 3 files
  • React 19 patterns: forwardRef → function-with-ref, useEffectEvent, useSyncExternalStore — all correct and idiomatic
  • Settings simplification: React Query handles auth failures gracefully; all consumers use optional chaining with defaults
  • Landing/docs changes: LazyMotion wrapping is additive, docs tool deletions are schema cleanup only (all integrations still present)

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)

… stores, and components

Remove export keyword from type/interface declarations confirmed to have zero importers
across lib/api/contracts/tools/aws/, lib/api/contracts/*.ts, lib/copilot/generated/,
stores/workflows/workflow/types.ts, ee/access-control, ee/data-retention, lib/logs/types.ts,
and app/workspace component files. TypeScript and API validation both pass clean.

Reduces unused-types count from 394 → 181 and fully eliminates the ✗ critical
dead-code categories (exports, types, files now show as ⚠ warnings not ✗ errors).
…components, stale utilities)

Remove confirmed-unused barrel index.ts files across stores/, connectors/, executor/,
lib/, and app/workspace/ that had zero importers. Also delete unreachable components
(chat-history-skeleton, trace-spans, logs-list, template-profile, enterprise landing
sections), stale utilities (buffered-stream, blob-to-data-url, queued-workflow-execution,
compute-edit-sequence), and obsolete generated/contract files. TypeScript passes clean.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 10, 2026 6:55pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 10, 2026

PR Summary

Medium Risk
Medium risk because the docs search API switches from GET to POST with new body parsing/limit enforcement, which can break existing callers and affect search behavior. Other changes are mostly SEO serialization and UI refactors with low blast radius.

Overview
Updates the docs app’s SEO and social sharing output by sanitizing JSON-LD via serializeJsonLd, trimming the site-level schema payload, and slightly adjusting OpenGraph locale generation and OG image rendering (refactored styles + cached, error-checked font fetches).

Reworks the docs search endpoint to accept POST bodies (JSON or form), validates/coerces inputs with bounded limits, and improves result merging performance by replacing repeated .find() lookups with Map-based selection.

Polishes docs UI behavior and styling: sidebar folder open/close becomes manually toggled per-path (removing useEffect syncing), minor 404 typography tweak, icon className modernization (size-*), and robots.txt no longer explicitly allows /api/search.

Reviewed by Cursor Bugbot for commit e76dec8. Configure here.

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e76dec8. Configure here.

Comment thread apps/docs/app/api/search/route.ts Outdated
Co-authored-by: Cursor <cursoragent@cursor.com>
@waleedlatif1 waleedlatif1 merged commit 3ed8615 into staging May 10, 2026
13 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/react-doc branch May 10, 2026 19:00
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