迁移到 mygo 单进程架构并接入签名自更新

- 单进程:托盘常驻 + 原生设置窗口(internal/settings),移除 Wails 前端与 IPC
- 触发器(鼠标角落 / 边缘滚轮 / 热键)+ 规则引擎 + 动作注册表
- 调节提示条:截屏 + glass.Blur 三层毛玻璃、背景跟随屏幕变化、悬停光感与拖动
- 音量 Core Audio COM、亮度 DDC/CI(gamma 兜底)、多显示器求平均
- 配置热重载 + 版本迁移 v1→v5、便携模式、崩溃取证三件套
- updater/native 插件 + 托盘「检查更新…」,watchdog 识别更新重启
- 自建 Gitea 发布:scripts/publish-gitea.ps1(updates.url 指向 latest Release)
This commit is contained in:
zerorigin committed 2026-11-16 10:31:44 +08:00
1 parent 814012ec52
commit 0b8b9b0775
202 files changed
+7254 -13572

No files matched your search

+33 -8
View File
@@ -37,21 +37,46 @@ func TestVolumeMethodSelection(t *testing.T) {
}
}
// TestVolumeStepCount 验证媒体键路径按键次数 = |delta|。
func TestVolumeStepCount(t *testing.T) {
// TestVolumeUseCOM 验证奇数步进自动改用 COM,偶数步进仍走媒体键。
func TestVolumeUseCOM(t *testing.T) {
cases := []struct {
method string
steps int
want bool
}{
{"media", 1, true},
{"media", 3, true},
{"media", 5, true},
{"media", 2, false},
{"media", 4, false},
{"com", 1, true},
{"com", 2, true},
}
for _, c := range cases {
if got := volumeUseCOM(c.method, c.steps); got != c.want {
t.Errorf("volumeUseCOM(%q, %d) = %v, want %v", c.method, c.steps, got, c.want)
}
}
}
// TestMediaPressCount 验证百分比到媒体键次数的换算(每步约 2%,至少 1 次)。
func TestMediaPressCount(t *testing.T) {
cases := []struct {
delta int32
want int
}{
{4, 2},
{1, 1},
{3, 3},
{-1, 1},
{-5, 5},
{0, 0},
{2, 1},
{3, 2},
{10, 5},
{-4, 2},
{-7, 4},
{0, 1}, // 最小一次按键(Execute 里 steps<=0 会先归一化为 1)
}
for _, c := range cases {
if got := volumeStepCount(c.delta); got != c.want {
t.Errorf("volumeStepCount(%d) = %d, want %d", c.delta, got, c.want)
if got := mediaPressCount(c.delta); got != c.want {
t.Errorf("mediaPressCount(%d) = %d, want %d", c.delta, got, c.want)
}
}
}