diff --git a/.codex/skills/release/SKILL.md b/.codex/skills/release/SKILL.md index 0a538738..13c86fa5 100644 --- a/.codex/skills/release/SKILL.md +++ b/.codex/skills/release/SKILL.md @@ -180,13 +180,22 @@ Push to remote: When remote publication is requested, verify the remote tag points to the release commit. For `gitea.rclaw.top/linkong/planet`, publish from the workstation -using the command below. The publisher builds the three production images and -the desktop packages from the tag. A published stable release triggers the -server's two-minute Compose deployment check. The workstation can go offline -after publication. Check the live update manifest and the running image digests -before reporting production deployment complete. +using the command below. The publisher inspects changed files against the previous +stable release (`scripts/release_scope.py`), writes `release-manifest.json`, and +builds/uploads **only** the affected targets: +- `admin` / `backend` / `aiprovider`-only changes: builds/pushes only the changed + service image(s), skips desktop packaging and client hotfix updates, and deploys + only the changed container(s) on production. +- `frontend/public/earth/**`-only changes: emits only the L1 Earth hotfix bundle + (`./planet.sh bundle --hotfix`) while keeping the prior desktop `shell_version`. +- `client/**` changes: builds cross-platform desktop installers (`--all`) plus the + L1 hotfix bundle. + +Use `--scope auto` (default) or override explicitly with `--scope admin`, +`--scope hotfix`, `--scope backend,admin`, or `--scope full`: ```bash +python3 scripts/release_publish.py --tag vx.x.x --dry-run python3 scripts/release_publish.py --tag vx.x.x --use-git-credential ``` diff --git a/AGENTS.md b/AGENTS.md index c381ac14..d4156114 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -98,6 +98,12 @@ the user's login interactive shell instead of assuming a specific dotfile. one-screen (`一屏` / `首屏`) height chain: route roots use `height: 100%`, intermediate wrappers keep `min-height: 0`, and only the intended child owns scrolling. +- **Admin Control Design Contract**: Inline controls in the same row must share + a `rules.md` density tier (`--an-control-xs/sm/md/lg`, e.g., `32px` filter bar + with `0px` height jump on filter reset), centered table selection/switch + columns, rounded-square shadowless `.tui-switch`, labeled `操作` columns, and + `.an-detail-link` navigation cues; enforced by + `scripts/harness/frontend-rules-check.sh` and `scripts/harness/frontend-smoke.mjs`. - **Existing-UI Context Inspection Before Editing**: Whenever changing or extending an existing interface (any non-new screen, such as `/earth/` HUD overlays or existing Admin/Docs pages), inspect surrounding sibling controls, diff --git a/VERSION b/VERSION index e72f2402..6be6895d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.80.1 +0.80.2 diff --git a/client/package.json b/client/package.json index f13e8107..17a0f9e6 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "planet-client", - "version": "0.80.1", + "version": "0.80.2", "description": "Intelligent Planet Program - Native Electron Earth Viewer", "private": true, "packageManager": "bun@1", @@ -37,6 +37,7 @@ "start": "bun run build && bun ./scripts/launch-electron.mjs", "dev": "bun run build && bun ./scripts/launch-electron.mjs --devtools", "dist:dir": "bun run build && bun ./scripts/dist-target.mjs --dir", + "dist:hotfix": "bun run build:earth", "dist:win": "bun run build && bun ./scripts/dist-target.mjs --win", "dist:linux": "bun run build && bun ./scripts/dist-target.mjs --linux", "dist:mac": "bun run build && bun ./scripts/dist-target.mjs --mac", diff --git a/client/scripts/dist-target.mjs b/client/scripts/dist-target.mjs index e1063adf..4b12755a 100644 --- a/client/scripts/dist-target.mjs +++ b/client/scripts/dist-target.mjs @@ -2,6 +2,7 @@ import { spawnSync } from 'node:child_process' import { chmodSync, existsSync, + mkdirSync, mkdtempSync, readdirSync, readFileSync, @@ -129,43 +130,87 @@ function resolveLinuxTargets() { return targets } +function runWinViaWindowsHost() { + if (!isWsl()) return false + const winProbeScript = [ + '$candidates = @(', + ' (Get-Command bun.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source),', + ' (Join-Path $env:USERPROFILE ".bun\\bin\\bun.exe"),', + ' (Join-Path $env:USERPROFILE "scoop\\shims\\bun.exe"),', + ' (Join-Path $env:LOCALAPPDATA "bun\\bin\\bun.exe")', + ') | Where-Object { $_ -and (Test-Path -LiteralPath $_) }', + '$candidates | Select-Object -First 1', + ].join('; ') + const winBunCheck = spawnSync('powershell.exe', ['-NoProfile', '-Command', winProbeScript], { encoding: 'utf8' }) + const winBunPath = (winBunCheck.stdout || '').trim().split(/\r?\n/)[0]?.trim() || '' + const winPathRes = spawnSync('wslpath', ['-w', desktopRoot], { encoding: 'utf8' }) + const winDesktopRoot = (winPathRes.stdout || '').trim() + if (winBunCheck.status !== 0 || !winBunPath || !winDesktopRoot) return false + + console.log(`WSL2 detected; building Windows NSIS + portable installers via Windows host Bun (${winBunPath})...`) + const psScript = [ + "$ErrorActionPreference = 'Stop'", + `$env:ELECTRON_MIRROR = '${env.ELECTRON_MIRROR}'`, + `$env:ELECTRON_BUILDER_BINARIES_MIRROR = '${env.ELECTRON_BUILDER_BINARIES_MIRROR}'`, + `Set-Location -LiteralPath '${winDesktopRoot.replace(/'/g, "''")}'`, + `& '${winBunPath.replace(/'/g, "''")}' x electron-builder --win nsis portable --publish never`, + ].join('; ') + const winRun = spawnSync('powershell.exe', ['-NoProfile', '-Command', psScript], { stdio: 'inherit' }) + return (winRun.status ?? 1) === 0 +} + +function runWinViaDockerWine() { + if (!hasCommand('docker')) return false + const image = process.env.PLANET_ELECTRON_BUILDER_IMAGE || 'electronuserland/builder:wine' + const home = homedir() + const electronCache = join(home, '.cache', 'electron') + const builderCache = join(home, '.cache', 'electron-builder') + mkdirSync(electronCache, { recursive: true }) + mkdirSync(builderCache, { recursive: true }) + const uid = typeof process.getuid === 'function' ? process.getuid() : 0 + const gid = typeof process.getgid === 'function' ? process.getgid() : 0 + + console.log(`Building Windows NSIS + portable installers via Docker Wine (${image})...`) + const dockerCmd = [ + 'run', '--rm', + '-v', `${desktopRoot}:/project`, + '-v', `${electronCache}:/root/.cache/electron`, + '-v', `${builderCache}:/root/.cache/electron-builder`, + '-e', `ELECTRON_MIRROR=${env.ELECTRON_MIRROR}`, + '-e', `ELECTRON_BUILDER_BINARIES_MIRROR=${env.ELECTRON_BUILDER_BINARIES_MIRROR}`, + '-w', '/project', + image, + 'bash', '-lc', + `./node_modules/.bin/electron-builder --win nsis portable --publish never; status=$?; chown -R ${uid}:${gid} /project/release 2>/dev/null || true; exit $status`, + ] + const res = spawnSync('docker', dockerCmd, { stdio: 'inherit' }) + return (res.status ?? 1) === 0 +} + function runWinBuild() { if (process.platform === 'win32' || hasCommand('wine') || hasCommand('wine64')) { runBuilder(['--win', 'nsis', 'portable']) return } - if (isWsl()) { - const winBunCheck = spawnSync( - 'powershell.exe', - ['-NoProfile', '-Command', 'Get-Command bun.exe -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source'], - { encoding: 'utf8' }, - ) - const winBunPath = (winBunCheck.stdout || '').trim() - const winPathRes = spawnSync('wslpath', ['-w', desktopRoot], { encoding: 'utf8' }) - const winDesktopRoot = (winPathRes.stdout || '').trim() - if (winBunCheck.status === 0 && winBunPath && winDesktopRoot) { - console.log('WSL2 detected without Wine; building Windows installers via Windows host toolchain...') - const psScript = [ - "$ErrorActionPreference = 'Stop'", - `$env:ELECTRON_MIRROR = '${env.ELECTRON_MIRROR}'`, - `$env:ELECTRON_BUILDER_BINARIES_MIRROR = '${env.ELECTRON_BUILDER_BINARIES_MIRROR}'`, - `Set-Location -LiteralPath '${winDesktopRoot.replace(/'/g, "''")}'`, - 'bun x electron-builder --win nsis portable --publish never', - ].join('; ') - const winRun = spawnSync('powershell.exe', ['-NoProfile', '-Command', psScript], { - stdio: 'inherit', - }) - if ((winRun.status ?? 1) === 0) { - return - } - console.warn('Windows host build fell back to unpacked/zip cross-build without Wine.') - } - } else { - console.warn('Wine not available on Linux host: building standalone Windows zip bundle (win-unpacked + zip).') + if (runWinViaWindowsHost()) { + return } - runBuilder(['--win', 'zip', '--config.win.signAndEditExecutable=false']) + if (runWinViaDockerWine()) { + return + } + + if (process.env.PLANET_ALLOW_WIN_ZIP_FALLBACK === '1') { + console.warn('PLANET_ALLOW_WIN_ZIP_FALLBACK=1 set without Wine/Docker/Windows Bun: building win zip without NSIS .exe.') + runBuilder(['--win', 'zip', '--config.win.signAndEditExecutable=false']) + return + } + + console.error( + 'Unable to build Windows NSIS (.exe) installer: install Wine (wine64), enable Docker (electronuserland/builder:wine), or install Windows bun.exe (or set PLANET_ALLOW_WIN_ZIP_FALLBACK=1 for zip-only).', + ) + process.exit(1) } function runMacBuild() { @@ -177,7 +222,14 @@ function runMacBuild() { } } -if (mode === '--dir') { +if (mode === '--hotfix') { + const result = spawnSync(process.execPath, [join(__dirname, 'build-earth-bundle.mjs')], { + cwd: desktopRoot, + env, + stdio: 'inherit', + }) + process.exit(result.status ?? 1) +} else if (mode === '--dir') { runBuilder(['--dir']) } else if (mode === '--linux') { runBuilder(['--linux', ...resolveLinuxTargets()]) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 09117e6f..fc783121 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -8,6 +8,17 @@ This project follows the repository versioning rule: - `improvement` -> `+0.0.1`(bugfix + 小功能混合) - `bugfix` -> `+0.0.1` +## [0.80.2] — 2026-11-30 + +Released: 2026-11-30 + +### Highlights + +- Admin standardizes control density/radius CSS tokens (`--an-control-*`), aligns datasource filter bars (`32px` with `0px` reset jump), selection checkboxes, and shadowless rounded-square switches, and enforces the layout contract in static + Playwright harness checks. +- Desktop client local packaging aligns cross-platform Windows `.exe` builds (`dist-target.mjs` 3-tier detection + `--hotfix` bundle), while release publishing and production deployment classify changes by scope (`release_scope.py` + `release-manifest.json`) so Admin/Backend/AIProvider rollouts never trigger unnecessary client rebuilds. + +--- + ## [0.80.1] — 2026-11-26 Released: 2026-11-26 diff --git a/docs/HARNESS.md b/docs/HARNESS.md index 0dcd6358..228bec62 100644 --- a/docs/HARNESS.md +++ b/docs/HARNESS.md @@ -94,7 +94,7 @@ elevated restart; report that separately when it has not been exercised. | Doctor | `scripts/harness/doctor.sh` | Checks required files, required tools, optional delivery tools, and forbidden frontend lockfiles. | | Security | `scripts/harness/security-check.sh` | Checks that environment/private-key files are not tracked and scans for high-confidence committed secret tokens. | | Backend Rules | `scripts/harness/backend-rules-check.sh` | Checks backend app Python for direct `print()`, `breakpoint()`, and `pdb.set_trace()` debug calls so service code uses structured logging. | -| Frontend Rules | `scripts/harness/frontend-rules-check.sh` | Checks Bun-only scripts, admin route manifest coherence, literal internal route links, admin search route targets, frontend debug output, native button safety, icon-button accessibility, no nested Cards, no AntD/Space layout primitives, ConnectionTestInput usage, admin/docs shell height-chain sizing, viewport-scaled font sizes, zero letter spacing, Earth HUD baseline shell/glow/translucency/focus-stack alignment, and high-signal UI rule warnings. | +| Frontend Rules | `scripts/harness/frontend-rules-check.sh` | Checks Bun-only scripts, admin route manifest coherence, literal internal route links, admin search route targets, frontend debug output, native button safety, icon-button accessibility, no nested Cards, no AntD/Space layout primitives, ConnectionTestInput usage, admin/docs shell height-chain sizing, Admin control design contract (`--an-control-*`, checkbox centering, switch `box-shadow: none`, segmented transparent borders, `DataTable` `data-column-id`), viewport-scaled font sizes, zero letter spacing, Earth HUD baseline shell/glow/translucency/focus-stack alignment, and high-signal UI rule warnings. | | Docs Consistency | `scripts/harness/docs-consistency-check.sh` | Checks frontend Docs metadata against backend Gatekeeper metadata, public Docs registration, full technical-doc bilingual file pairs, public doc links, readable link titles, language-scoped technical links, README/project-context admin stack drift, supported credential collector contracts, manual console route coverage against the actual admin manifest, documented UI route drift, and documented `?section=` deep-link validity against the actual admin section config in technical docs and active plan docs. | | Quick | `scripts/harness/quick-check.sh` | Runs doctor, whitespace diff check, shell syntax checks, isolated Docker bootstrap/proxy and startup tests, error-catalog consistency tests, security scan, backend/frontend/doc consistency checks, and CI backend smoke tests. | | Full | `scripts/harness/validate.sh` | Runs quick check, frontend Bun install/build, Playwright route smoke, optional Helm checks, and opt-in Docker image smoke builds. | @@ -327,9 +327,14 @@ No automatic hooks are installed in this phase. Manual reminders: ### Release Or Delivery Change -Use the existing release skill/workflow and `.gitea/workflows/` files. Harness -validation can smoke-check Helm and Docker locally, but it must not replace the -release process. +Use `.codex/skills/release/SKILL.md`, `scripts/release_scope.py`, +`scripts/release_publish.py`, and `.gitea/workflows/` files. Tagged releases +classify changed paths into scoped images (`admin`, `backend`, `aiprovider`) +and client modes (`none`, `hotfix`, `full`) in `release-manifest.json`, so +admin-only or backend-only releases never rebuild desktop clients or restart +unchanged services. Harness validation can smoke-check Helm and Docker locally, +and `scripts/harness/test_production_release.py` covers scoped release/deploy +logic without replacing the release process. ## Implementation Notes diff --git a/docs/version-history.md b/docs/version-history.md index 56f6eb6d..e758e337 100644 --- a/docs/version-history.md +++ b/docs/version-history.md @@ -16,12 +16,13 @@ ## Current Version - `main` 当前主线历史推导到:`0.16.5` -- `dev` 当前开发分支历史推导到:`0.80.1` +- `dev` 当前开发分支历史推导到:`0.80.2` ## Timeline | Version | Type | Branch | Commit | Summary | | --- | --- | --- | --- | --- | +| `0.80.2` | improvement | `dev` | `v0.80.2` | 统一 Admin 控件设计参数与 Harness 校验,支持本地客户端全平台打包及按改动范围分层发版部署 | | `0.80.1` | improvement | `dev` | `v0.80.1` | 数据源支持批量启停调度、保留筛选和就地更新,优化 Earth 卡片与 AI 对话滚动 | | `0.80.0` | feature | `dev` | `v0.80.0` | Earth AI 工作台支持流式多轮对话和本地会话,新增单摄手势控制与公共模型目录批量刷新 | | `0.79.2` | improvement | `dev` | `v0.79.2` | 卫星目录支持紧凑传输、本地缓存和后台校验,改进桌面客户端启动时的窗口尺寸恢复 | diff --git a/frontend/package.json b/frontend/package.json index f6d88f19..14bef6a4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "planet-frontend", - "version": "0.80.1", + "version": "0.80.2", "private": true, "packageManager": "bun@1", "dependencies": { diff --git a/frontend/src/admin/components/data-table/DataTable.tsx b/frontend/src/admin/components/data-table/DataTable.tsx index 12f374bb..f0d24422 100644 --- a/frontend/src/admin/components/data-table/DataTable.tsx +++ b/frontend/src/admin/components/data-table/DataTable.tsx @@ -90,7 +90,7 @@ export function DataTable({ const sorted = header.column.getIsSorted() const stickyEnd = header.column.id === 'actions' || header.column.id === 'action' return ( - + {header.isPlaceholder ? null : (