Skip to content

feat(app): remember settings between launches - #72

Merged
dungngminh merged 2 commits into
mainfrom
feat/app-settings-persist
Oct 16, 2026
Merged

dungngminh merged 2 commits into
mainfrom
feat/app-settings-persist

Conversation

@dungngminh

@dungngminh dungngminh commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Description

The desktop app now remembers its settings between launches: stream layout, headless mode, grid recording quality, Slim mode, and each device's stream options (frame and scrcpy resolution, frame rate, bit rate, show touches, stay awake, screen off).

  • Saved to ~/.simutil/desktop-settings.json, separate from the CLI's settings.yaml and state.json.
  • Loaded at startup, written on every change; a missing or corrupt file falls back to defaults.
  • Tests cover load/save round trips for every option and the corrupt-file fallback.

Type of Change

  • 🔥 New feature (non-breaking change which adds functionality)
  • ✨ Enhancement (non-breaking change which improves existing functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • 🧹 Code refactor
  • 📝 Documentation
  • 🗑️ Chore
  • 📦 Build configuration change
  • ✅ Test

Summary by CodeRabbit

  • New Features
    • App settings now persist between launches, including stream layout, headless mode, grid recording quality, Slim mode, and per-device stream options.
    • If saved settings are missing or invalid, the app uses default settings.

@dungngminh dungngminh added the feature Features ✨ label Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 14f5cb00-acf0-4157-93b2-992b1eaa09f9
📥 Commits

Reviewing files that changed from the base of the PR and between 472e1f8 and 154dad4.

📒 Files selected for processing: 7
  • app/CHANGELOG.md
  • app/lib/src/devices/slim_mode_cubit.dart
  • app/lib/src/di.dart
  • app/lib/src/settings/desktop_settings_store.dart
  • app/lib/src/settings/device_settings_cubit.dart
  • app/lib/src/settings/view_settings_cubit.dart
  • app/test/desktop_settings_store_test.dart
+--------------------------------------------------+
| Brb...ordering more GPUs. CPUs are so last year. |
+--------------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from feat/app-update-check to main October 16, 2026 17:15
View settings, per-device stream options and Slim mode are saved to
~/.simutil/desktop-settings.json, separate from the CLI's settings.yaml
and state.json. A missing or corrupt file falls back to defaults.
@dungngminh
dungngminh force-pushed the feat/app-settings-persist branch from 6034d50 to 154dad4 Compare October 16, 2026 17:17
@dungngminh
dungngminh merged commit 311c1e6 into main Oct 16, 2026
6 of 7 checks passed
@dungngminh
dungngminh deleted the feat/app-settings-persist branch October 16, 2026 17:20
// Write then rename: quitting mid-save never leaves half a file.
final tmp = File('$_path.tmp');
await tmp.writeAsString(json, flush: true);
await tmp.rename(_path);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Settings changes silently stop persisting on Windows after the first save

File.rename over an existing destination fails on Windows (Win32 MoveFileW does not replace an existing file). $_path is created by the first successful save, so every later tmp.rename(_path) throws, is swallowed by the catch, and only debugPrinted — subsequent settings changes are lost on Windows and never survive a restart.

Delete the destination before renaming (ignoring a missing-file error), or write to a uniquely-named temp file and replace atomically.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
app/lib/src/settings/desktop_settings_store.dart 73 Settings changes silently stop persisting on Windows after the first save (File.rename fails over an existing destination on Windows)
Files Reviewed (7 files)
  • app/CHANGELOG.md
  • app/lib/src/devices/slim_mode_cubit.dart
  • app/lib/src/di.dart
  • app/lib/src/settings/desktop_settings_store.dart
  • app/lib/src/settings/device_settings_cubit.dart
  • app/lib/src/settings/view_settings_cubit.dart
  • app/test/desktop_settings_store_test.dart

Fix these issues in Kilo Cloud


Reviewed by free · Input: 86.8K · Output: 32.7K · Cached: 86.7K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Features ✨

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant