Repository navigation
feat(desktop): add observation navigation and unify feedback and context - #2188
Conversation
Keep Overview as the initial page and Settings & diagnostics at the bottom of the sidebar. Add Observation without changing the existing page content.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
| working-directory: . | ||
| run: | | ||
| uv run --no-sync ruff check --no-fix desktop/tests/installed_ui.py desktop/tests/installed_fixture.py desktop/tests/installed_workflow.py desktop/tests/fixture_qualification.py | ||
| uv run --no-sync ruff check --no-fix desktop/tests/installed_ui.py desktop/tests/installed_fixture.py desktop/tests/installed_workflow.py desktop/tests/installed_lifecycle.py desktop/tests/fixture_qualification.py |
There was a problem hiding this comment.
[P2] harness 静态检查清单仍漏 installed_boundaries.py
本次把 desktop/tests/installed_lifecycle.py 加进这四条 ruff / format / ty 命令,但同一目录下的 desktop/tests/installed_boundaries.py 仍未纳入。它不是孤立脚本:desktop/tests/installed_workflow.py:25 直接 from installed_boundaries import exercise_note_budget, exercise_search_limit,而 installed_ui.py:213 无条件调用 exercise_memory,所以该文件在 Windows 安装包验收里真实执行,却从不被 lint / format / ty 检查。
证据:desktop/tests/*.py 共 8 个文件。real_cli.py / real_server.py 由第 113 / 116 行作为脚本执行;fixture_qualification.py 与另外四个 installed_*.py 在本清单内;installed_boundaries.py 是唯一既不在本清单、也不被单独执行的模块。同时 desktop/VALIDATION.md 的 "The five installed-harness Python files passed Ruff lint/format and Windows/Linux ty check" 会让读者把这一遗漏读成「全部 harness 文件已覆盖」。
建议:把文件枚举改成 desktop/tests/installed_*.py desktop/tests/fixture_qualification.py,或显式补上 installed_boundaries.py;否则下次新增 harness 模块仍会漏,而「Ruff/ty 通过」这句话的覆盖范围无法从命令本身看出来。
There was a problem hiding this comment.
已改为自动收集全部 installed_*.py,与 fixture_qualification.py 共用四项静态检查,覆盖 installed_boundaries.py。
| url.scheme() == "http" && url.host_str() == Some("tauri.localhost") | ||
| } else { | ||
| url.scheme() == "tauri" && url.host_str() == Some("localhost") | ||
| } && url.port().is_none(); |
There was a problem hiding this comment.
[P2] 端口判断被移出平台分支后,Windows / Android 形态缺端口拒绝断言
先说结论:当前行为没有回归。if cfg!(...) { A } else { B } && url.port().is_none() 里的 && 作用于整个 if-else 表达式,我写了独立探针确认(if true { true } else { false } && false 求值为 false),所以 packaged 仍等价于 base 的「分支命中 且 无端口」。
问题是这段代码的回归保护:
- 新增的负向用例只覆盖
tauri://localhost:8000。在 Windows / Android 上这条已经被 scheme 判断(只接受http)拒掉,真正只能由url.port().is_none()拦住的是http://tauri.localhost:8000,它不在blocks_remote_navigation_and_userinfo的拒绝对照表里。 - 结构上端口条件现在看起来像属于
else分支。若后续有人把&& url.port().is_none()挪进else或给分支加括号,Windows 上会静默放行任意http://tauri.localhost:<port>,而现有全部断言(LOCAL_ORIGIN放行、tauri://*拒绝、other_platform拒绝)仍然全绿——这是导航白名单,属于安全边界。
建议:把端口条件写回各分支表达式(url.scheme() == "http" && url.host_str() == Some("tauri.localhost") && url.port().is_none()),并在同一用例补 http://tauri.localhost:8000 的负向断言。
There was a problem hiding this comment.
已将端口限制显式写入各平台分支,并补充 http://tauri.localhost:8000 的拒绝断言。
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
knqiufan
left a comment
There was a problem hiding this comment.
Two reproducible P2 issues remain in draft preservation and keyboard focus restoration. Details are attached inline. Both reproductions used UI tests with mocked IPC; no installed-package acceptance is claimed.
| key={connectionSelection?.request ?? 0} | ||
| initialProfileId={connectionSelection?.id} |
There was a problem hiding this comment.
[P2] Preserve new drafts when reopening a profile with a pending save
Start saving a connection profile, then use the global menu to select that same profile again, confirm discard, and enter a new draft before the save resolves. The new key remounts Connections with busy = false, allowing editing while the previous save remains pending. When that response reaches receiveState, the profile revision changes and the new editor's [selected, profile?.revision] effect calls reset(profile), overwriting the new input and clearing its dirty guard. A mocked-IPC UI reproduction changes First new draft to First saved when the old response arrives, including with active: null as returned when saving an active profile. Preserve the newer draft across that revision update, or keep editing that profile disabled until its pending save completes.
There was a problem hiding this comment.
late save responses no longer overwrite new drafts entered after reopening the same profile. The discard guard remains intact. Regression tests cover responses that retain or clear the active connection.
| const target = restore.current ? restore.current() : previous; | ||
| if (target === null) return; |
There was a problem hiding this comment.
[P2] Restore focus when Scope recovery stays on the Connections page
With local state loaded and no active connection, open the Scope dialog while already on Connections, then choose "Manage connections and credentials" ("管理连接与凭据"). The callback clears scopeReturnFocus.current and closes the dialog, but navigate("connections") returns early because the page is unchanged. This null-target return also skips the modal's fallback, so neither path restores focus. A mocked-IPC UI reproduction confirms that document.activeElement becomes document.body after dismissal. Restore focus to the page heading or the original trigger even when recovery does not change pages.
There was a problem hiding this comment.
Scope recovery now restores focus to the page heading when already on Connections, while preserving the draft.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Which issue or RFC does this PR close?
Closes #2102.
Rationale for this change
Desktop needs consistent navigation, feedback and recovery guidance, with the current connection and exact Scope visible across pages. These improvements must preserve existing workflows and protect drafts when asynchronous connection, Scope and write results arrive.
Packaged macOS testing also exposed navigation-origin and confirmation-dialog issues that prevented reliable use of the shared shell.
What changes are included in this PR?
tauri://localhoston macOS, while retaining navigation restrictions.Observation data integrations remain explicitly unavailable pending #2105, #2106 and #2107. Server installation and lifecycle management remain owned by #2117.
Are there any user-facing changes?
Yes. Users gain Observation navigation, clearer global context, consistent recovery guidance, help and local setup entry points, and reliable application confirmations on macOS.
Existing connection, Scope, Memory and diagnostic workflows remain accessible. Language and theme changes preserve drafts. Selecting a saved profile opens its editor without activating it, and Observation navigation does not trigger connection checks.
There are no changes to public HTTP APIs, IPC command schemas, credential formats or persisted data formats. No migration is required.
How was this change tested?
Validation is recorded in
desktop/VALIDATION.md, using Node 24.14.1, pnpm 11.13.1 and Rust 1.95.0.Passed checks:
Generated contracts and icons were checked without regeneration.
Regression coverage includes navigation, bilingual feedback, exact Scope identity, targeted profile selection, draft cancellation, pending context changes, late responses, failed and unknown writes, confirmation dialogs and keyboard focus.
Windows headless Edge checks with synthetic IPC covered English/Chinese, light/dark/system themes, narrow windows, 800×600 layouts, error states and forced colors. The 200% layout check used an equivalent viewport; it was not native WebView zoom acceptance.
On macOS 26.5.1 Apple Silicon, a debug application was built with:
The packaged application loaded without Vite, and native state/version IPC worked. Actual WebView checks covered bilingual draft navigation, cancel-editing confirmations, explicit discard, Escape cancellation, Tab/Shift+Tab containment and Scope-dialog focus restoration.
Packaged macOS checks did not use a real Server. Signing/notarization, Intel Mac, IME, VoiceOver, native 200% zoom, Keychain and installed Server workflows remain unqualified.
Repository-wide
uv run --locked prek run -aencountered existing Windows Python type-check failures in unchanged code; the other hooks passed.AI usage statement
OpenAI Codex assisted with implementation, regression tests, documentation and review.