Skip to content

refactor(components): 目录按 common / layout / features 三类重组#74

Merged
huhamhire merged 2 commits into
devfrom
refactor/components-domains
Jun 18, 2026
Merged

refactor(components): 目录按 common / layout / features 三类重组#74
huhamhire merged 2 commits into
devfrom
refactor/components-domains

Conversation

@huhamhire

Copy link
Copy Markdown
Owner

背景

延续 milestone「代码质量重构」。components/ 下曾扁平堆叠 30 个组件,分类轴混乱。本 PR 按职责重组目录。

⚠️ 叠加在 #73 之上(base = refactor/onboarding-steps):因为本次也要迁移 onboarding/ 的步骤文件,需基于其拆分结果。#73 合入 dev 后本 PR base 会自动回指 dev。

两步重组(两个 commit)

1. 顶层组件按领域拆分到目录 —— 30 个组件归入 common / layout / pr / diff / comments / drafts / settings

2. 业务领域目录归入 features/ —— 强业务属性的领域目录统一收进 features/,与 common/(基础公共 UI)、layout/(应用骨架)平级:

components/
├── common/      # Avatar · ConfirmModal · Loading · icons · Mermaid · PlatformIcon · LlmProviderIcon …
├── layout/      # MainPane · Sidebar · StatusBar · TitleBar
└── features/
    ├── pr/        # PrItem · PrInfoView · CommitsPanel
    ├── diff/      # DiffView · DiffSearchPanel · FileTree
    ├── comments/  # CommentsPanel · CommentEditEditor · CommentReplyEditor · InlineCodeContext
    ├── drafts/    # DraftsPanel · DraftZone · PublishReviewModal
    ├── settings/  # SettingsModal · ConnectionForm · LlmProfileForm
    ├── chat/  ·  onboarding/

顶层只剩 common / layout / features 三个桶,分类轴统一(kind 与业务领域不再混层)。

实现 & 验证

  • 全程 git mv(git 识别为 rename,保留历史),import 路径由确定性 codemod 改写,无手改。
  • 纯文件位置调整,无逻辑 / 界面变更。
  • typecheck / lint--max-warnings=0)/ build 全绿。

🤖 Generated with Claude Code

huhamhire and others added 2 commits June 18, 2026 13:46
components/ 下扁平堆叠的 30 个组件按领域归入子目录:
- common/   基础公共 UI(Avatar / ConfirmModal / Loading / icons / Mermaid 等)
- layout/   应用骨架(MainPane / Sidebar / StatusBar / TitleBar)
- pr/ · diff/ · comments/ · drafts/ · settings/   各业务领域

纯文件位置调整 + import 路径改写(git 识别为 rename),无逻辑/界面变更。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
承接上一步的领域拆分,把强业务属性的领域目录统一收进 features/,与
common/(基础公共 UI)、layout/(应用骨架)三类平级:

  components/
  ├── common/   ├── layout/
  └── features/{ pr · diff · comments · drafts · settings · chat · onboarding }

顶层只剩 common / layout / features 三个桶,分类轴统一(kind vs 业务领域不再混层)。
纯目录迁移 + import 路径改写(git 识别为 rename),无逻辑/界面变更。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@huhamhire huhamhire added the enhancement New feature or request label Jun 18, 2026
@huhamhire huhamhire added this to the 代码质量重构 milestone Jun 18, 2026
@huhamhire huhamhire changed the base branch from refactor/onboarding-steps to dev June 18, 2026 05:55
@huhamhire huhamhire merged commit 6e2a04a into dev Jun 18, 2026
1 check passed
@huhamhire huhamhire deleted the refactor/components-domains branch June 18, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant