Skip to content

feat(windows): complete V0 dashboard parity - #44

Merged
shanggqm merged 5 commits into
shanggqm:mainfrom
lelelelelelelelelelelelele:codex/windows-v0-pr
Aug 31, 2026
Merged

shanggqm merged 5 commits into
shanggqm:mainfrom
lelelelelelelelelelelelele:codex/windows-v0-pr

Conversation

@lelelelelelelelelelelelele

@lelelelelelelelelelelelele lelelelelelelelelelelelele commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Complete the independent Windows Tauri dashboard across Overview, Tasks, AI Leadership, Usage, Inference, Projects, Skills, and Settings, including the layered Windows glass system and local-only aggregate data model.
  • Add inference-performance aggregation with local calendar boundaries, bounded streaming reads, fingerprint caching, and a shared rollout index, alongside safer shell/window lifecycle handling, native visual-capture contracts, and deterministic Windows release-script checks.
  • Add a locked Web toolchain, Windows Web build/contract CI, deterministic fixture-backed Playwright coverage for all eight Web surfaces, and a privacy-safe aggregate-only AI Leadership screenshot.
  • Keep local WorkBlock and planning state available to local tools while removing it from Git tracking.

The two follow-ups that originally kept this PR in draft are now included: inference windows follow the local statistics timezone across DST, and rollout ingestion uses bounded streaming, fingerprint caching, and one shared per-refresh index.

Validation

  • make build — not run: this checkout is on Windows and the command builds the macOS app.
  • make probe when data-source behavior changes — not run: the macOS probe is unavailable on this host; the Windows dashboard probe below was run instead.
  • npm ci and npm audit — 0 vulnerabilities.
  • npm run build.
  • npm run test:contracts — 37 passed.
  • npm run test:visual — 4 Playwright tests passed across the eight fixed Web surfaces using the repository fixture; an explicit local-readonly Inference run also passed.
  • cargo +1.97.1-x86_64-pc-windows-msvc fmt --all -- --check.
  • cargo +1.97.1-x86_64-pc-windows-msvc test --workspace — 74 passed, 1 environment-dependent app-server test ignored by design.
  • cargo +1.97.1-x86_64-pc-windows-msvc clippy --workspace --all-targets — passed with existing warnings; strict -D warnings is not clean on the upstream base.
  • Windows release-script, native-visual workflow/documentation, and shell-lifecycle contract tests.
  • Capture-NativeVisuals.ps1 -PreflightOnly — passed without launching the app or writing capture evidence.
  • cargo +1.97.1-x86_64-pc-windows-msvc tauri build --no-bundle — release executable built successfully.
  • codexu-probe --dashboard — local dashboard JSON parsed with the inference branch present; output remained Git-ignored and was not committed.
  • git diff --check upstream/main...HEAD.

The live native exact-HWND capture/coverage workflow and Windows installer bundles were not run in this PR preparation pass. Playwright is the default UI acceptance layer; native preflight and source contracts were used for the native boundary.

Privacy Check

  • No private Codex thread titles, local paths, screenshots, or account data are included.

The committed screenshot contains aggregate UI only and no task title, project name, thread identifier, or local path. Playwright results, local dashboard output, WorkBlock state, planning state, build output, and other local artifacts remain ignored and are absent from the commit tree.

Palette Package Contribution

Not applicable; this PR does not add or modify Resources/Palettes/**.

@shanggqm

Copy link
Copy Markdown
Owner

感谢这次 Windows V0 的完整补齐。整体方向符合现有 Windows RFC/roadmap,本地优先和隐私边界也保持得不错;CI、Web 合同测试和新增推理测试覆盖都比较扎实。

当前建议:Request changes。合并前需要处理以下问题:

  1. [P1] 后台采集窗口使用了错误的 Win32 Z-order 常量。
    main.rs 把 -2 声明为 HWND_BOTTOM,但 Win32 中 HWND_BOTTOM = 1,-2 是 HWND_NOTOPMOST。后者不能保证窗口位于普通窗口底部,启动采集时仍可能覆盖用户当前前台窗口,违反现有 non-activating/background 契约。请改用正确常量,并补启动阶段的 Z-order 回归验证。

    const HWND_BOTTOM: isize = -2;
    const SW_SHOWNOACTIVATE: i32 = 4;
    const SWP_NOSIZE: u32 = 0x0001;
    const SWP_NOMOVE: u32 = 0x0002;
    const SWP_NOACTIVATE: u32 = 0x0010;
    const SWP_NOOWNERZORDER: u32 = 0x0200;
    const SWP_FRAMECHANGED: u32 = 0x0020;
    const SWP_SHOWWINDOW: u32 = 0x0040;
    let Ok(hwnd) = window.hwnd() else {
    return;
    };
    unsafe {
    let insert_after = HWND_BOTTOM as *mut c_void;
    let flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_FRAMECHANGED;
    let _ = SetWindowPos(hwnd.0, insert_after, 0, 0, 0, 0, flags);
    let _ = ShowWindow(hwnd.0, SW_SHOWNOACTIVATE);
    let _ = SetWindowPos(
    hwnd.0,
    insert_after,
    0,
    0,
    0,
    0,
    SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_SHOWWINDOW,

    https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setwindowpos

  2. [P1] 缺失时间戳会被伪造成当前时间并进入推理统计。
    inference_performance.rs 对缺失/非法时间戳使用 Utc::now。定向复现中,一个缺少 timestamp 的 token_count 被计成“今日 1 次调用”并生成虚假的完整调用耗时。这违反“缺失数据不可伪造”的数据门禁,也不同于 macOS 端要求有效事件时间戳的行为。建议直接忽略缺失/非法时间戳的推理相关事件,并补对应测试。

    let timestamp = date_value(object.get("timestamp"))
    .or_else(|| date_value(payload.get("timestamp")))
    .unwrap_or_else(Utc::now);
    if object.get("type").and_then(|v| v.as_str()) == Some("session_meta") {
    if parsed.source_id.is_none() {
    parsed.source_id = string_value(payload.get("id"))
    .and_then(|id| normalize(Some(id)))
    .map(|id| format!("session-{id}"));
    }
    return;
    }
    if object.get("type").and_then(|v| v.as_str()) == Some("turn_context") {
    tracker.apply_turn_context(
    string_value(payload.get("model")),
    string_value(payload.get("effort")),
    timestamp,

  3. [P2] 不建议在本 PR 中把原生验收改成“仅用户明确要求时运行”。
    本 PR 本身修改了透明窗口、HWND、焦点和采集生命周期,但描述中明确未运行 native coverage。Playwright 可以作为 Web UI 默认验收层,但不能替代这些原生行为的验证。请保留 Windows UI 的 native preflight 门禁,并针对本次窗口行为改动实际运行 coverage/完整采集。

    codexU/AGENTS.md

    Lines 86 to 103 in efa6ff5

    规则:
    - 代码改动后运行 `make build`。
    - 数据读取或聚合逻辑改动后运行 `make probe` 或 `--dump-json`。
    - UI 改动后启动本地 app 进行人工检查。
    - 默认使用 Playwright 进行 UI、视觉和交互验证,包括页面截图、表面切换、滚动、hover/focus、tooltip、文本和数字显示;除非用户直接指定,否则不要用 Tauri 原生截图或 Computer Use 代替 Playwright。
    - Windows Dashboard UI 改动默认先运行 Playwright 全表面验证。只有用户直接要求验证真实 Tauri 窗口、HWND、DPI、窗口层级或原生发布包行为时,才运行下面的原生视觉 workflow;采集窗口必须保持最大化、non-activating、保留用户当前前台窗口,并作为 tool window 排除在任务栏和 Alt-Tab 之外。
    - 文档-only 改动至少运行 `git diff --check`。
    Windows 原生视觉验收的最小入口(从仓库根目录运行):
    ```powershell
    # 只验证依赖、窗口策略、表面契约和脚本语法;不构建、不启动 app
    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\windows\scripts\Capture-NativeVisuals.ps1 -PreflightOnly
    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\windows\scripts\tests\Test-NativeVisualCaptureWorkflow.ps1
    # 构建并启动真实 Tauri 窗口,覆盖各 Dashboard surface 并确认进程清理
    powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\windows\scripts\tests\Test-NativeVisualCaptureCoverage.ps1

  4. [P2] 推理图颜色绑定排序位置,而不是稳定模型身份。
    当前先按调用量排序,再用 index % 3 分色;切换周期或刷新后,同一模型可能变色,同时也没有使用已经注册的 --data-model-* palette 序列。请按模型建立稳定颜色映射,推理强度继续用文字表达。

    const groups = useMemo(
    () =>
    [...period.groups].sort((a, b) =>
    b.call_count !== a.call_count
    ? b.call_count - a.call_count
    : a.p50_duration_seconds - b.p50_duration_seconds,
    ),
    [period.groups],

    {groups.map((group, index) => {
    const medianX = x(group.p50_duration_seconds);
    const p90X = x(group.p90_duration_seconds);
    const pointY = y(group);
    const radius = 5 + Math.sqrt(bubbleBasis(group, period) / maxBubble) * 11;
    const color = `var(--data-series-${(index % 3) + 1})`;

我本地验证了 make build、git diff --check、Web build、37 项合同测试,以及新增的 15 项推理测试和 1 项流式内存测试。没有在本机验证 Windows exact-HWND coverage、完整原生采集或安装包构建。

@shanggqm

Copy link
Copy Markdown
Owner

感谢这次 Windows V0 的完整补齐。整体方向符合现有 Windows RFC/roadmap,本地优先和隐私边界也保持得不错;CI、Web 合同测试和新增推理测试覆盖都比较扎实。\n\n当前建议:Request changes。合并前需要处理以下问题:\n\n1. [P1] 后台采集窗口使用了错误的 Win32 Z-order 常量。 \n 把 声明为 ,但 Win32 中 , 是 。后者不能保证窗口位于普通窗口底部,启动采集时仍可能覆盖用户当前前台窗口,违反现有 non-activating/background 契约。请改用正确常量,并补启动阶段的 Z-order 回归验证。 \n

const HWND_BOTTOM: isize = -2;
const SW_SHOWNOACTIVATE: i32 = 4;
const SWP_NOSIZE: u32 = 0x0001;
const SWP_NOMOVE: u32 = 0x0002;
const SWP_NOACTIVATE: u32 = 0x0010;
const SWP_NOOWNERZORDER: u32 = 0x0200;
const SWP_FRAMECHANGED: u32 = 0x0020;
const SWP_SHOWWINDOW: u32 = 0x0040;
let Ok(hwnd) = window.hwnd() else {
return;
};
unsafe {
let insert_after = HWND_BOTTOM as *mut c_void;
let flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_FRAMECHANGED;
let _ = SetWindowPos(hwnd.0, insert_after, 0, 0, 0, 0, flags);
let _ = ShowWindow(hwnd.0, SW_SHOWNOACTIVATE);
let _ = SetWindowPos(
hwnd.0,
insert_after,
0,
0,
0,
0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_SHOWWINDOW,
\n https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setwindowpos\n\n2. [P1] 缺失时间戳会被伪造成当前时间并进入推理统计。 \n 对缺失/非法时间戳使用 。定向复现中,一个缺少 的 被计成“今日 1 次调用”并生成虚假的完整调用耗时。这违反“缺失数据不可伪造”的数据门禁,也不同于 macOS 端要求有效事件时间戳的行为。建议直接忽略缺失/非法时间戳的推理相关事件,并补对应测试。 \n https://github.com/shanggqm/codexU/blob/efa6ff5fd16c57bf673b49b56ab7345e5f06ffc2/windows/crates/codexu-core/src/readers/inference_performance.rs#L288-L305\n\n3. [P2] 不建议在本 PR 中把原生验收改成“仅用户明确要求时运行”。 \n 本 PR 本身修改了透明窗口、HWND、焦点和采集生命周期,但描述中明确未运行 native coverage。Playwright 可以作为 Web UI 默认验收层,但不能替代这些原生行为的验证。请保留 Windows UI 的 native preflight 门禁,并针对本次窗口行为改动实际运行 coverage/完整采集。 \n https://github.com/shanggqm/codexU/blob/efa6ff5fd16c57bf673b49b56ab7345e5f06ffc2/AGENTS.md#L86-L103\n\n4. [P2] 推理图颜色绑定排序位置,而不是稳定模型身份。 \n 当前先按调用量排序,再用 分色;切换周期或刷新后,同一模型可能变色,同时也没有使用已经注册的 palette 序列。请按模型建立稳定颜色映射,推理强度继续用文字表达。 \n
const groups = useMemo(
() =>
[...period.groups].sort((a, b) =>
b.call_count !== a.call_count
? b.call_count - a.call_count
: a.p50_duration_seconds - b.p50_duration_seconds,
),
[period.groups],
\n https://github.com/shanggqm/codexU/blob/efa6ff5fd16c57bf673b49b56ab7345e5f06ffc2/windows/apps/codexu-tauri/web/src/components/InferencePerformancePanel.tsx#L260-L265\n\n我本地验证了 rm -rf "build/codexU.app"
mkdir -p "build/codexU.app/Contents/MacOS" "build/codexU.app/Contents/Resources"
cp Resources/Info.plist "build/codexU.app/Contents/Info.plist"
cp "Resources/codexU.icns" "build/codexU.app/Contents/Resources/"
cp Resources/*.png "build/codexU.app/Contents/Resources/"
cp -R Resources/LeadershipBadges "build/codexU.app/Contents/Resources/LeadershipBadges"
cp -R Resources/Palettes "build/codexU.app/Contents/Resources/Palettes"
cp -R Resources/CodexCompanion "build/codexU.app/Contents/Resources/CodexCompanion"
/usr/bin/xattr -dr com.apple.quarantine "build/codexU.app" 2>/dev/null || true
MACOSX_DEPLOYMENT_TARGET="13.0" swiftc -O -parse-as-library -target arm64-apple-macos13.0 -D CODEXU_HAS_LIQUID_GLASS Sources/CodexUsageWidget/DesignSystem/PaletteCatalog.swift Sources/CodexUsageWidget/DesignSystem/PaletteEnvironment.swift Sources/CodexUsageWidget/DesignSystem/PaletteModels.swift Sources/CodexUsageWidget/DesignSystem/PaletteResolver.swift Sources/CodexUsageWidget/DesignSystem/PaletteValidation.swift Sources/CodexUsageWidget/Domain/AgentRuntime.swift Sources/CodexUsageWidget/Domain/AppUpdate.swift Sources/CodexUsageWidget/Domain/CodexRateLimitNormalizer.swift Sources/CodexUsageWidget/Domain/CodexRateLimitNormalizerSelfTest.swift Sources/CodexUsageWidget/Domain/CodexSessionLinkSelfTest.swift Sources/CodexUsageWidget/Domain/CodexTokenCounterNormalizer.swift Sources/CodexUsageWidget/Domain/CodexUIssue.swift Sources/CodexUsageWidget/Domain/CodexUIssueSelfTest.swift Sources/CodexUsageWidget/Domain/GlobalShortcut.swift Sources/CodexUsageWidget/Domain/GlobalShortcutSelfTest.swift Sources/CodexUsageWidget/Domain/IssueRouting.swift Sources/CodexUsageWidget/Domain/LeadershipModel.swift Sources/CodexUsageWidget/Domain/LeadershipModelSelfTest.swift Sources/CodexUsageWidget/Domain/ModelInferencePerformance.swift Sources/CodexUsageWidget/Domain/ModelUsageTrend.swift Sources/CodexUsageWidget/Domain/PaletteCatalogSelfTest.swift Sources/CodexUsageWidget/Domain/PalettePreviewRenderer.swift Sources/CodexUsageWidget/Domain/PerformanceMonitorSelfTest.swift Sources/CodexUsageWidget/Domain/PhaseOneGate.swift Sources/CodexUsageWidget/Domain/StatisticsTimeZone.swift Sources/CodexUsageWidget/Domain/StatusItemPreferences.swift Sources/CodexUsageWidget/Domain/StatusItemPresentationSelfTest.swift Sources/CodexUsageWidget/Domain/TaskRuntime.swift Sources/CodexUsageWidget/Domain/TaskRuntimeSelfTest.swift Sources/CodexUsageWidget/Domain/TokenFormatter.swift Sources/CodexUsageWidget/Providers/ClaudeCode/ClaudeCodeRuntimeProvider.swift Sources/CodexUsageWidget/Providers/ClaudeCode/ClaudeSkillPathResolver.swift Sources/CodexUsageWidget/Providers/RuntimeProvider.swift Sources/CodexUsageWidget/Services/AgentUsageAggregator.swift Sources/CodexUsageWidget/Services/AppUpdateStore.swift Sources/CodexUsageWidget/Services/CodexAppServerTaskClient.swift Sources/CodexUsageWidget/Services/CodexCompanionBridge.swift Sources/CodexUsageWidget/Services/CodexIssueAppServerClient.swift Sources/CodexUsageWidget/Services/CodexIssueAppServerClientSelfTest.swift Sources/CodexUsageWidget/Services/CodexSessionOpener.swift Sources/CodexUsageWidget/Services/GitHubReleaseUpdateChecker.swift Sources/CodexUsageWidget/Services/IssueBoardSelfTest.swift Sources/CodexUsageWidget/Services/IssueCandidateProvider.swift Sources/CodexUsageWidget/Services/IssueCandidateProviderSelfTest.swift Sources/CodexUsageWidget/Services/IssueCoordinator.swift Sources/CodexUsageWidget/Services/IssueCoordinatorSelfTest.swift Sources/CodexUsageWidget/Services/IssueRouter.swift Sources/CodexUsageWidget/Services/IssueRouterSelfTest.swift Sources/CodexUsageWidget/Services/IssueStore.swift Sources/CodexUsageWidget/Services/IssueStoreSelfTest.swift Sources/CodexUsageWidget/Services/JSONDumpWriter.swift Sources/CodexUsageWidget/Services/LeadershipDataReader.swift Sources/CodexUsageWidget/Services/ModelInferenceHistoryStore.swift Sources/CodexUsageWidget/Services/MultiRuntimeUsageReader.swift Sources/CodexUsageWidget/Services/PerformanceMonitor.swift Sources/CodexUsageWidget/UI/LeadershipViews.swift Sources/CodexUsageWidget/UI/PaletteSettingsView.swift Sources/CodexUsageWidget/UI/PaletteVisuals.swift Sources/CodexUsageWidget/UI/RuntimeViews.swift Sources/CodexUsageWidget/UI/ShortcutRecorderView.swift Sources/CodexUsageWidget/UI/StatusItemPresentation.swift Sources/CodexUsageWidget/UI/StatusItemRenderer.swift Sources/CodexUsageWidget/UI/StatusItemSettingsView.swift Sources/CodexUsageWidget/UI/TodayInferencePerformanceCard.swift Sources/CodexUsageWidget/UI/UpdateViews.swift Sources/CodexUsageWidget/main.swift
-o "build/codexU.app/Contents/MacOS/codexU"
-framework Cocoa
-framework Carbon
-framework SwiftUI、、Web build、37 项合同测试,以及新增的 15 项推理测试和 1 项流式内存测试。没有在本机验证 Windows exact-HWND coverage、完整原生采集或安装包构建。

@shanggqm
shanggqm marked this pull request as ready for review August 31, 2026 03:46
@shanggqm
shanggqm merged commit 89c9b9e into shanggqm:main Aug 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants