uttrflow / uttrflow/uttrflow-swift

[P2] Apply the idle grip setting to the floating button without requiring relaunch

Open
#820 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
4
Forks
17
Avg merge
3h 32m
Merged PRs (30d)
277

Description

Changing “Shrink it to a grip until I point at it” updates Settings, but the running floating button retains the value read at launch. The switch therefore cannot expand or collapse the idle button as requested until the app is relaunched.

### Evidence

Reviewed main `5c310667cd35c44abd8bbd26c19b0905471287b4`. This is a source-path finding; the full app interaction has not been executed.

- `SettingsEditor` handles `.shrinksToGripWhenIdle`, and the settings view model sends the updated settings to `AppDelegate.settingsChanged`.
- [Sources/Uttrflow/AppDelegate.swift:601](https://github.com/uttrflow/uttrflow-swift/blob/5c310667cd35c44abd8bbd26c19b0905471287b4/Sources/Uttrflow/AppDelegate.swift#L601) calls `dock.setShrinksToGrip(settings.shrinksToGripWhenIdle)` only in `wireInterface()`. That method is called from application startup.
- [Sources/Uttrflow/AppDelegate.swift:1708](https://github.com/uttrflow/uttrflow-swift/blob/5c310667cd35c44abd8bbd26c19b0905471287b4/Sources/Uttrflow/AppDelegate.swift#L1708) stores new settings and updates the shortcut, anchor and floating button visibility, but never updates the grip setting or calls `wireInterface()`.
- [Sources/Uttrflow/Dock/DockPanelController.swift:144](https://github.com/uttrflow/uttrflow-swift/blob/5c310667cd35c44abd8bbd26c19b0905471287b4/Sources/Uttrflow/Dock/DockPanelController.swift#L144) is the setter for `model.shrinksToGrip`; the view reads that retained model value when choosing its idle presentation.

### Reproduction to cover

Launch with the floating button enabled and grip shrinking enabled. Move the pointer away from the button, turn the grip option off in Settings, then leave the button idle again. The current wiring leaves shrinking enabled. Test the reverse transition too. Relaunch loads the changed preference.

### Acceptance criteria

Apply this preference to the existing dock when settings change. Add an integration test that changes the setting after initial wiring and checks the dock's effective idle presentation in both directions. Preserve the hover behavior.

`DeadSwitchTests.everyToggleReachesSomething` only searches for a field reference anywhere in Sources; the startup reference makes it pass despite the missing live update. Keep the behavior test at the application wiring boundary.

Checked existing open and closed issues and open PRs. #686 concerns screen placement, not applying this preference.

Contributor guide

Open the contributing guide

Research direction

Read AppDelegate.swift around wireInterface() and settingsChanged, then inspect DockPanelController.swift around the setter for model.shrinksToGrip. Add an integration test at the application wiring boundary that changes the setting after initial wiring and verifies the dock’s idle presentation in both directions while preserving hover behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, swift
Domain
desktop, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.