Files
Sprimo/issues/issue3.md
2026-02-14 13:21:56 +08:00

2.9 KiB

Title

sprimo-tauri settings window invoke errors for sprite-pack switch and always-on-top toggle.

Severity

P1

Environment

  • OS: Windows
  • App version/build: sprimo-tauri workspace runtime
  • Renderer/backend details: Tauri UI settings pop-out window
  • Evidence screenshots:
    • issues/screenshots/issue3.png
    • issues/screenshots/issue3-b.png

Summary

When using the settings pop-out window, changing character or toggling always-on-top shows invoke argument validation errors and the action fails to apply.

Reproduction Steps

  1. Start sprimo-tauri and open tray menu Settings.
  2. Change Character selection.
  3. Toggle Always on top.
  4. Observe red error banner in settings window.

Expected Result

  • Character change applies successfully and updates active sprite pack.
  • Always-on-top toggle applies successfully and updates main window z-order state.
  • No invoke argument error appears.

Actual Result

  • Character change fails with:
    • invalid args 'packIdOrPath' for command 'set_sprite_pack'
  • Always-on-top toggle fails with:
    • invalid args 'alwaysOnTop' for command 'set_always_on_top'

Root Cause Analysis

  • Frontend invoke payload keys were sent in snake_case (pack_id_or_path, always_on_top).
  • Tauri JS invoke argument mapping for these Rust command parameter names expects camelCase keys (packIdOrPath, alwaysOnTop).
  • Because the required keys were missing from Tauri's perspective, command handlers were not run.

Fix Plan

  1. Update settings invoke payload keys to Tauri-compatible camelCase names.
  2. Add typed helper wrappers for settings invokes to centralize argument naming.
  3. Rebuild UI and run Rust compile checks.
  4. Perform runtime manual validation and capture after screenshot evidence.

Implementation Notes

Implemented in frontend/tauri-ui/src/main.tsx:

  1. Added typed invoke wrappers:
  • invokeSetSpritePack(packIdOrPath)
  • invokeSetScale(scale)
  • invokeSetVisibility(visible)
  • invokeSetAlwaysOnTop(alwaysOnTop)
  1. Updated failing settings call sites to use wrappers and camelCase payload keys.

Verification

Commands Run

  • npm --prefix frontend/tauri-ui run build
  • cargo check -p sprimo-tauri

Visual Checklist

  • Before screenshot(s): issues/screenshots/issue3.png
  • Before screenshot(s): issues/screenshots/issue3-b.png
  • After screenshot(s): issues/screenshots/issue3-after-YYYYMMDD-HHMMSS.png

Result

  • Status: Fix Implemented
  • Notes: compile/build checks pass; runtime visual verification still required.

Status History

  • 2026-02-14 00:00 - reporter - Reported - settings errors captured in issue3.png and issue3-b.png.
  • 2026-02-14 00:00 - codex - Triaged - localized to invoke argument key mismatch.
  • 2026-02-14 00:00 - codex - Fix Implemented - updated settings invoke keys to camelCase via typed wrappers.

Closure

  • Current Status: Fix Implemented
  • Close Date:
  • Owner:
  • Linked PR/commit: