Repository navigation
MainWindow 结构重构 - #692
Closed
HAILVa1kyrie wants to merge 6 commits into
Closed
MainWindow 结构重构#692HAILVa1kyrie wants to merge 6 commits into
HAILVa1kyrie wants to merge 6 commits into
Conversation
5 of 6 tasks
Member
|
一下子改这么多不怕冲突吗 |
Author
冲突这块有准备:6 个 commit 按阶段切分,每个可独立 revert;改动主体是纯移动和等价改写。功能测试都尽量全面了。后续若与新 PR 冲突,rebase 由我自己负责同时已同步到 net10 最新,若仍担心体量,行为面那一处改动(MessageBox 主题锁定)可以单独拆出,听安排。 |
Author
|
已同步上游 net10 最新提交(f6da559b docs: 添加官网地址),合并无冲突,本 PR 现已与 net10 保持同步,可正常合并。 |
Author
|
已同步上游 net10 最新提交(56b822df Debounce repeated URI toggle commands),合并无冲突,本 PR 现已与 net10 保持同步,可正常合并。 |
Member
|
虽然但是我还是建议你拆小一点,不然这么大估计不会有人看的
…---原始邮件---
发件人: ***@***.***>
发送时间: 2026年10月9日(周五) 晚上10:01
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [InkCanvasForClass/community] MainWindow 结构重构 (PR #692)
HAILValkyrie left a comment (InkCanvasForClass/community#692)
已同步上游 net10 最新提交(56b822df Debounce repeated URI toggle commands),合并无冲突,本 PR 现已与 net10 保持同步,可正常合并。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Author
|
已将本 PR 变基到 net10 最新提交(56b822df),历史整理为线性(去掉此前的合并提交),并撤回 MainWindow_cs 目录改名。与 #697 双向试合并均无冲突,两个 PR 可按任意顺序合并。 |
Collaborator
|
999我先跑个测试看看吧喵喵喵 |
HAILVa1kyrie
force-pushed
the
main
branch
3 times, most recently
from
October 11, 2026 10:47
4389f41 to
ab73d76
Compare
Author
|
已同步到 net10 最新提交(da60e6f0),同步了上游对 issue #688 的修复,本 PR 的 6 个提交无冲突。 |
去掉文件名中的 &。纯改名,无逻辑改动。
InkCanvas.Controls 的 LangVersion 对齐到 12。
新增 Ink/Ppt/Update/Security/UiShell 五个子目录,文件纯移动。
提取 SettingsStore、TrayIconService、NotificationService、TimerService、ScreenshotService、HotkeyService,原位保留转发壳。
新增 ToolMode 枚举与字符串双向映射,替换各处字符串比较点,持久化格式不变。
引入 LogService,空 catch 改为记日志、重抛或注释说明。MessageBox 弹窗主题锁定为 Owner 窗口实际主题。清理重构期遗留的模块编号措辞。
Author
|
本 PR 已变基到 net10 最新提交(2c895737),并拆分为 6 个独立 PR 便于逐个审查,请按顺序合并:
后续 PR 叠放在前序之上,前序合并后 diff 会自动收敛为单个提交。本 PR 关闭,以拆分系列为准。 |
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.
这是什么
兑现 #683
的交付承诺。该 issue 发出后 6 天无回复,按其文末默认条款("无回复则先提阶段 7 空 catch 治理第一批试水")起步;实际交付阶段 1–7(本 PR),阶段 8–12(PPT 集成提取、物理拆分、Dispatcher 收敛、测试基建、审计)待本批通过后再发,避免在途冲突。
纯结构重构,宣称零行为变化——一处例外,见文末"已知取舍"第 1 条,主动交代。
Commit ↔ 阶段对照
ad46439refactor&)+MainWindow_cs/→MainWindow/git mv,git log --follow可查历史23ea4d9build9ce3f0erefactorf2e3101refactor9a15329refactorde9662bchore审查标尺(源自提案 GLOBAL-RULES):每处改动应能一眼归入三类之一——a) 空 catch 内插日志;b) 字符串比较换枚举比较;c) 满足编译的等价改写。归不了类的即违规。
基线与数字(2026-10-03 在 base 上实测,可复现)
Base:
net10 @ d5eb72e(含上游 9/30–10/3 全部修复)。MainWindow_cs/行数catch\s*(\([^)]*\))?\s*\{\s*\}全仓扫描)Services/引用 Dispatchergrep -rn "Dispatcher" Services/)体量降幅说明:按寄生提取协议,原位置保留同名转发壳,壳删除与剩余方法提取排后续批次(已登记 backlog),因此本批降幅有限是设计使然,非未完成。
六个服务的提取要点
SettingsStore(设置读写 10 方法)/ TrayIconService / NotificationService / TimerService / ScreenshotService / HotkeyService(配置层 11 方法 + 2 DTO)。登记在案的等效改写(全部可逐条核对):
CountdownTimerWindow与NewStyleTimerWindow两份各自实现,本次提取统一状态机;定时器类型保持System.Timers.Timer原样(未换 DispatcherTimer,线程来源未变);等价性经假时钟逐帧验证:10min→65s→暂停→65s→结束 三场景共 12,000/12,200 帧全等。"任何时刻至多一个活跃 Tick"由状态机结构保证。GetActionByName:switch → 构造注入字典查表,19 键集合与原 switch 全等。Dispatcher.Invoke:改为注入的UiInvoke委托,装配侧即Dispatcher.Invoke,封送语义不变。ToolMode.Unknown(旧行为原样入字段);现存调用方全部传注册字面量,该路径不可达。HotkeyConfig.json以新 DTO 重序列化与实物逐字节一致(时间戳除外)。App.xaml.cs 中
CreateTrayIconService的反射接线(GetMethod/GetField)是寄生提取的过渡形态(原字段被插件与设置页按名消费,签名不能动),随壳删除批次收敛,非终态设计。人工冒烟(Windows 11 IoT 企业版 LTSC 25H2 26200.9457,同时还测了Windows 11 专业版 25H2 26200.9550,Release 构建产物)
已知取舍(主动交代,可应要求调整)
de9662b内):MessageBox 弹窗主题锁定为 Owner 窗口实际主题。重构期冒烟发现部分错误弹窗在特定 Owner 下主题错位,随治理一并修复。可拆分为独立 commit 或 revert 另开 issue,听维护者意见。LogService.LogException(ex),原LogHelper调用点的中文上下文串未逐条保留。若需要,下批补回 context 参数。测试承诺核对(CONTRIBUTING)
Release 构建通过(日志可应要求贴出)✔ · 受影响功能冒烟 ✔ · 回归可能性逐 commit 自查 ✔ · 未盲目带入任何顺手修复(发现的问题均登记,未改)✔