fix(desktop): cache browser discovery in settings#453
Conversation
📝 WalkthroughWalkthroughThis pull request implements intelligent runtime caching for browser discovery operations to eliminate redundant native calls, while adding Windows-specific process suppression and lifecycle-aware refresh triggers tied to user interaction in the settings dropdown. ChangesBrowser Discovery Runtime Caching
Sequence DiagramsequenceDiagram
participant SettingsComponent
participant RuntimeCache
participant NativeBrowser
participant UserDropdown
SettingsComponent->>RuntimeCache: onMounted: loadCachedInstalledBrowsers()
RuntimeCache->>NativeBrowser: first call: native discovery
NativeBrowser-->>RuntimeCache: installed browsers list
RuntimeCache-->>SettingsComponent: cached result
SettingsComponent->>SettingsComponent: render dropdown
UserDropdown->>SettingsComponent: `@update`:open event
SettingsComponent->>RuntimeCache: handleBrowserExecutableDropdownOpen(force=true)
RuntimeCache->>NativeBrowser: force bypass cache: native discovery
NativeBrowser-->>RuntimeCache: refreshed list
RuntimeCache-->>SettingsComponent: new result (or reuse in-flight)
SettingsComponent->>SettingsComponent: update UI if not unmounted
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
reg queryandtaskkillhelper commands withCREATE_NO_WINDOWso browser discovery/cleanup does not flash command windows or surfacereg.exedialogs.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.
Testing evidence
List the commands you ran and the results you observed.
pnpm exec vitest run --configLoader runner tests/SettingsView/settingsBrowserSection.test.ts --passWithNoTestsfromapps/desktop: passed, 1 file / 15 tests.cargo check --manifest-path src-tauri/Cargo.toml --libfromapps/desktop: passed.pnpm test:prfrom repo root: desktop checks passed through type check, test type check, lint check, format check, Rust check, 152 frontend test files / 963 tests, Rust tests, and frontend coverage. The final monorepo step failed at@touchai/site buildbecause this local environment does not resolve theastrocommand ('astro' is not recognized as an internal or external command).pnpm tauri devlaunched successfully after freeing local disk space; verifiedtarget\\debug\\TouchAI.exeand Vitelocalhost:1420were running.pnpm test:e2e: not run locally; this local desktop E2E harness was not exercised after the targeted/manual verification above, so CI is the first full E2E proof.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: limited browser runtime process-spawn behavior change on Windows; no AgentService, MCP, or schema impact.Screenshots or recordings
No screenshots; behavior is a settings performance/process-spawn fix.
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.