When to use this skill
ALWAYS use this skill when the user mentions:
- Remembering window size and position / 记住窗口大小与位置
- StateFlags or restore behavior / StateFlags 或恢复行为
- Consistent window state across sessions / 跨会话一致窗口状态
Trigger phrases include:
- "window state", "StateFlags", "restore", "window size"
- "窗口状态", "StateFlags", "恢复", "窗口大小"
How to use this skill
- Choose StateFlags to persist size, position, and maximized state
- Enable window-state plugin in the app setup
- Restore window state at startup with correct timing
- Validate multi-display behavior and scaling differences
Outputs
- Window restore plan / 窗口恢复方案
- StateFlags and timing checklist / StateFlags 与时机清单
Scope
- Boundary: Window-state plugin usage only
- Key points: StateFlags and restore timing
References
- https://v2.tauri.app/llms.txt
- https://v2.tauri.app/plugin/window-state/
- https://v2.tauri.app/zh-cn/plugin/window-state/
Keywords
tauri window state, StateFlags, restore, window size
Common pitfalls (Gotchas)
- Version compatibility: Note the compatibility of framework versions and dependency libraries; APIs may differ across versions
- Configuration file format: Configuration file format errors are the most common issue; it is recommended to use the editor's syntax checking
- Environment variables: Ensure all necessary environment variables are set correctly, and do not hardcode sensitive information
- Dependency conflicts: When multiple versions coexist, watch out for dependency conflicts and use a lock file to pin versions
- Performance pitfalls: In large data volume scenarios, pay attention to performance optimization and avoid common issues such as N+1 queries
Usage workflow
Step 1: Environment preparation
Ensure the development environment has the necessary dependencies and tools installed.
Step 2: Configuration initialization
Perform basic configuration according to project requirements.
Step 3: Using core features
Implement the core features according to the sample code.
Step 4: Test verification
Run tests to ensure the functionality works properly.
Step 5: Deployment and release
After development is complete, proceed with deployment and monitoring.