refactor: 样式拆分 + 引入 CSS Module 范本 + 文档整理#11
Merged
Conversation
把 3196 行的单文件 styles.css 按现有分区注释切成 src/renderer/src/styles/ 下 11 个连续片段(tokens / base / app-shell / explorer / work-area / results / modals-forms / phase2 / phase3 / theme-polish / base-ui),由 index.css 按原顺序 @import 汇总,main.tsx 改引 ./styles/index.css。 纯结构整理,零行为变化:切分按原文件自上而下,11 片段拼接与原文件逐字节 一致;Vite 构建期把 @import 内联为单一 CSS bundle,运行时无差异。 - @import 顺序即层叠契约:tokens 最先、theme-polish(Slate 后置修饰)必须 排在功能分区之后(它靠源码顺序覆盖前面约 29 个选择器的基础规则)、 base-ui 收尾。 - CLAUDE.md 新增「样式约定」:分区结构 + 顺序契约 + 何时全局 vs CSS Module。 - 修正 10 个文件中指向已删除 styles.css 的注释指针到对应分区文件。 验证:pnpm typecheck / build(单 CSS bundle)/ test:unit(313 passed) 全绿。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
三件套(PipelineBuilderPanel/StageCard/StageEditor)共用一份 pipeline.module.css, 作用域类自动 hash;纯本地修饰态(.disabled/.error/.spacer)本地化,共享全局工具类 (.muted)用 :global() 引用。本项目首个 CSS Module,作为后续自包含组件的范本。 面板样式从全局 styles/work-area.css 切走(-185 行),仅 .pipeline-toggle 留全局。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TODO.md 重写为 live backlog:只列未做项(目录树虚拟化、导入侧流式解析), 已交付压成索引。CLAUDE.md 去重(性能铁律改指 SPEC §3)、把 shell shim 完整清单 下沉到 shellCore.ts 顶部注释、待办指针由过时的 SPEC §4 改指 TODO.md。 SPEC §4 清掉已交付的「遗留待办」行,修正 styles.css→styles/explorer.css 失效引用。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
把 3196 行的单文件 styles.css 按现有分区注释切成 src/renderer/src/styles/
下 11 个连续片段(tokens / base / app-shell / explorer / work-area /
results / modals-forms / phase2 / phase3 / theme-polish / base-ui),由
index.css 按原顺序 @import 汇总,main.tsx 改引 ./styles/index.css。
纯结构整理,零行为变化:切分按原文件自上而下,11 片段拼接与原文件逐字节
一致;Vite 构建期把 @import 内联为单一 CSS bundle,运行时无差异。
排在功能分区之后(它靠源码顺序覆盖前面约 29 个选择器的基础规则)、
base-ui 收尾。
验证:pnpm typecheck / build(单 CSS bundle)/ test:unit(313 passed) 全绿。
追加:引入 CSS Module 范本(c0ac05d)
承接样式拆分,把管道构建器三件套(PipelineBuilderPanel / StageCard /
StageEditor)的样式从全局 work-area.css 切到共用的 pipeline.module.css ——
本项目首个 CSS Module,作为后续自包含组件的范本。
共享全局工具类(.muted)用 :global() 引用(示范如何从作用域消费共享词汇)。
切走 -185 行。
CSS 声明体逐字复制 + 元素→类映射 1:1,保证像素等价。
追加:文档整理(2435685)
导入侧流式解析),已交付压成索引,失效项归档。
下沉到 shellCore.ts 顶部注释、待办指针由过时的 SPEC §4 改指 TODO.md。
失效引用。
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com