Skip to content

Cas/clean tauri api layer#104

Draft
Cas Linden (CasLinden) wants to merge 14 commits into
developfrom
cas/clean-tauri-api-layer
Draft

Cas/clean tauri api layer#104
Cas Linden (CasLinden) wants to merge 14 commits into
developfrom
cas/clean-tauri-api-layer

Conversation

@CasLinden
Copy link
Copy Markdown
Contributor

@CasLinden Cas Linden (CasLinden) commented May 7, 2026

Summary

In tauri-api.ts:

  • cleaned unused invocation handlers (and their rust counterparts in commands)
  • cleaned up types and constants
  • now reflects the main.rs (which reads only from commands)

In components:

  • replaced direct invoke calls with (exisitng and new) handlers in tauri-api.ts
  • now read all types from shared.ts

Docs

  • src-tauri/src/README.md — updated commands/ entry to reflect current handler list and tauri-api.ts as the call site
  • src/README.md — new frontend architecture overview

Test Plan

Feedback type refactor

I managed to spin up the hono-api receiving these locally, and though drizzle kit was able to confirm that the type refactor does not block or meaningfully impact the ability to receive error data

{"text":"It all went to shit","type":"bug","email":"cas@darkmatter.io","share":{"appLogs":true,"systemInfo":true,"usageStats":true,"evolutionLog":true,"changedNixFiles":true,"currentAppState":true,"buildErrorOutput":true,"aiProviderModelInfo":true,"flakeInputsSnapshot":true},"createdAt":"2026-05-08T05:46:13.022Z","systemInfo":{"arch":"aarch64","osName":"macos","osVersion":"26.3","appVersion":"0.22.0","nixVersion":"nix (Determinate Nix 3.13.2) 2.32.4"},"usageStats":{"extra":{"last_updated_at":"2026-05-07T06:33:26.103448+00:00","total_iterations":11,"failed_evolutions":0,"successful_evolutions":5},"successRate":100,"avgIterations":2.2,"lastComputedAt":"2026-05-08T05:46:01.201211+00:00","totalEvolutions":5},"expectedText":"Not sure, you tell me","appLogsContent":"evaluating file '......,"aiProviderModelInfo":{"latencyMs":null,"iterations":1,"evolveModel":null,"totalTokens":629,"summaryModel":null,"buildAttempts":0,"evolveProvider":"vllm","summaryProvider":"vllm"},"evolutionLogContent":"{\"buildAttempts\":0,\"createdAt\":1778135606,\"id\":\"abc1f522-7ce7-46ef-8d0d-a3f29497d83a\",\"iterations\":1,\"prompt\":\"can you help me add homebrew packages?\",\"state\":\"conversational\",\"summary\":\"<truncated>\",\"totalTokens\":629}","flakeInputsSnapshot":{"nixpkgs":{"rev":"bc57abace07689cfd34203aa5fb4027514895987","narHash":"sha256-iw3XDIG6xxk+AZTcawCLHf6i9i4tXRzLZEoV9xhRToQ=","lastModified":1777946660},"nix-darwin":{"rev":"8c62fba0854ba15c8917aed18894dbccb48a3777","narHash":"sha256-8wURyQMdDkGUarSTKOGdCuFfYiwa3HbzwscUfn3STDE=","lastModified":1777780666},"home-manager":null},"currentAppStateSnapshot":{"hostAttr":"macbook","configDir":"/Users/caslinden/.darwin","evolution":{"state":"conversational","iterations":1,"hasEvolution":true,"buildAttempts":0},"timestamp":"2026-05-08T05:46:01.199652+00:00","feedbackType":"bug"}}

One test fails for directory picker. Test case received conflicted updates both of which were kept in a merge conflict resolution by copilot-swe-agent.

Vitest — unit project

File Result Notes
src/stores/widget-store.test.ts PASS 25 tests
src/hooks/use-permissions.test.ts PASS 6 tests (logged plugin-fallback warnings are expected)
src/components/widget/widget.test.tsx PASS 4 tests
src/components/widget/controls/directory-picker.test.tsx FAIL (1 failing) ignores setHostAttr failures without breaking the happy path — expected ["mbp"], got [] (line 223). 9 of 10 tests pass. Pre-existing failure: identical test code/mocks exist on origin/develop and reproduce the same failure (verified by checking out develop's version of the file and running). The fix commit 55dd4a91 is already an ancestor of HEAD; merging develop would not resolve it. Root cause: mocked setDir wrapper calls mockListHosts() (default []) instead of using the hosts field from mockSetDir.mockResolvedValue({hosts: ["mbp"]}).
src/components/widget/utils.test.ts PASS 2 tests
src/components/kibo-ui/nix-editor/use-nix-editor.test.ts PASS 13 tests
src/components/ui/ui.test.tsx PASS 13 tests
src/lib/ai-provider-validation.test.ts PASS 2 tests

Vitest — storybook project (auto-snapshot on every story)

File Result Notes
src/components/kibo-ui/nix-editor/nix-editor.stories.tsx PASS 3 tests
src/components/kibo-ui/code-block/code-block.stories.tsx PASS 1 test
src/components/preview-indicator/preview-indicator.stories.tsx PASS 7 tests
src/components/ui/badge.stories.tsx PASS 1 test
src/components/ui/button.stories.tsx PASS 3 tests
src/components/ui/command.stories.tsx PASS 1 test
src/components/ui/dialog.stories.tsx PASS 1 test
src/components/ui/file-badge.stories.tsx PASS 4 tests
src/components/ui/hover-click-popover-icon.stories.tsx PASS 4 tests
src/components/ui/input-group.stories.tsx PASS 2 tests
src/components/ui/popover.stories.tsx PASS 1 test
src/components/ui/scroll-area.stories.tsx PASS 1 test
src/components/ui/select.stories.tsx PASS 1 test
src/components/ui/tabs.stories.tsx PASS 1 test
src/components/ui/tooltip.stories.tsx PASS 1 test
src/components/widget/badges/config-dir-badge.stories.tsx PASS 3 tests
src/components/widget/badges/gitignore-badge.stories.tsx PASS 2 tests
src/components/widget/evolve-flow.stories.tsx PASS 5 tests
src/components/widget/history/timeline-connector.stories.tsx PASS 1 test
src/components/widget/notifications/external-build-detected.stories.tsx PASS 3 tests
src/components/widget/overlays/editor-panel.stories.tsx PASS 2 tests
src/components/widget/overlays/evolve-progress.stories.tsx PASS 9 tests
src/components/widget/overlays/rebuild-overlay-panel.stories.tsx PASS 9 tests
src/components/widget/settings/ai-models-tab.stories.tsx PASS 1 test
src/components/widget/settings/developer-tab.stories.tsx PASS 2 tests
src/components/widget/summaries/analyze-button.stories.tsx PASS 4 tests
src/components/widget/summaries/unsummarized-changes-section.stories.tsx PASS 5 tests
src/components/widget/utils.stories.tsx PASS 1 test
src/components/widget/widget.stories.tsx PASS 19 tests
src/stories/Button.stories.ts PASS 5 tests
src/stories/Header.stories.ts PASS 2 tests
src/stories/Page.stories.ts PASS 2 tests

Rust unit tests — by module

Module Result Notes
ai::log_summarizer PASS
ai::provider_errors PASS
bootstrap::default_config PASS
bootstrap::template PASS
commands::debug PASS
db::schema PASS
e2e_runtime PASS
evolve::age PASS
evolve::chat_memory PASS
evolve::config_dir_context PASS
evolve::edit_nix_file PASS
evolve::ensure_secret PASS 1 ignored (manual interactive sops test)
evolve::file_ops PASS
evolve::gitignore PASS
evolve::search_code PASS
evolve::search_docs PASS
evolve::search_packages PASS
evolve::sops PASS
evolve::tools PASS
evolve::utils PASS
feedback PASS
git::changes_from_diff PASS
git::exec PASS
managed_edits::homebrew_adopt PASS 1 ignored (manual; needs Homebrew)
state::build_state PASS
state::evolve_state PASS
storage::credential_store PASS
storage::store PASS
summarize::build_prompt PASS
summarize::group_existing PASS
summarize::queue_summarizer PASS
summarize::token_budgets PASS
system::nix_ast_lists PASS
system::permissions PASS
system::scanner PASS
updater_pin PASS
utils PASS

Overall: 279 passed, 0 failed, 2 ignored.


Playwright E2E

Test Result Notes
app shell mounts PASS
page has expected title PASS

wdio — Tauri app suites

Suite Result Notes
smoke PASS (flaky) First run: 3 passing, 1 failing (top-level views › opens history from header — timeout on [data-testid="history-header"]). Re-run: 4/4 passing. Treated as flake.
basic-prompts PASS 3 passing
conversational PASS 2 passing
discard PASS 2 passing
modify PASS 1 passing
onboarding PASS 1 passing

Peekaboo / Computer Use E2E

Result Notes
Remote Mac suite SKIP — CI only

System scenario E2E

Scenario Result Notes
nix-install SKIP — CI only

Summary

Suite Total Pass Fail Skip
Vitest unit 8 files (182 tests) 7 files / 181 tests 1 file / 1 test (pre-existing on develop) 0
Vitest storybook 32 files 32 0 0
Rust unit 37 modules (281 tests) 37 modules / 279 tests 0 2 ignored
Playwright E2E 2 tests 2 0 0
wdio 6 suites 6 (smoke flaky, passed on re-run) 0 0
Peekaboo 1 1
System E2E 1 1

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Fails
🚫

Your ## Test Plan section is empty. Describe the steps a reviewer should take to verify this change.

Warnings
⚠️ Please assign this PR to someone (usually yourself).
⚠️ ❗ Big PR (1087 lines changed). Consider splitting it into smaller, focused changes.
⚠️

New TypeScript source files were added without any new tests:

  • apps/native/src/lib/constants.ts

📋 PR Overview

Lines changed 1087 (+428 / -659)
Files 2 added, 53 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
New UI components no
New Storybook stories no
New Rust modules no
New TS source files yes (1)
New tests no
package.json touched no
Cargo.toml touched yes
Infra / CI touched no

Generated by 🚫 dangerJS against 860791d

@CasLinden Cas Linden (CasLinden) marked this pull request as draft May 7, 2026 12:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

nixmac Peekaboo E2E: ❌ FAIL

Comment thread apps/native/src/components/widget/settings/ai-models-tab.tsx Outdated
@CasLinden Cas Linden (CasLinden) marked this pull request as ready for review May 8, 2026 07:17
@CasLinden
Copy link
Copy Markdown
Contributor Author

Think the build error intorudeced elsewhere in e2e changes is addressed by scott elsewhere

@CasLinden Cas Linden (CasLinden) marked this pull request as draft May 11, 2026 05:37
@CasLinden
Copy link
Copy Markdown
Contributor Author

Converting this to draft because it requires serious attention to consolidate with what was merged after

@arximboldi
Copy link
Copy Markdown
Contributor

Massive diff. To address conflicts, I wonder if it would make sense to recreate it from original prompts. Probably best to tackle after the open PR inflation situation has been taken under control :)

@CasLinden
Copy link
Copy Markdown
Contributor Author

I wonder if it would make sense to recreate it from original prompts

I wondered that too when I put this on draft, but I think I can salvage it, maybe.

And roger about tackling this later.

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.

3 participants