feat(webapp): restructure component directories by taxonomy#6274
Conversation
Encodes the element/component/pattern classification in the directory structure. Mechanical moves + renames + import updates. Moves: - AppHeader, AppSidebar → src/layout/ (app shell, alongside DashboardLayout) - DevToolPanel → src/app/ (dev overlay, collocated with App.tsx) - Playground/ → src/features/ (self-contained feature with own store/hooks) - v2 patterns (Breadcrumbs, ChartCard, ConfirmDialog, CriticalErrorAlert, IntegrationLogo, KeyValueInput, PermissionGate, ScopesInput) → components-v2/patterns/ - v2 top-level elements/components (Avatar, Tabs, Toast, MultiSelect, +18) → components-v2/ui/ - v1 patterns (AvatarCustom, ConfirmModal, DebugMode, EmptyState, ErrorBoundary, ErrorComponent, Info, InfoBloc, LinkWithIcon, Logo, PermissionRoute, PrivateRoute) → components/patterns/ - v1 generic (CopyText, ErrorCircle, HttpLabel, MultiSelect, PeriodSelector, SimpleTooltip) → components/ui/ Renames: - All components-v2/ui/ files: kebab-case → PascalCase (25 files) After this commit components-v2/ root contains only ui/ and patterns/, and components/ root contains only icons/, ui/, and patterns/.
All import sites updated to reflect the new directory structure from the previous commit: kebab-case → PascalCase for ui/, and moved paths for layout/, app/, features/, patterns/ destinations.
Preview Deploy
|
There was a problem hiding this comment.
No issues found across 196 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.
Re-trigger cubic
…ganize-webapp-components-into-ui-patterns-subdirs
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Three categories of fixes: 1. Restore ! non-null assertions removed by eslint in CreateLegacy.tsx and ApiKeys.tsx — these were correct assertions inside guarded blocks. 2. Restore as Extract<...> type assertion in OAuth2CCSettings.tsx that eslint stripped, causing a downstream .data tsc error. 3. Add as Extract<typeof x.authMode, 'SPECIFIC_MODE'> casts to all integration form and settings components (AppAuthCreateForm, CustomAuthCreateForm, InstallPluginAuthCreateForm, McpGenericCreateForm, McpOAuthCreateForm, OAuthCreateForm, AppAuthSettings, McpOAuthSettings, OAuthSettings). These files pass a broad AuthModeType to a discriminated union that requires a narrow extract — the type errors were pre-existing but only surfaced when our import renames caused TypeScript to re-check the files from scratch.
DevToolPanel has its own Zustand store (store/feature-flags.ts), making it inconsistent with Playground — both belong in features/ by the same rule. Move it and update the three import sites. AGENTS.md rewrite: - Consistent directory paths (no src/ prefix in table) - Remove all phase-specific wording (Phase 2A etc.) - "app chrome" -> "app shell" - Extend PascalCase convention to all React component files, not just ui/ - Remove migration context section - Clarify app/ as bootstrap-only (no independent state)
…tableInput, SecretInput
Redefines the ui/ vs patterns/ boundary:
- ui/ = design-system lift candidates (Storybook required)
- patterns/ = stays in webapp (Nango-specific OR generic helpers that
don't belong in a published component library)
Moves ConditionalTooltip (conditional wrapper with no publishable visual
story), EditableInput and SecretInput (both depend on PermissionGate, a
Nango-specific pattern) from ui/ to patterns/.
Updates all import sites and AGENTS.md. Notion taxonomy updated to match.
…us Checkbox import
|
You're iterating quickly on this pull request. To help protect your rate limits, cubic has paused automatic reviews on new pushes for now—when you're ready for another review, comment |
Two breakdown files predate master's component directory restructure (components-v2 -> components, #6274) and still imported from the old @/components-v2 path, which rebasing onto the renamed tree left dangling. Point them at the renamed @/components path.
Two breakdown files predate master's component directory restructure (components-v2 -> components, #6274) and still imported from the old @/components-v2 path, which rebasing onto the renamed tree left dangling. Point them at the renamed @/components path.
Problem
The webapp component directories didn't reflect the newly established taxonomy classification — patterns, reusable components, and layout shells were mixed together at the top level with no structural signal about what belonged where.
Solution
Physical reorganization encoding the taxonomy in the directory structure. All moves, renames, and import updates in one PR (splitting would only create rebase choreography).
New structure:
What moved:
AppHeader,AppSidebar→src/layout/DevToolPanel→src/features/Playground/→src/features/components-v2/patterns/components-v2/ui/ui/files renamed from kebab-case → PascalCase (button.tsx→Button.tsx, etc.)components/patterns/components/ui/Review approach: check build + smoke test rather than reading every line — the diff is large but entirely mechanical (moves + import path updates).
Fixes NAN-5747
Testing
tsc --noEmitpasses with 0 import errors