Repository navigation
Replies: 1 comment
|
The BehaviorSettingsViewModel looks like a false positive to me? But the SnapAreaSettingsViewModel one was not, and I've put in a fix for it. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! While reviewing Rectangle 2.0.2 (109), I noticed two paths where loading preferences appears to write values back to storage. This is a static code observation; I have not reproduced it in the UI.
BehaviorSettingsViewModel.reloadFromDefaults() assigns doubleClickTitleBar as a Boolean. Its didSet calls handleDoubleClickTitleBarToggle(), which saves maximize whenever the value is true. Since configImported triggers this reload, an imported custom action appears to be replaced with maximize without the user changing the toggle.
Source:
Rectangle/Rectangle/SettingsWindow/BehaviorSettingsViewModel.swift
Line 241 in c0ae7f8
SnapAreaViewModel.syncDefaults() converts footprintAnimationDurationMultiplier into the animateFootprint Boolean. Its didSet writes either 0.75 or 0.0 back to the preference. A custom positive value such as 0.3 therefore appears to become 0.75 when the model synchronizes.
Source:
Rectangle/Rectangle/SettingsWindow/SnapAreaSettingsView.swift
Line 96 in c0ae7f8
Could you confirm whether these writes during loading are intentional? Separating state loading from user-triggered persistence, or suppressing writes while synchronizing, would appear to preserve the custom values.
Thank you!
All reactions