[PR #7707] fix(desktop): add missing StoreExt import and fix unused mut warning #12484

Closed
opened 2026-02-16 18:17:23 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7707

State: closed
Merged: Yes


Summary

Fixes #7706

This PR resolves compilation errors in the desktop app caused by a missing trait import.

Changes

  • Added missing use tauri_plugin_store::StoreExt; import (line 19)
  • Fixed unused mut warning on window_builder by adding #[allow(unused_mut)] attribute
  • Properly scoped macOS-specific window configuration with braces to preserve conditional compilation

Problem

The desktop app failed to compile with three E0599 errors:

error[E0599]: no method named `store` found for struct `AppHandle<R>`

This occurred at lines 98, 111, and 254 where .store() was called on AppHandle.

Additionally, there was an unused mut warning on window_builder since it's only mutated on macOS.

Solution

  1. StoreExt import: According to the tauri-plugin-store documentation, the StoreExt trait must be in scope to use the .store() method on AppHandle.

  2. Conditional compilation: The window_builder is declared as mut with #[allow(unused_mut)] since it's only mutated within the #[cfg(target_os = "macos")] block. The macOS-specific configuration is properly scoped with braces to ensure the conditional compilation applies to the entire block, not just the first line.

Verification

Compilation succeeds with Rust 1.90.0+ after applying this fix
All TypeScript checks pass
Solution confirmed against official tauri-plugin-store documentation
macOS-specific window configuration correctly scoped to prevent applying on other platforms

The fix is minimal, focused, and follows both the official Tauri plugin usage pattern and Rust conditional compilation best practices.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7707 **State:** closed **Merged:** Yes --- ## Summary Fixes #7706 This PR resolves compilation errors in the desktop app caused by a missing trait import. ## Changes - Added missing `use tauri_plugin_store::StoreExt;` import (line 19) - Fixed unused `mut` warning on `window_builder` by adding `#[allow(unused_mut)]` attribute - Properly scoped macOS-specific window configuration with braces to preserve conditional compilation ## Problem The desktop app failed to compile with three E0599 errors: ``` error[E0599]: no method named `store` found for struct `AppHandle<R>` ``` This occurred at lines 98, 111, and 254 where `.store()` was called on `AppHandle`. Additionally, there was an unused `mut` warning on `window_builder` since it's only mutated on macOS. ## Solution 1. **StoreExt import**: According to the [tauri-plugin-store documentation](https://docs.rs/tauri-plugin-store/latest/tauri_plugin_store/trait.StoreExt.html), the `StoreExt` trait must be in scope to use the `.store()` method on `AppHandle`. 2. **Conditional compilation**: The `window_builder` is declared as `mut` with `#[allow(unused_mut)]` since it's only mutated within the `#[cfg(target_os = "macos")]` block. The macOS-specific configuration is properly scoped with braces to ensure the conditional compilation applies to the entire block, not just the first line. ## Verification ✅ Compilation succeeds with Rust 1.90.0+ after applying this fix ✅ All TypeScript checks pass ✅ Solution confirmed against official tauri-plugin-store documentation ✅ macOS-specific window configuration correctly scoped to prevent applying on other platforms The fix is minimal, focused, and follows both the official Tauri plugin usage pattern and Rust conditional compilation best practices.
yindo added the pull-request label 2026-02-16 18:17:23 -05:00
yindo closed this issue 2026-02-16 18:17:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12484