Skip to content

fix(app): reduce React Doctor warnings#1740

Merged
benjaminshafii merged 3 commits into
devfrom
chore/react-doctor-cross-95
May 9, 2026
Merged

fix(app): reduce React Doctor warnings#1740
benjaminshafii merged 3 commits into
devfrom
chore/react-doctor-cross-95

Conversation

@benjaminshafii
Copy link
Copy Markdown
Member

Summary

  • Extracted presentational child components from settings and modal surfaces to reduce React Doctor giant-component warnings.
  • Consolidated small local state groups in workspace/share, scroll, server, and create-workspace state paths.
  • Avoided broad session boot, settings route routing, auth lifecycle, and async-order rewrites.

Evidence

React Doctor

  • Before baseline: score 94, warnings 60, no-giant-component 18, prefer-useReducer 11, no-cascading-set-state 16, rerender-state-only-in-handlers 2.
  • After lint-only scan: score 94, warnings 46, no-giant-component 12, prefer-useReducer 10, no-cascading-set-state 11, rerender-state-only-in-handlers 2.
  • Required verbose scan: score 91, total issues 392 including existing dead-code diagnostics (knip/exports 190, knip/types 103, knip/files 49, knip/duplicates 4).

Build verification

  • pnpm install --frozen-lockfile passed.
  • pnpm --filter @openwork/app build passed.
  • pnpm --filter @openwork/app typecheck failed on existing app-wide type errors outside this refactor, including unknown Tauri result types and missing OpenCode Router exports in messaging state.
  • git diff --check passed.

UI/API verification

  • No API changes.
  • No UI flow behavior change intended; changes are presentational extraction and local state consolidation.

Test instructions

  1. pnpm install --frozen-lockfile
  2. npx react-doctor@latest . --verbose --offline --fail-on none from apps/app
  3. npx react-doctor@latest . --json --json-compact --full --offline --no-dead-code --fail-on none from apps/app
  4. pnpm --filter @openwork/app build
  5. pnpm --filter @openwork/app typecheck

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 9, 2026

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

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview, Comment May 9, 2026 3:28am
openwork-den Ready Ready Preview, Comment May 9, 2026 3:28am
openwork-den-worker-proxy Ready Ready Preview, Comment May 9, 2026 3:28am
openwork-landing Ready Ready Preview, Comment, Open in v0 May 9, 2026 3:28am
openwork-share Ready Ready Preview, Comment May 9, 2026 3:28am

@benjaminshafii
Copy link
Copy Markdown
Member Author

Verification

  • pnpm install --frozen-lockfile passed.
  • Required baseline command run before changes from apps/app: npx -y react-doctor@latest . --verbose --offline --fail-on none.
  • Required final command run after changes from apps/app: npx -y react-doctor@latest . --verbose --offline --fail-on none.
  • Lint-only React Doctor comparison (--json --json-compact --full --offline --no-dead-code --fail-on none): 60 warnings -> 46 warnings; target counts: no-giant-component 18 -> 12, prefer-useReducer 11 -> 10, no-cascading-set-state 16 -> 11, rerender-state-only-in-handlers 2 -> 2.
  • pnpm --filter @openwork/app build passed.
  • pnpm --filter @openwork/app typecheck failed on existing app-wide errors outside this refactor, including unknown desktop/Tauri return types and missing OpenCode Router messaging exports.
  • git diff --check passed.

Skipped remaining warnings: session boot/lifecycle surfaces, settings route routing state, auth/session lifecycle, ordered async loops, and large messaging/skills/den panels where further extraction was not obviously safe in this pass.

@benjaminshafii
Copy link
Copy Markdown
Member Author

React Doctor split follow-up

Split the extracted cleanup into adjacent files so the reduced React Doctor surface is easier to navigate:

  • moved model picker dialog rows/sections into model-picker-modal-components.tsx
  • moved advanced/config settings sections into advanced-view-sections.tsx and config-view-sections.tsx
  • moved local reducer/state helpers into sibling *-state.ts files for advanced, config, MCP, authorized folders, create workspace, scroll controller, and server provider
  • preserved behavior while keeping the existing PR branch intact

Verification:

  • git diff --check: passed
  • npx react-doctor@latest . --verbose from apps/app: completed, score 91/100, 393 existing warnings across 138/272 files
  • pnpm --filter @openwork/app build: passed
  • pnpm --filter @openwork/app typecheck: failed on existing app-wide type errors outside this split, including unknown Tauri return types, missing OpenCode Router server exports, and settings/session route typing issues; no final errors were reported in the files changed by this split

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