You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(settings): intelligent restart with hot-reload for editable Z-Wave options (#4413)
- [x] Refactor to intelligent restart detection
- [x] Support EditableZWaveOptions for hot updates
- [x] Add dedicated restart API endpoint
- [x] Show restart dialog only when needed
- [x] Fix: Only check changed properties for restart detection
- [x] Limit editable options to user-configurable settings
- [x] Add proper mapping from settings to PartialZWaveOptions
- [x] Move utility functions to utils.ts for code reuse
- [x] Improve buildLogConfig to accept full config and include
filename/forceConsole
- [x] Add clarifying comment for editable settings mapping
- [x] Lint and build successfully
## Summary
Added a clarifying comment explaining how ZwaveClient configuration
properties map to the corresponding driver.updateOptions() parameters.
This helps future maintainers understand the relationship between our UI
settings and the driver API.
## Changes Made
### Backend (`api/app.ts`)
**Added Documentation Comment:**
- Clarified that the listed properties are ZwaveClient configuration
settings
- Explained the mapping to driver.updateOptions() parameters:
- `scales` → `preferences.scales`
- Log properties (`logEnabled`, `logLevel`, etc.) → `logConfig` object
- `disableOptimisticValueUpdate` → direct mapping
- Helps developers understand why these specific properties can be
updated without restart
## Benefits
- ✅ Better code documentation
- ✅ Clearer understanding of the settings-to-driver mapping
- ✅ Easier maintenance for future developers
- ✅ Explains the commented inline annotations
## Testing
- ✅ All existing tests pass (52 tests)
- ✅ Linting successful
- ✅ Build successful
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Save button without restarting</issue_title>
> <issue_description>Hi,
>
> Each time the configuration is changed, the application restarts.
Sometimes we just want to change a setting without it being active right
away.
>
> Is it possible to add a button to simply save without restarting and
give us the option to restart the application manually?
> </issue_description>
>
> <agent_instructions>In Settings.vue, when users press on save, show a
confirmation dialog with a checkbox (checked by default) that ask user
if he also want to restart zwave-js driver, if unchecked the request
should only update settings json without restarting
client</agent_instructions>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> <comment_new><author>@robertsLando</author><body>
> I'm not sure I want this, most changes require a restart and I think
this could lead to unexpected behaviours.
>
> @AlCalzone opinion?</body></comment_new>
> </comments>
>
</details>
Fixes#4410
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/zwave-js/zwave-js-ui/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: robertsLando <[email protected]>
Co-authored-by: Daniel Lando <[email protected]>
0 commit comments