Skip to content

feat(webapp): restructure component directories by taxonomy#6274

Merged
macko911 merged 14 commits into
masterfrom
matej/nan-5747-reorganize-webapp-components-into-ui-patterns-subdirs
May 29, 2026
Merged

feat(webapp): restructure component directories by taxonomy#6274
macko911 merged 14 commits into
masterfrom
matej/nan-5747-reorganize-webapp-components-into-ui-patterns-subdirs

Conversation

@macko911

@macko911 macko911 commented May 28, 2026

Copy link
Copy Markdown
Contributor

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:

src/
  layout/           AppHeader, AppSidebar (app shell, alongside DashboardLayout)
  app/              DevToolPanel (dev overlay, collocated with App.tsx)
  features/         Playground/ (self-contained feature with own store/hooks)
  components-v2/
    ui/             47 elements + components — PascalCase filenames
    patterns/       8 app-specific reusable patterns
  components/       (v1, retiring in Phase 2A)
    ui/             existing + 6 moved from top-level
    patterns/       12 v1 patterns

What moved:

  • AppHeader, AppSidebarsrc/layout/
  • DevToolPanelsrc/features/
  • Playground/src/features/
  • 8 v2 patterns (Breadcrumbs, ChartCard, ConfirmDialog, CriticalErrorAlert, IntegrationLogo, KeyValueInput, PermissionGate, ScopesInput) → components-v2/patterns/
  • 22 top-level v2 elements/components → components-v2/ui/
  • 25 v2 ui/ files renamed from kebab-case → PascalCase (button.tsxButton.tsx, etc.)
  • 12 v1 patterns → components/patterns/
  • 6 v1 generic files → 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 --noEmit passes with 0 import errors
  • Sidebar, header, playground, and connection pages manually verified to render correctly

macko911 added 2 commits May 28, 2026 13:28
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.
@linear

linear Bot commented May 28, 2026

Copy link
Copy Markdown

NAN-5747

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Preview Deploy

Status URL Deploy Logs Last Updated
✅ Ready Preview URL Deploy Logs 28 May 2026, 21:25 UTC

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@macko911 macko911 changed the title feat(webapp): restructure component directories by taxonomy (NAN-5747) feat(webapp): restructure component directories by taxonomy May 28, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
@cubic-dev-ai

cubic-dev-ai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

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 @cubic-dev-ai review.

@macko911 macko911 marked this pull request as ready for review May 29, 2026 08:25
@macko911 macko911 added this pull request to the merge queue May 29, 2026
Merged via the queue into master with commit 0489181 May 29, 2026
29 checks passed
@macko911 macko911 deleted the matej/nan-5747-reorganize-webapp-components-into-ui-patterns-subdirs branch May 29, 2026 08:56
macko911 added a commit that referenced this pull request Jun 5, 2026
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.
macko911 added a commit that referenced this pull request Jun 9, 2026
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.
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