refactor(architecture): tighten desktop boundaries#435
Draft
hiqiancheng wants to merge 14 commits into
Draft
Conversation
Related to #434
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Strengthen startup, quick search, and settings smoke coverage. Skip remote model metadata bootstrap in E2E mode to avoid network noise. Related to #434
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tightens the desktop frontend architecture boundaries for RFC #434.
Moves stable cross-layer DTOs into
apps/desktop/src/contractswhile keeping runtime policy inapplicationor services.Splits popup definitions so manifest/layout metadata is contract-owned and Vue component binding stays in
PopupView.Extracts attachment storage, HTTP fetch, database runtime, data backup, and provider config policy out of overloaded service internals.
Strengthens import-boundary tests so baseline violations and unexpected dependency cycles are caught explicitly.
Adds direct boundary characterization tests for popup manifest/component sync,
DatabaseRuntimeService,HttpServiceTauri fetch wrapping, andDataManagementServicebackup failure semantics.Strengthens desktop E2E smoke coverage for startup, quick search results, model dropdown popup, session history popup, settings persistence, and settings section navigation.
Adds reusable E2E window helpers that identify Tauri windows by in-page state and include diagnostic snapshots on multi-window failures.
Adds popup-window smoke coverage for both registered popup manifests and the Vue component binding path.
Skips remote model metadata bootstrap in E2E mode so UI critical-path smoke tests are not gated on network metadata refresh.
User-facing impact: no intended behavior change. This is an architecture-boundary refactor aimed at reducing future cross-layer coupling.
Related issue or RFC
Link the issue or RFC:
For code changes, link the tracking issue. Only documentation wording, link fixes, or comment-only cleanups may skip the issue-first flow.
AI assistance disclosure
If AI tools materially assisted this contribution, disclose that here or point to the relevant commit trailer.
Volta) for architecture and test-quality review.Testing evidence
List the commands you ran and the results you observed.
pnpm --filter @touchai/desktop test:e2e- passed locally; startup, quick search, model dropdown popup, session history popup, and settings smoke specs ran together with 5 passing.pnpm --filter @touchai/desktop test:unit -- tests/i18n/main-bootstrap.test.ts- passed; Vitest executed the desktop frontend suite: 133 files / 771 tests.pnpm --filter @touchai/desktop test:typecheck- passed.pnpm --filter @touchai/desktop type:check- passed.pnpm --filter @touchai/desktop lint:check- passed with 20 existing warnings and 0 errors.pnpm --filter @touchai/desktop format:check- passed.pnpm --filter @touchai/desktop check:rust,pnpm --filter @touchai/desktop type:check, staged ESLint, and staged Prettier; Rust emitted 2 existing unused warnings insrc/core/search/manager.rs.DatabaseRuntimeService,HttpServiceTauri fetch wrapping,DataManagementServicebackup failure semantics, setting-tool i18n, AgentService error i18n,useAgenti18n, database backup i18n, and NativeService coverage touched by this refactor.pnpm test:pr-checkandtest:unitpassed, thentest:ruststopped whenbuild.rstimed out downloadinghttps://github.com/rtk-ai/rtk/releases/download/v0.40.0/rtk-x86_64-pc-windows-msvc.zipwith Windows socket error10060.test:rustretry could not proceed because this machine hasC:full, noE:/G:drives, andL:\TouchAIcannot be created (The request is not supported). CI should provide the first complete Rust proof for this PR.Did you follow TDD (test-first) for feature and fix work? Strongly recommended. See docs/testing/testing.md.
Risk notes
AgentService, runtime, MCP, or schema impact: touches AgentService runtime boundaries and shared contracts; no MCP behavior change intended.Screenshots or recordings
Not applicable; no intended UI behavior change.
Checklist
[WIP]or similar title prefixes.AgentService, runtime, MCP, or schema boundaries, there is an accepted RFC.pnpm test:prfor this code PR, or this is a docs-only change.pnpm test:coverage:rustor relied on CI coverage evidence.pnpm test:e2elocally or documented why CI is the first valid proof.