Skip to content

refactor(web): group components into area subdirectories - #1036

Merged
wbxl2000 merged 1 commit into
mainfrom
refactor/web-components-subdirs
Jun 23, 2026
Merged

refactor(web): group components into area subdirectories#1036
wbxl2000 merged 1 commit into
mainfrom
refactor/web-components-subdirs

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

Related Issue

Part of the apps/kimi-web refactor tracked in web-refactor-plan.md (directory reorg was the last backlog item after the god-component split). No standalone issue.

Problem

apps/kimi-web/src/components/ held 49 SFCs in a single flat directory, making it hard to navigate and to see which components belong to which area.

What changed

Group the 40 feature-specific components into four area subdirectories, leaving 9 shared/layout components at the top level:

  • components/chat/ (27) — conversation/chat UI: ChatPane, ChatHeader, ChatDock, Composer, ConversationPane, ConversationToc, Markdown, ThinkingBlock, ThinkingPanel, ToolCall, DiffView, QuestionCard, ApprovalCard, SlashMenu, MentionMenu, SwarmCard, AgentCard, AgentGroup, AgentDetailPanel, TasksPane, QueuePane, GoalStrip, TodoCard, ActivityNotice, StatusPanel, OpenInMenu, SideChatPanel.
  • components/settings/ (5) — settings & configuration: SettingsDialog, ModelPicker, ProviderManager, LanguageSwitcher, Onboarding.
  • components/dialogs/ (5) — modal dialogs & sheets: AddWorkspaceDialog, NewSessionDialog, SessionsDialog, LoginDialog, BottomSheet.
  • components/mobile/ (3) — mobile-specific shell: MobileTopBar, MobileSettingsSheet, MobileSwitcherSheet.
  • Top level (9, shared/layout): Sidebar, WorkspaceGroup, SessionRow, GlobalLoading, MoonSpinner, ResizeHandle, Terminal, WarningToasts, FilePreview.

Also:

  • Recomputed every relative import (the web app uses relative paths only — no @//#/ alias). 40 files moved via git mv (history preserved); ~80 import paths updated across the moved components and App.vue.
  • Refreshed the line-1 path comments in the 35 moved files that had them.
  • Updated the layout description in apps/kimi-web/AGENTS.md.

No behavior change. Files moved via git mv; only import paths and the path comments changed.

Verification

  • pnpm --filter @moonshot-ai/kimi-web typecheck — pass (vue-tsc --noEmit)
  • pnpm --filter @moonshot-ai/kimi-web test — 83 passed
  • pnpm --filter @moonshot-ai/kimi-web build — pass
  • oxlint --type-aware on components/ + App.vue — 0 errors (16 warnings are pre-existing in the moved files' original code, e.g. DiffView.vue / FilePreview.vue; the move introduces no new ones)

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. (N/A — pure file-move refactor; the web app has no component tests since test(kimi-web): keep only pure logic unit tests #959. vue-tsc --noEmit guarantees every import resolves, plus the existing 83 pure-logic tests pass.)
  • Ran gen-changesets skill, or this PR needs no changeset. (Added .changeset/web-components-subdirs.md, patch on @moonshot-ai/kimi-code.)
  • Ran gen-docs skill, or this PR needs no doc update. (Updated apps/kimi-web/AGENTS.md layout section.)

Move the 40 feature-specific components out of the flat components/ into
chat/, settings/, dialogs/, and mobile/ subdirectories, leaving 9 shared
layout components at the top level. Recompute every relative import (no
path alias in the web app), refresh the line-1 path comments, and update
the layout description in AGENTS.md.

No behavior change; typecheck / test / build / lint all pass.
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1bc7ecf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 23, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@1bc7ecf
npx https://pkg.pr.new/@moonshot-ai/kimi-code@1bc7ecf

commit: 1bc7ecf

@wbxl2000
wbxl2000 merged commit 866b91c into main Jun 23, 2026
9 checks passed
@wbxl2000
wbxl2000 deleted the refactor/web-components-subdirs branch June 23, 2026 12:34
@github-actions github-actions Bot mentioned this pull request Jun 23, 2026
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.

1 participant