Skip to content

Conversation

@jerome-benoit
Copy link
Contributor

@jerome-benoit jerome-benoit commented Jan 10, 2026

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.

Fixes anomalyco#7706

- Add missing 'use tauri_plugin_store::StoreExt' import to enable .store() method on AppHandle
- Fix unused_mut warning on window_builder by using variable shadowing for macOS config

The StoreExt trait must be in scope to use the .store() method on AppHandle.
Without this import, compilation fails with E0599 errors at lines 98, 111, and 254.
Copilot AI review requested due to automatic review settings January 10, 2026 21:07
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a compilation error in the desktop app caused by a missing StoreExt trait import and addresses an unused mut warning on the window_builder variable.

Changes:

  • Added use tauri_plugin_store::StoreExt; import to enable .store() method calls on AppHandle
  • Removed mut from window_builder and used variable shadowing for macOS-specific configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 319 to 323
#[cfg(target_os = "macos")]
{
window_builder = window_builder
.title_bar_style(tauri::TitleBarStyle::Overlay)
.hidden_title(true);
}
let window_builder = window_builder
.title_bar_style(tauri::TitleBarStyle::Overlay)
.hidden_title(true);
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The conditional compilation directive #[cfg(target_os = "macos")] is only applied to the line immediately following it. In the original code, it guarded a block containing the window_builder reassignment. By removing the braces, the macOS-specific title bar style and hidden title configuration will now be applied on all platforms (Windows, Linux, etc.), not just macOS. This will cause incorrect window styling on non-macOS platforms. The braces should be retained to properly scope the conditional compilation, or the #[cfg(target_os = "macos")] directive needs to be applied to each method call individually.

Copilot uses AI. Check for mistakes.
The previous fix incorrectly removed braces around the macOS-specific
window configuration, causing #[cfg(target_os = "macos")] to only
apply to the let binding. This would have caused the title bar style
and hidden title settings to be applied on all platforms.

This commit:
- Restores the braces to properly scope the conditional block
- Adds #[allow(unused_mut)] to suppress the warning since window_builder
  is only mutated on macOS

Fixes review feedback on PR anomalyco#7707
@jerome-benoit
Copy link
Contributor Author

Thanks for catching that! You're absolutely right - removing the braces broke the conditional compilation scope. I've fixed this in commit 8a65111 by:

  1. Restoring the braces to properly scope the #[cfg(target_os = "macos")] block
  2. Making window_builder mutable with #[allow(unused_mut)] since it's only mutated on macOS

The macOS-specific title bar configuration now correctly applies only on macOS platforms.

@adamdotdevin adamdotdevin merged commit f882cca into anomalyco:dev Jan 10, 2026
6 checks passed
@jerome-benoit jerome-benoit deleted the fix/desktop-storeext-import branch January 13, 2026 00:11
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.

fix(desktop): missing StoreExt import causes compilation errors

2 participants