Skip to content

chore: update Tauri ecosystem dependencies#1453

Merged
shm11C3 merged 5 commits into
developfrom
chore/update-tauri-and-specta-deps
May 5, 2026
Merged

chore: update Tauri ecosystem dependencies#1453
shm11C3 merged 5 commits into
developfrom
chore/update-tauri-and-specta-deps

Conversation

@shm11C3

@shm11C3 shm11C3 commented May 4, 2026

Copy link
Copy Markdown
Owner

Summary

Update Tauri, tauri-specta, and related plugin dependencies, then adapt the bindings export code for tauri-specta rc.24.

Add explicit Specta wire types for ProcessInfo usage fields, update enum serde derives, and move the Result helper type out of generated bindings.

Validation:

  • cargo check
  • cargo test -p hardware_visualizer enums::
  • cargo test -p hardware_visualizer models::hardware::tests::serialize_usage
  • npm run build
  • npx vitest run src/hooks/useColorTheme.test.ts

Related Issues

Type of Change

  • Bug fix (fix/ branch)
  • New feature (feat/ branch)
  • Refactoring (refactor/ branch)
  • Documentation (docs/ branch)
  • Dependencies update
  • Other (chore/ branch)

Screenshots / Videos

Test Plan

  • Manual testing
  • Unit tests

Checklist

  • Self-reviewed the code
  • Linting and formatting pass (npm run lint && npm run format / cargo tauri-lint && cargo tauri-fmt)
  • Tests pass (npm test / cargo tauri-test)
  • No new warnings or errors

Summary by CodeRabbit

  • New Features

    • "Sky" theme replaces the previous "Ocean" theme.
  • Improvements

    • Upgraded Tauri and related tooling/plugins.
    • Regenerated native↔web bindings and TypeScript contracts to reflect updated interfaces.
    • Process list CPU/memory values now serialized as strings.
    • Several settings fields made optional for more flexible configuration.
  • Tests

    • Added unit tests for result helpers and updated theme tests.

Update Tauri, tauri-specta, and related plugin dependencies, then adapt
the bindings export code for tauri-specta rc.24.

Add explicit Specta wire types for ProcessInfo usage fields, update enum
serde derives, and move the Result helper type out of generated bindings.

Validation:
- cargo check
- cargo test -p hardware_visualizer enums::
- cargo test -p hardware_visualizer models::hardware::tests::serialize_usage
- npm run build
- npx vitest run src/hooks/useColorTheme.test.ts
Copilot AI review requested due to automatic review settings May 4, 2026 20:05
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 1a9a0a07-a24d-48d8-8353-997212220fc5

📥 Commits

Reviewing files that changed from the base of the PR and between 3f8b38b and f6da6d3.

📒 Files selected for processing (3)
  • src-tauri/src/models/hardware.rs
  • src/types/result.test.ts
  • src/types/result.ts
✅ Files skipped from review due to trivial changes (2)
  • src/types/result.test.ts
  • src/types/result.ts

📝 Walkthrough

Walkthrough

Tauri and Specta toolchain versions bumped; several Rust enums switched from manual serde impls to derive-based Serialize; Theme::Ocean renamed to Theme::Sky; Specta/TypeScript bindings regenerated (ProcessInfo shape and optional fields changed); a local Result type was introduced and TS imports/tests updated.

Changes

Bindings, Serialization, and Types

Layer / File(s) Summary
Dependency Versions
package.json, src-tauri/Cargo.toml
Bumped Tauri and plugin versions (@tauri-apps/api, tauri-plugin-dialog, tauri-plugin-store, tauri dev-dep) and Specta toolchain (tauri-specta, specta, specta-typescript).
Specta / TS Export Config
src-tauri/src/lib.rs
Added TYPED_ERROR_IMPL and registered it via builder.typed_error_impl(...); switched TS export to Typescript::default() (removed custom // @ts-nocheck`` header).
Data Shape / Specta Annotations
src-tauri/src/models/hardware.rs
ProcessInfo.cpu_usage and memory_usage annotated with #[specta(type = String)] and ProcessInfo no longer derives Deserialize.
Enum Serialization (core)
src-tauri/src/enums/error.rs, src-tauri/src/enums/hardware.rs, src-tauri/src/enums/settings.rs
Replaced manual impl Serialize with #[derive(Serialize)] on BackendError, HardwareType, Theme, GraphSize, and TemperatureUnit; serde rename attributes retained; existing custom Deserialize impls preserved where present.
Theme Variant Change
src-tauri/src/enums/settings.rs
Theme::OceanTheme::Sky; deserializer and unit tests updated to map "sky" to Theme::Sky.
Generated Bindings (wiring / runtime)
src/rspc/bindings.ts
Regenerated bindings: commands now call __TAURI_INVOKE and return a `{status,data}
Frontend Type Locality
src/types/result.ts, src/features/settings/hooks/useSettingsAtom.ts
Result<T,E> declared locally as a discriminated union in src/types/result.ts; useSettingsAtom.ts imports Result from the local module instead of bindings.
Tests / Test Data
src/hooks/useColorTheme.test.ts, src-tauri/src/enums/settings.rs tests
Updated fixtures and expectations to use "sky" / Theme::Sky instead of "ocean".

Sequence Diagram(s)

sequenceDiagram
    participant Client as Frontend
    participant Bind as Bindings (src/rspc/bindings.ts)
    participant Tauri as Tauri (__TAURI_INVOKE)
    participant Backend as Rust backend (src-tauri)

    Client->>Bind: call commands.fetchUpdate()
    Bind->>Tauri: __TAURI_INVOKE("fetch_update", ...)
    Tauri->>Backend: dispatch to Rust handler
    Backend-->>Tauri: return serialized payload
    Tauri-->>Bind: resolve invoke promise
    Bind-->>Client: return typed {status:"ok"| "error", data|error}
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

rust

"I hopped through code and gave it a try,
Ocean turned to sky beneath my eye,
Derives trimmed the handmade art,
Bindings rebuilt to play their part,
A rabbit cheers this tidy sky‑high try."

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: update Tauri ecosystem dependencies' directly and clearly summarizes the main change: updating Tauri and related dependencies across the codebase.
Description check ✅ Passed The PR description covers all required sections from the template (Summary, Related Issues, Type of Change, Test Plan, Checklist) with relevant details about the dependency updates, validation steps performed, and checklist items marked appropriately.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/update-tauri-and-specta-deps

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 97.28% (🎯 60%) 1182 / 1215
🔵 Statements 96.81% (🎯 60%) 1246 / 1287
🔵 Functions 96.74% (🎯 60%) 297 / 307
🔵 Branches 90.54% (🎯 60%) 431 / 476
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/features/settings/hooks/useSettingsAtom.ts 100% 100% 100% 100%
Generated in workflow #2913 for commit f6da6d3 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Rust Tauri Coverage Report

Coverage Details
Filename                                     Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
_tests/commands/background_image_test.rs          39                 0   100.00%           6                 0   100.00%          21                 0   100.00%           0                 0         -
_tests/commands/settings_test.rs                 219                 0   100.00%          18                 0   100.00%         162                 0   100.00%           0                 0         -
adapters/tray.rs                                 152               152     0.00%          15                15     0.00%         104               104     0.00%           0                 0         -
adapters/window.rs                               254                69    72.83%          21                 8    61.90%         195                47    75.90%           0                 0         -
app/startup.rs                                   188                87    53.72%          10                 3    70.00%         114                58    49.12%           0                 0         -
commands/background_image.rs                      22                 7    68.18%          11                 5    54.55%          19                 7    63.16%           0                 0         -
commands/hardware.rs                              62                62     0.00%          20                20     0.00%          68                68     0.00%           0                 0         -
commands/settings.rs                             578               578     0.00%         102               102     0.00%         497               497     0.00%           0                 0         -
commands/system.rs                                21                21     0.00%          10                10     0.00%          20                20     0.00%           0                 0         -
commands/ui.rs                                    17                17     0.00%           2                 2     0.00%          13                13     0.00%           0                 0         -
commands/updater.rs                               97                97     0.00%          15                15     0.00%          66                66     0.00%           0                 0         -
enums/error.rs                                   101                10    90.10%           8                 1    87.50%          86                10    88.37%           0                 0         -
enums/hardware.rs                                184                 7    96.20%          15                 1    93.33%         111                 6    94.59%           0                 0         -
enums/settings.rs                                386                16    95.85%          23                 2    91.30%         253                10    96.05%           0                 0         -
infrastructure/database/migration.rs              66                 1    98.48%          10                 0   100.00%          86                 0   100.00%           0                 0         -
lib.rs                                           218               218     0.00%           5                 5     0.00%         138               138     0.00%           0                 0         -
lifecycle.rs                                     227               178    21.59%          29                25    13.79%         160               137    14.37%           0                 0         -
main.rs                                            3                 3     0.00%           1                 1     0.00%           3                 3     0.00%           0                 0         -
models/hardware.rs                               375                83    77.87%          31                12    61.29%         275               100    63.64%           0                 0         -
models/hardware_archive.rs                         8                 0   100.00%           2                 0   100.00%          10                 0   100.00%           0                 0         -
models/settings.rs                               283                 0   100.00%          16                 0   100.00%         246                 0   100.00%           0                 0         -
services/background_image_service.rs             165                96    41.82%          16                10    37.50%          93                59    36.56%           0                 0         -
services/gpu_service.rs                           56                56     0.00%          11                11     0.00%          43                43     0.00%           0                 0         -
services/hardware_service.rs                      85                85     0.00%           4                 4     0.00%          51                51     0.00%           0                 0         -
services/language_service.rs                     101                 0   100.00%          18                 0   100.00%          57                 0   100.00%           0                 0         -
services/memory_service.rs                        12                12     0.00%           3                 3     0.00%           7                 7     0.00%           0                 0         -
services/motherboard_service.rs                   12                12     0.00%           3                 3     0.00%           7                 7     0.00%           0                 0         -
services/network_service.rs                       14                14     0.00%           1                 1     0.00%           8                 8     0.00%           0                 0         -
services/settings_service.rs                     321               143    55.45%          31                13    58.06%         269               130    51.67%           0                 0         -
services/system_service.rs                        22                22     0.00%           2                 2     0.00%          12                12     0.00%           0                 0         -
services/ui_service.rs                            45                45     0.00%           8                 8     0.00%          36                36     0.00%           0                 0         -
tray/surface/mod.rs                                8                 8     0.00%           2                 2     0.00%           5                 5     0.00%           0                 0         -
tray/surface/tauri_surface.rs                     80                80     0.00%           6                 6     0.00%          48                48     0.00%           0                 0         -
tray/widget.rs                                   562                28    95.02%          50                 3    94.00%         505                26    94.85%           0                 0         -
utils/color.rs                                    66                 1    98.48%           4                 0   100.00%          26                 0   100.00%           0                 0         -
utils/file.rs                                    224                 5    97.77%          14                 0   100.00%         144                 4    97.22%           0                 0         -
utils/formatter.rs                                55                 0   100.00%           5                 0   100.00%          39                 0   100.00%           0                 0         -
utils/logger.rs                                   71                71     0.00%           1                 1     0.00%          38                38     0.00%           0                 0         -
utils/tauri.rs                                   138                 0   100.00%          17                 0   100.00%          82                 0   100.00%           0                 0         -
workers/mod.rs                                    40                40     0.00%           2                 2     0.00%          24                24     0.00%           0                 0         -
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                           5577              2324    58.33%         568               296    47.89%        4141              1782    56.97%           0                 0         -

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src-tauri/src/enums/settings.rs (1)

12-32: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Keep reading legacy "ocean" values during upgrade.

Renaming the stored theme literal without a compatibility alias turns existing persisted settings into deserialization failures. Please accept "ocean" as an alias for Theme::Sky (or migrate the stored value before reading it) so current installs keep their saved theme.

Minimal compatibility fix
-      "sky" => Ok(Theme::Sky),
+      "sky" | "ocean" => Ok(Theme::Sky),
-      ("\"sky\"", Theme::Sky),
+      ("\"sky\"", Theme::Sky),
+      ("\"ocean\"", Theme::Sky),

As per coding guidelines, src/**/*.{ts,tsx}: Use Tauri Store plugin via src/lib/tauriStore.ts and src/hooks/useTauriStore.ts for persistent UI settings storage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src-tauri/src/enums/settings.rs` around lines 12 - 32, The deserializer for
Theme must accept legacy "ocean" values so old persisted settings don't fail;
update the Deserialize impl for Theme (the deserialize function) to treat the
lowercase string "ocean" as an alias for Theme::Sky (i.e., add a match arm
mapping "ocean" => Ok(Theme::Sky)) or perform a migration step before
deserialization that rewrites "ocean" to "sky" so Theme::Sky is produced; make
sure to keep the to_lowercase() usage and the existing match arms intact.
🧹 Nitpick comments (1)
package.json (1)

67-74: ⚡ Quick win

Finish the JS-side Tauri upgrade by bumping the CLI too.

These bumps still leave @tauri-apps/cli on ^2.10.0 at Line 26. Tauri’s update guide explicitly tells you to update the CLI and API together, so this PR leaves the JS toolchain one minor behind the packages it is driving. (v2.tauri.app)

Suggested follow-up
-    "@tauri-apps/cli": "^2.10.0",
+    "@tauri-apps/cli": "^2.11.0",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 67 - 74, The package.json upgrade updated many
`@tauri-apps/`* packages but left "@tauri-apps/cli" at ^2.10.0; update the
"@tauri-apps/cli" dependency in package.json to match the upgraded API (e.g.,
^2.11.0), then reinstall dependencies (npm/yarn/pnpm) to refresh lockfiles and
ensure the JS CLI and the `@tauri-apps/api/plugins` (like "@tauri-apps/api",
"@tauri-apps/plugin-shell", "@tauri-apps/plugin-sql", etc.) are in sync.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/rspc/bindings.ts`:
- Around line 405-410: The typedError helper currently rethrows Error instances
(in typedError), violating its non-throwing contract; change the catch block so
it does not throw but instead returns { status: "error", error: <captured-error>
} for all exceptions (including instances of Error) so callers always receive
the error wrapper and can use isError(...) checks; ensure the returned error
preserves the original error value/stack/message (e.g., pass the caught e or a
normalized object) and remove the throw e path from typedError.

---

Outside diff comments:
In `@src-tauri/src/enums/settings.rs`:
- Around line 12-32: The deserializer for Theme must accept legacy "ocean"
values so old persisted settings don't fail; update the Deserialize impl for
Theme (the deserialize function) to treat the lowercase string "ocean" as an
alias for Theme::Sky (i.e., add a match arm mapping "ocean" => Ok(Theme::Sky))
or perform a migration step before deserialization that rewrites "ocean" to
"sky" so Theme::Sky is produced; make sure to keep the to_lowercase() usage and
the existing match arms intact.

---

Nitpick comments:
In `@package.json`:
- Around line 67-74: The package.json upgrade updated many `@tauri-apps/`*
packages but left "@tauri-apps/cli" at ^2.10.0; update the "@tauri-apps/cli"
dependency in package.json to match the upgraded API (e.g., ^2.11.0), then
reinstall dependencies (npm/yarn/pnpm) to refresh lockfiles and ensure the JS
CLI and the `@tauri-apps/api/plugins` (like "@tauri-apps/api",
"@tauri-apps/plugin-shell", "@tauri-apps/plugin-sql", etc.) are in sync.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: f4bf8a13-d836-41b7-97f9-5b5c8d995621

📥 Commits

Reviewing files that changed from the base of the PR and between 8880cda and e2e68e2.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • package.json
  • src-tauri/Cargo.toml
  • src-tauri/src/enums/error.rs
  • src-tauri/src/enums/hardware.rs
  • src-tauri/src/enums/settings.rs
  • src-tauri/src/lib.rs
  • src-tauri/src/models/hardware.rs
  • src/features/settings/hooks/useSettingsAtom.ts
  • src/hooks/useColorTheme.test.ts
  • src/rspc/bindings.ts
  • src/types/result.ts

Comment thread src/rspc/bindings.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Tauri / Specta ecosystem and regenerates the frontend bindings to match tauri-specta rc.24, along with a few wire-format/type adjustments needed to keep the Rust↔TS boundary consistent.

Changes:

  • Bumped Tauri-related Rust and npm dependencies and updated generated src/rspc/bindings.ts output/runtime.
  • Moved the Result<T, E> helper type out of generated bindings into src/types/result.ts and updated frontend imports.
  • Adjusted wire types/serde derives (notably ProcessInfo usage fields + settings enums) and aligned the theme naming used in tests/bindings.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types/result.ts Defines shared Result<T,E> and helper type guards independent of generated bindings.
src/rspc/bindings.ts Regenerated tauri-specta bindings + runtime helpers (commands/events/types).
src/hooks/useColorTheme.test.ts Updates theme test expectations to use sky.
src/features/settings/hooks/useSettingsAtom.ts Switches Result import to src/types/result.ts while continuing to use generated commands/types.
src-tauri/src/models/hardware.rs Updates Specta wire types for ProcessInfo usage fields (string formatting).
src-tauri/src/lib.rs Updates TS bindings export invocation for the newer tauri-specta output.
src-tauri/src/enums/settings.rs Refactors settings enums to derive Serialize (and renames theme variant to Sky).
src-tauri/src/enums/hardware.rs Refactors hardware enums to derive Serialize instead of manual impls.
src-tauri/src/enums/error.rs Refactors backend error enum to derive Serialize instead of manual impl.
src-tauri/Cargo.toml Bumps Rust-side tauri-specta/specta and plugin versions.
package.json Bumps @tauri-apps/api and dialog/store plugin versions.
package-lock.json Lockfile updates to reflect bumped npm dependencies.
Cargo.lock Lockfile updates for bumped Rust dependencies (Tauri/Specta ecosystem and transitive deps).

Comment thread src/types/result.ts
Comment thread src-tauri/src/models/hardware.rs
shm11C3 added 3 commits May 5, 2026 12:01
Override tauri-specta's generated typedError helper so command failures always resolve to the Result wrapper instead of rethrowing Error instances.

Regenerate TypeScript bindings and keep the generated contract assertion referenced without re-enabling ts-nocheck.

Validation: cargo check; npm run build
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 5, 2026
Remove Deserialize from the output-only ProcessInfo wire type so its string-formatted usage fields do not imply round-trip support.

Harden the Result type guard against null and primitive inputs and add focused coverage for the helper behavior.

Validation: cargo check; cargo test -p hardware_visualizer models::hardware::tests::serialize_usage; npm run build; npx vitest run src/types/result.test.ts
@shm11C3 shm11C3 merged commit 2d0d5e6 into develop May 5, 2026
36 checks passed
@shm11C3 shm11C3 deleted the chore/update-tauri-and-specta-deps branch May 5, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration dependencies Pull requests that update a dependency file frontend hardviz_tauri

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants