Improve UX for statistics data correction by streamlining dialog flows#30162
Improve UX for statistics data correction by streamlining dialog flows#30162a-bit-of-coding wants to merge 9 commits intohome-assistant:devfrom
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Streamline the process of fixing multiple values by improving the open/close behavior of date pickers and input dialogs.
31d85ef to
cb7f7f4
Compare
|
Would it be better if we just didn't close the datapoint selection dialog after a data edit? |
I would prefer to keep the current behavior (closing the input dialog). In my opinion, it aligns better with the established UI patterns in "Development Statistic Edit" in Home Assistant, where the input dialog usually closes after submission. Changing this might confuse users who expect the task to be finished. Additionally, keeping it open would actually increase the total number of clicks for users who want to edit a multiple datapoints. |
|
I'm fine if we do still want to close both dialogs when the 2nd dialog submits, but I am just genuinely curious how you think the suggestion would "increase clicks to edit multiple datapoints". It seems like to me it is less. |
Sorry. I thought you mean the Input Dialog. |
src/panels/config/developer-tools/statistics/dialog-statistics-adjust-sum.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
86761f2 to
8cf6630
Compare
There was a problem hiding this comment.
Pull request overview
Updates the Developer Tools → Statistics “adjust sum” dialog behavior in the Home Assistant frontend, focusing on post-adjust flow and dialog actions.
Changes:
- Adds a helper to reset the selected statistic and refresh displayed statistics after an adjustment.
- Changes the footer Close button to close the dialog via a click handler instead of declarative
data-dialog="close". - Ensures
_busyis cleared after a successful sum adjustment.
You can also share your feedback on Copilot code review. Take the survey.
src/panels/config/developer-tools/statistics/dialog-statistics-adjust-sum.ts
Outdated
Show resolved
Hide resolved
src/panels/config/developer-tools/statistics/dialog-statistics-adjust-sum.ts
Outdated
Show resolved
Hide resolved
…avior The method was renamed to _resetSelectionAndRefreshStatisticData because it clears the selection and fetches new data instead of closing a dialog.
src/panels/config/developer-tools/statistics/dialog-statistics-adjust-sum.ts
Outdated
Show resolved
Hide resolved
src/panels/config/developer-tools/statistics/dialog-statistics-adjust-sum.ts
Outdated
Show resolved
Hide resolved
Consolidates state management by using a finally block in _fixIssue.
Removed closeDialog method in favor of data-dialog="close".
| public closeDialog(): void { | ||
| this._open = false; |
There was a problem hiding this comment.
Why is closeDialog() removed?
Currently, correcting multiple sequential data points in the developer tools is tedious because the edit dialog closes entirely after each individual adjustment. This requires the user to re-open the dialog and re-select the date and time for every single entry, leading to a high amount of redundant clicks.
Proposed change
This PR refactors the interaction logic of the statistics correction dialogs to improve usability for bulk edits:
Screenshots
before:

after:

Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
To help with the load of incoming pull requests: