Skip to content

Tuya Smart Taskbar v2.2.0

Choose a tag to compare

@Adib23704 Adib23704 released this 30 Mar 22:02
· 9 commits to master since this release

Added

  • Linux (Xubuntu) support - Full cross-platform support with Linux bundle targets (AppImage, Deb, RPM), setup script, and PNG tray icon. (#1)
  • Non-disruptive menu updates - Auto-refresh now updates device states in-place without closing the open context menu. Check marks toggle in real-time while browsing the tray menu.
  • "Refresh Devices" menu item - Manual refresh option in both the device menu and error menu, allowing users to retry after transient failures.
  • Offline device feedback - Shows "No devices found" or "All N device(s) offline" in the tray menu when no online devices are available.
  • Biome linter/formatter - Added biome.json configuration and lint/format/validate npm scripts for frontend code quality.
  • SVG accessibility - All decorative SVGs now include aria-hidden="true" for accessibility compliance.

Fixed

  • Update checker used string comparison instead of semver - commands/app.rs now reuses the proper is_newer_version() from update.rs instead of naive != comparison.
  • Update checker had no HTTP timeout - Previously created reqwest::Client::new() with no timeout; now reuses the 10s-timeout client from update.rs.
  • Invalid tar.gz bundle target - Removed from tauri.conf.json (not a valid Tauri v2 target), which was causing build failures.
  • Poisoned RwLock panics - All .unwrap() calls on RwLock in ConfigManager replaced with .unwrap_or_else(|p| p.into_inner()) to gracefully handle poisoned locks.
  • Atomic ordering too weak in token manager - Changed Ordering::Relaxed to Ordering::SeqCst for consecutive_failures and last_failure_time atomics for proper cross-task synchronization.
  • Double read-lock on update state - update_tray_menu previously acquired the update_state read lock twice in sequence; consolidated into a single acquisition.

Changed

  • Menu item IDs are now stable - Boolean toggles use toggle:{deviceId}:{code} format (handler reads current state from cache). Enum values use set:{deviceId}:{code}:{value}. This enables in-place updates without menu reconstruction.
  • Shared HTTP client - TuyaClient and TokenManager now share a single reqwest::Client instance instead of creating separate ones.
  • Platform-neutral language - Updated "Windows Taskbar App" to "System tray app" across Cargo.toml, package.json, config.html, and about.html.
  • Node.js version in setup script - Updated from Node.js 18 (EOL) to Node.js 22 LTS.
  • Removed dead code - Eliminated unused should_check_for_update(), get_update_info(), CHECK_INTERVAL, and last_check field from update.rs. Removed duplicate UpdateInfo struct and hardcoded URL from commands/app.rs.
  • Derived PartialEq - TuyaValue and TuyaDeviceStatus now derive PartialEq, replacing ~35 lines of manual comparison code.

Technical Details

  • Introduced MenuItemRegistry (Arc<RwLock<HashMap<String, CheckMenuItem>>>) for in-place menu item state updates via set_checked()
  • Added is_structural_change() to detect when device set or status codes change (triggers full rebuild) vs value-only changes (in-place update)
  • Added update_menu_items_in_place() for real-time boolean, integer, and string status updates without menu reconstruction
  • Toggle handler provides immediate visual feedback by updating registry + cache right after successful API call
  • Clippy-clean: fixed redundant_closure, collapsible_else_if, needless_borrows_for_generic_args, manual_is_multiple_of
  • Biome-clean: tab indentation, single quotes, noDescendingSpecificity disabled for inline HTML styles