Files
EmailBill/openspec/changes/archive/2026-02-20-remove-unused-frontend-components/design.md
SunCheng b173c83134
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 16s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
chore: 移除未使用的前端组件
- 删除 SmartClassifyButton.vue (无引用)
- 删除 BudgetSummary.vue (无引用)
- 归档变更记录
2026-02-20 22:39:29 +08:00

55 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## Context
前端组件库存在两个未被引用的组件:
- `SmartClassifyButton.vue` - 智能分类按钮,历史上可能用于快速分类功能,现已无引用
- `BudgetSummary.vue` - 预算汇总卡片,功能已被 budgetV2 模块的子组件替代
当前打包工具Vite的 tree-shaking 会移除未引用代码,但保留源文件会增加维护困惑和代码审查负担。
## Goals / Non-Goals
**Goals:**
- 移除确认无引用的组件文件
- 保持代码库整洁,降低维护成本
**Non-Goals:**
- 不涉及 `TransactionDetail.vue` vs `TransactionDetailSheet.vue` 的重构(两者虽然功能相似,但均有活跃引用)
- 不涉及其他代码清理(如未使用的 composables、utils
## Decisions
### 1. 删除策略:直接删除 vs 废弃标记
**决策**: 直接删除
**理由**:
- 两个组件均无任何 import 引用,删除零风险
- 无需废弃过渡期,因为没有使用方需要迁移
- 简化变更流程,避免留下无效的废弃代码
**备选方案**: 添加 `@deprecated` 注释并在下个版本删除 - 过度工程化,不必要
### 2. 回归验证范围
**决策**: 仅验证打包成功和页面正常渲染
**理由**:
- 删除的是零引用组件,理论上不会有任何运行时影响
- 全量 E2E 测试成本过高,性价比低
## Risks / Trade-offs
| 风险 | 影响 | 缓解措施 |
|------|------|----------|
| 误删有引用的组件 | 页面报错 | 已通过 grep 全量搜索确认无引用 |
| 动态引用未被发现 | 运行时报错 | 检查了 `:is` 动态组件和字符串引用模式 |
## Migration Plan
1. 删除 `SmartClassifyButton.vue`
2. 删除 `BudgetSummary.vue`
3. 运行 `pnpm build` 验证打包成功
4. 运行 `pnpm dev` 启动开发服务器,访问主要页面验证无报错
**回滚策略**: Git revert 即可恢复