Skip to content

UI: Rename components/ui to system-components and group imports - #72349

Merged
ryanahamilton merged 4 commits into
apache:mainfrom
astronomer:ui-system-components-rename
Aug 31, 2026
Merged

ryanahamilton merged 4 commits into
apache:mainfrom
astronomer:ui-system-components-rename

Conversation

@ryanahamilton

@ryanahamilton ryanahamilton commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

src/components/ui/ holds the UI's customized Chakra primitives — its design system — but sitting under components/ it read as just another components subfolder, to the point that AGENTS.md needed a line telling contributors not to put generic app components there. This promotes it to a top-level src/system-components/ so that boundary is structural rather than documented.

Four commits, each independently green so the history bisects cleanly:

  1. Rename components/ui to system-components — the move plus every importer. All access forms collapse to src/system-components: the barrel, deep paths, and the relative variants (./ui, ../ui, ../../ui) that already violated the documented alias convention.
  2. Remove the unused Tag system component — nothing imported it and it was never re-exported from the barrel, so it had been dead since it was added.
  3. Export every system component from the barrel — five components (ActionBar, NumberInput, RadioCard, ResizableWrapper, SegmentedControl) were reachable only by deep path, so files needing one ended up importing the design system twice. Completing the barrel lets every consumer use a single import and stops callers needing to know which file a component lives in. There are now no deep src/system-components/* imports left.
  4. Group imports by architectural layer — import blocks previously collapsed the design system, pages, components and every other src layer into one undifferentiated block, so a file's dependencies gave no sense of which layers it reached into. They are now blank-line-separated groups: react → external → openapi → system-components → layouts → pages → components → remaining src → relative.

Ordering stays with the existing @trivago/prettier-plugin-sort-imports rather than moving to an ESLint rule. Two reasons: eslint-plugin-import caps its ESLint peer at ^9 while this repo is on ESLint 10, and the ts-compile-lint-ui prek hook runs eslint --fix before prettier --write, so an ESLint ordering rule would be overwritten on disk and leave pnpm lint failing with no possible fix. There is a comment in rules/perfectionist.js recording that, so sort-imports is not enabled later by mistake.

No functional change — the diff is a directory move, import specifiers, and import ordering. pnpm lint (ESLint + tsc), prettier --check, pnpm build and the full test suite (1140 tests) pass, and the ts-compile-lint-ui prek hook is clean.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

The directory holds the project's customized Chakra primitives — its
design system — but sitting under components/ it read as just another
components subfolder, to the point that AGENTS.md needed a line telling
contributors not to put generic app components there. Promoting it to a
top-level directory makes that boundary structural rather than documented.
Nothing imports it and it was never re-exported from the barrel, so it
has been dead since it was added. Chakra's Tag is available directly for
anyone who needs one.
Five components were reachable only by deep path, so files needing one of
them ended up importing the design system twice — once from the barrel and
once from a subpath. Completing the barrel lets every consumer use a single
import, and callers no longer need to know which file a component lives in.

Menu and Modal keep sibling-relative imports rather than going through the
barrel, which would make the barrel depend on its own members.
Import blocks previously collapsed the design system, pages, components and
every other src layer into one undifferentiated block, so a file's
dependencies gave no sense of which layers it actually reached into.
Splitting them into blank-line-separated groups makes that legible at a
glance, and makes a layering violation visible in review.

Ordering stays with the existing Prettier plugin rather than moving to an
ESLint rule: the prek hook runs eslint --fix before prettier --write, so
an ESLint rule would be overwritten on disk and leave lint unfixable.
@ryanahamilton
ryanahamilton marked this pull request as ready for review August 31, 2026 20:51
@bbovenzi bbovenzi added the area:UI Related to UI/UX. For Frontend Developers. label Aug 31, 2026

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

We should make sure we update the react_plugin_template and edge3 plugin too

@bbovenzi

Copy link
Copy Markdown
Contributor

Or maybe we finally do our own local npm package

@ryanahamilton

ryanahamilton commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

We should make sure we update the react_plugin_template and edge3 plugin too

Yeah, I'll look into this as a follow-up. A shared package might be the ideal solution.

@ryanahamilton
ryanahamilton merged commit c951918 into apache:main Aug 31, 2026
89 of 95 checks passed
@ryanahamilton
ryanahamilton deleted the ui-system-components-rename branch August 31, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants