chore(desktop): 删除已退役的旧 UI 工程 desktop/ui

- 旧工程自 ui-next 出货后仅冻结保活,已不参与打包(tauri.conf.json
  beforeBuildCommand 指向 ui-next);按既定 P9 计划 git rm
- CI 连同 ui-legacy job 一起删除;命令契约扫描收敛为 UI_ROOTS=(ui-next,)
- main.rs/检查脚本注释同步更正指向
This commit is contained in:
xiaomakuaiz committed 2026-08-30 18:20:41 +08:00
1 parent ab326c8dab
commit eef60f2c36
478 files changed
+8 -33414

No files matched your search

-20
View File
@@ -46,26 +46,6 @@ jobs:
npm test
npm run build
# 冻结中的旧工程(desktop/ui),留着只为退役前不烂掉——它已不参与打包。
# P9 `git rm -r desktop/ui` 时连同本 job 一起删除。
ui-legacy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: desktop/ui/package-lock.json
- name: Test and build legacy ui
working-directory: desktop/ui
run: |
npm ci
npm test
npm run build
linux:
runs-on: ubuntu-24.04
steps:
+4 -4
View File
@@ -63,10 +63,10 @@ def report_set_error(label: str, left: set[str], right: set[str]) -> list[str]:
return errors
# 扫描哪些 UI 工程:并行期两套都在(打包出的是 ui-next,见 tauri.conf.json 的
# beforeBuildCommand),**出货的那套没被扫到就等于没有守卫**——open_app_dir 漏进
# capability 正是这么发生的。不存在的目录静默跳过,P9 `git rm ui` 后本文件免改。
UI_ROOTS = ("ui", "ui-next")
# 扫描哪些 UI 工程:只剩出货的 ui-next(旧 desktop/ui 已于 2026-08-30 删除;
# tauri.conf.json 的 beforeBuildCommand 指向它)。**出货的那套没被扫到就等于
# 没有守卫**——open_app_dir 漏进 capability 正是这么发生的。
UI_ROOTS = ("ui-next",)
def check(root: pathlib.Path = ROOT) -> list[str]:
+2 -2
View File
@@ -32,8 +32,8 @@ import sys
ROOT = pathlib.Path(__file__).resolve().parents[1]
# 出货的那套(tauri.conf.json 的 beforeBuildCommand.cwd)。旧 desktop/ui 已冻结、
# 待 P9 删除,不再守——**守错工程等于没有守卫**。
# 出货的那套(tauri.conf.json 的 beforeBuildCommand.cwd)。旧 desktop/ui 已于
# 2026-08-30 删除——**守错工程等于没有守卫**。
UI = ROOT / "ui-next"
STYLES = UI / "src/styles/app.css"
INDEX_HTML = UI / "index.html"
+2 -2
View File
@@ -1,7 +1,7 @@
// MonkeyCode 本地桌面客户端 —— Tauri 壳。
//
// 职责边界:壳持有**应用配置**(模型列表等)与宿主事务(进程生命周期、
// 托盘、桌宠、更新),并承载 UI(ui/ 构建产物随壳分发,frontendDist)。
// 托盘、桌宠、更新),并承载 UI(ui-next/ 构建产物随壳分发,frontendDist)。
// 引擎 ohmyagent 是壳拉起的子进程(stdio JSON-RPC,driver/ohmy.rs),
// UI 只经 Tauri IPC 与壳对话。
//
@@ -1751,7 +1751,7 @@ fn main() {
// 装机/使用统计心跳。端点未注入(默认)或用户在托盘关掉则空转。
telemetry::start(app.handle());
// 自动检查更新整条收在 UI 侧(ui/src/App.tsx + updateGate.ts):挂载、
// 自动检查更新整条收在 UI 侧(ui-next features/update/useUpdate.ts):挂载、
// 切回前台、4 小时兜底三个触发点共用一道 30 分钟闸门,发现新版点亮
// 侧栏徽标与横幅。这里曾经还有一条"启动后 5 秒自检 + 弹对话框"的
// 并行路径,与 UI 那次在启动瞬间各打一遍更新端点,且弹窗与横幅重复;
-1
View File
@@ -1 +0,0 @@
node_modules/
-35
View File
@@ -1,35 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>MonkeyCode</title>
<!-- webfont 由内核宿主在 /fonts/ 下静态提供(uidist/fonts,随二进制嵌入);
vite dev 模式下该路径不存在,回退本机字体链,不影响开发 -->
<link rel="stylesheet" href="/fonts/fonts.css" />
<style>
/* 首帧防闪。这里不能用 var():styles.css 由 main.tsx 引入,首帧时还没到。
两档值 = daisyUI 内置 light/dark 主题的 --color-base-100 换算成 hex
(oklch(100% 0 0) / oklch(25.33% 0.016 252.42)),升级 daisyUI 时需重对,
scripts/check_theme_tokens.py 盯着这两个值。 */
html, body { background: #ffffff; }
html[data-theme="dark"], html[data-theme="dark"] body { background: #1d232a; }
</style>
<script>
/* 同步执行,先于首帧落属性:<script type="module"> 是 defer 的,main.tsx 里的
applyStoredTheme() 赶不上第一次绘制,深色用户会先闪一帧浅色。
始终显式落 light/dark(daisyUI 按 data-theme 取值选主题,显式写掉系统偏好协商)。
键名与回落规则跟 src/theme.ts::readTheme 一致(同样的检查器盯着)。 */
try {
document.documentElement.dataset.theme =
localStorage.getItem("mc.theme") === "dark" ? "dark" : "light";
} catch (e) {
document.documentElement.dataset.theme = "light"; /* 存储不可读:按浅色走,与 readTheme 的回落一致 */
}
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
-2886
View File
File diff suppressed because it is too large. Load diff
-32
View File
@@ -1,32 +0,0 @@
{
"name": "monkeycode-ui",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc --noEmit && vite build",
"typecheck": "tsc --noEmit",
"test": "vitest run"
},
"dependencies": {
"@xterm/addon-fit": "^0.11.0",
"@xterm/xterm": "^6.0.0",
"dompurify": "^3.2.0",
"highlight.js": "^11.11.1",
"marked": "^15.0.0",
"react": "^18.3.0",
"react-dom": "^18.3.0"
},
"devDependencies": {
"@tailwindcss/vite": "^4.3.3",
"@types/react": "^18.3.0",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.0",
"daisyui": "^5.7.14",
"tailwindcss": "^4.3.3",
"typescript": "^5.6.0",
"vite": "^6.0.0",
"vitest": "^4.1.10"
}
}
-73
View File
@@ -1,73 +0,0 @@
<!DOCTYPE html>
<!-- 占位页:仅在内核启动失败时展示错误;正常流程直接打开内核 UI。 -->
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>MonkeyCode</title>
<style>
:root {
--bg:#131316; --card:rgba(255,255,255,.04); --card2:rgba(255,255,255,.07);
--cardh:rgba(255,255,255,.09); --line:rgba(255,255,255,.05);
--t1:#fafafa; --t2:#d8d8de; --t3:#a1a1ac; --t4:#71717c;
--amber:#10b981; --amberT:#34d399; --onAmber:#04130c;
--err:#f87171; --codeBg:rgba(0,0,0,.35);
}
* { box-sizing:border-box; }
body { margin:0; height:100vh; display:flex; align-items:center; justify-content:center;
background:var(--bg); color:var(--t2);
font:13.5px/1.8 system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif; }
.box { max-width:460px; padding:32px; display:flex; flex-direction:column;
align-items:center; gap:10px; text-align:center; animation:mcin .25s ease; }
.logo { width:52px; height:52px; border-radius:14px; }
h2 { margin:4px 0 0; font-size:18px; font-weight:700; color:var(--t1); letter-spacing:-.01em; }
.err { margin:6px 0 0; padding:9px 13px; background:var(--codeBg); border-radius:9px;
font:12.5px/1.7 ui-monospace,Menlo,monospace; color:var(--err); word-break:break-all; }
.hint { color:var(--t4); font-size:12px; line-height:1.7; margin:4px 0 0; }
.row { display:flex; gap:8px; margin-top:14px; }
button { padding:8px 22px; background:var(--amber); color:var(--onAmber);
border:0; border-radius:9px; cursor:pointer; font:600 12.5px/1.6 inherit; }
button.ghost { background:var(--card2); color:var(--t2); }
button:hover { opacity:.85; }
button:disabled { opacity:.5; cursor:default; }
@keyframes mcin { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
</style>
</head>
<body>
<div class="box">
<!-- 真产品 logo(public/logo.png,与 UI 内 src/logo.png 同源拷贝);
此前是 🐒 emoji,各平台渲染不一且非品牌形象 -->
<img class="logo" src="/logo.png" alt="MonkeyCode" />
<h2>启动失败</h2>
<p class="err" id="msg">未知错误</p>
<p class="hint">内核未能启动。常见原因是模型配置不可用或安装不完整——
可直接重试;仍失败请看完整日志,或重新安装应用。</p>
<div class="row">
<button id="retry">重试启动</button>
<button class="ghost" id="logs">打开日志目录</button>
</div>
</div>
<script>
// 这一页此前是死路一条(只有一句"请重新安装"),而落到这里的原因里
// 至少有一半是可自行恢复的(配置写坏、引擎一次性起不来)。壳的
// engine_restart 是幂等的,直接给用户按钮,别让人只能重装。
const m = decodeURIComponent(location.hash.slice(1) || '');
if (m) document.getElementById('msg').textContent = m;
const invoke = (cmd) => window.__TAURI__?.core?.invoke?.(cmd);
const retry = document.getElementById('retry');
retry.onclick = () => {
retry.disabled = true;
retry.textContent = '启动中…';
Promise.resolve(invoke('engine_restart'))
// 起来了就换回正常 UI;失败则把新错误显示出来并允许再试
.then(() => { location.replace('index.html'); })
.catch((e) => {
document.getElementById('msg').textContent = String(e);
retry.disabled = false;
retry.textContent = '重试启动';
});
};
document.getElementById('logs').onclick = () => { void invoke('open_log_dir'); };
</script>
</body>
</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loaded 100 of 478 files, more files were not shown because too many files have changed in this diff. Show more