chore: 删死代码 —— OpenReport/ReadLocalFile/isDesktop/openReport + admin Soon (P2)

完成度审计确认全链零生产调用:
- app.go OpenReport(仅被死包装引用)、ReadLocalFile(仅测试引用);
  desktop.ts openReport 包装、isDesktop 导出(实际用 isMacDesktop)——全删。
  绑定重新生成(OpenReport/ReadLocalFile 归零,PrintReportPage/SaveReportAs/
  Notify 保留)。删对应的 app_test TestReadLocalFile。
- admin Soon.tsx(规划中占位组件)已成未引用死组件——routes.tsx 9 条路由全
  ready:true,import 未用。删组件+import。

openInSystem/filepath/os 仍被 PrintReportPage/download 使用,不孤立。
desktop go test + tsc + 68 vitest、admin tsc + 41 vitest 全绿。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-18 11:56:51 +08:00
parent 940330cdb7
commit a1c35852ef
6 changed files with 1 additions and 73 deletions
-12
View File
@@ -70,18 +70,6 @@ func TestDownloadTruncatedLeavesNoFile(t *testing.T) {
}
}
func TestReadLocalFile(t *testing.T) {
p := filepath.Join(t.TempDir(), "a.txt")
_ = os.WriteFile(p, []byte("你好"), 0o600)
got, err := (&App{}).ReadLocalFile(p)
if err != nil || got != "你好" {
t.Fatalf("读文件: got=%q err=%v", got, err)
}
if _, err := (&App{}).ReadLocalFile(filepath.Join(t.TempDir(), "nope")); err == nil {
t.Error("读不存在的文件应报错")
}
}
func TestPing(t *testing.T) {
if (&App{}).Ping() == "" {
t.Error("Ping 是前端探活 Go 桥的唯一手段,不能返回空")