Skip to content

refactor(web): decompose project-agent-configs.tsx and integration-form.tsx#1085

Merged
aaight merged 1 commit intodevfrom
feature/decompose-frontend-components-69ce1cc7
Apr 4, 2026
Merged

refactor(web): decompose project-agent-configs.tsx and integration-form.tsx#1085
aaight merged 1 commit intodevfrom
feature/decompose-frontend-components-69ce1cc7

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Apr 4, 2026

Summary

Decomposes two large frontend components into focused, single-responsibility modules following the existing PM Wizard decomposition pattern.

project-agent-configs.tsx (1217 → ~350 lines)

  • agent-config-types.ts — all interfaces: AgentConfig, Engine, SaveConfigValues, SystemDefaults, all *Props types
  • agent-config-utils.ts — pure functions: engineHasCredentials() and countActiveTriggers()
  • agent-config-list.tsxAgentRow + AgentListView with their delete dialog
  • agent-config-detail.tsxDefinitionAgentSection + AgentDetailView
  • project-agent-configs.tsx (slimmed) — queries, mutations, data transforms, navigation state

integration-form.tsx (712 → ~107 lines)

  • integration-scm-tab.tsxCopyButton, GitHubCredentialSlots, GitHubWebhookSection, SCMTab
  • integration-alerting-tab.tsxAlertingTab, imports CopyButton from SCM tab file
  • integration-form.tsx (slimmed) — IntegrationForm, TabButton, findIntegrationByCategory

Tests

  • New tests/unit/web/agent-config-utils.test.ts — 21 tests for engineHasCredentials and countActiveTriggers covering all edge cases

Key decisions

  • Followed the PM Wizard decomposition pattern (pm-wizard-*.tsx files) already in the codebase
  • No behavioral changes — pure structural refactor; all public exports unchanged
  • CopyButton co-located in SCM tab file (can move to ui/ later if needed by other components)
  • Replaced biome-ignore annotations on functions that retain inherent complexity (same as original)
  • Used relative imports in agent-config-utils.ts to make it testable in the vitest environment

Test plan

  • All 228 web unit tests pass (npx vitest run tests/unit/web/)
  • TypeScript type check passes with 0 errors (tsc --project web/tsconfig.json --noEmit)
  • Lint passes with same warnings as before (2 pre-existing, none new)
  • New 21 tests for extracted utility functions pass

🤖 Generated with Claude Code

Card: https://trello.com/c/p9E3moix/584-decompose-large-frontend-components-project-agent-configstsx-and-integration-formtsx

🕵️ claude-code · claude-sonnet-4-6 · run details

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

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

LGTM — Clean structural decomposition with no behavioral changes. The split follows the existing PM Wizard pattern (pm-wizard-*.tsx), dependency directions are correct (types → utils → UI components → orchestrator), and all CI checks pass. The relative import in agent-config-utils.ts is a reasonable trade-off for testability from the root vitest workspace. Tests cover both utility functions thoroughly with good edge cases.

🕵️ claude-code · claude-opus-4-6 · run details

@aaight aaight merged commit 884f8ee into dev Apr 4, 2026
9 checks passed
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