Repository navigation
Refactor/debt remediation第一批历史债务修复 - #16
Merged
Merged
Conversation
- 新增 service.ErrUnauthenticated 哨兵,contracts/errors.yaml 增补 401 分类并删除实现偏差节 - service 层 30 处裸 errors.New 与 fmt.Errorf 改为包装哨兵:认证失败归 401、业务校验归 400、资源未找到归 404 - Login、RefreshToken、CreateSession 的私有 401 分支与媒体上传、角色转换的私有 400 分支统一改走 HandleServiceError - 同步契约金样本、受影响测试替身与 server/docs/api 错误码表格 - docs/debt/architecture.md 第 7 条更新为已修复,基线由 30 处归零
- dicts/tags/links/users/comments/media/categories 改为 +page.ts 的 load + 页面状态模块 + 纯渲染页面 - 行数口径由 7 个超过 300 行的页面降至 0;剩余 6 个非胖页面的 onMount 取数仍为存量 - 新增 7 个页面状态模块与配套单测,admin 单测由 1 个文件 19 例增至 9 个文件 146 例 - 修复字典页类型列表的按钮嵌套:选择区与操作区改为并列元素,操作按钮补 size=icon 与含上下文 aria-label,选择区补焦点环与 aria-current - 字典页与评论页表格按断点折叠次要列,卡片头部允许换行;加载态与空态统一改用 $ui/spinner 与 $ui/empty - 常量模块剥离图标库依赖,图标映射随唯一消费者组件声明,comments 单测耗时由 126 秒降至 5 秒 - 同步更新 docs/debt/frontend.md 第 3、8 条与 docs/architecture-rules.md 索引及分期状态
测试文件不再与业务文件平级,17 个 *.test.ts 移入被测模块同级的 __tests__/; packages/auth 的测试替身独立为 src/test/fixtures.ts。同步修正移动后的相对导入 层级、server 侧契约锚点常量,以及 contracts 与 docs 中的引用路径。
- 修正后端校验、测试清单、lint-staged 覆盖范围与响应信封语义等与实现不符的表述 - 按实际实现订正应用层 DTO 归属口径,同步接口文档 - 其他文档不再按节引用根规范文件,相关条文改由各文档自持 - 合并条文搬迁产生的重复内容并收敛根规范体量
- 仪表盘、notifications、posts、posts/[id]、settings、stats 由 onMount 取数改为 +page.ts 的 load 取首屏 - 新增 notifications、settings、stats、posts 四个页面状态模块与配套单测,列表与全部读写操作归入模块 - 仪表盘与 posts/[id] 为只读页,无客户端读写,由 load 直出 page data,不建仅转发数据的空转模块 - 仪表盘与 posts 的权限裁剪移入 load,读 @myblog/auth 的本地认证状态,load 内不调用认证接口 - 仪表盘与 posts/[id] 移除页内首屏 loading 分支,取数在 load 完成后渲染 - stats 页趋势天数与选项收敛到 lib/constants/stats.ts,替换页面内的 7/14/30 字面量 - 6 页合计由 996 行降至 596 行;onMount 命中由 8 降至 2,剩余两处均为鉴权重定向 - 新增 57 个用例,admin 单测由 9 个文件 146 例增至 13 个文件 203 例,页面状态模块累计 11 个 196 例 - 同步更新 docs/debt/frontend.md 第 3 条、architecture-rules.md 第 6.2 与第 8、9 节 - 同步更新 docs/development.md 测试口径与 AGENTS.md 第 1 节第 6 条
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.