-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust schedule helper UI with minute granularity #21073
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
this.hass!.localize( | ||
"ui.dialogs.helper_settings.schedule.edit_schedule_block" | ||
) | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
)} | |
scrimClickAction | |
escapeKeyAction | |
)} |
This will prevent it from closing when clicking outside the dialog and using escape to close.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this keeps the edit time popup open on escape, the escape key still dismisses the more-info window underneath it, so I'm not sure if that's an improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parent modal "ha-more-info" then needs both escapeKeyAction and scrimClickAction set to a boolean, depending if the child modal is open. Looking in how this can be done, it's not that easy and straight forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this is a general preexisting issue, as any dialog from the more-info (like options flow) also allows dismissing the more-info underneath it with Escape. (scrim click seems to work as expected though)
The documentation makes a mention of a "schedule event" which I would slightly prefer over "schedule block". |
)} | ||
> | ||
<div> | ||
<ha-form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// offtopic
We should really just add a default form-dialog
that you only pass a schema and data 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had something like this started in one of my changes I previously worked on but never committed... maybe I'll go see if I can find it.
Proposed change
When selecting items in the schedule helper, offer ability to adjust with minute-granularity.
Some caveats:
adjusting individual blocks doesn't really do any error checking, this is delegated to when the user ultimately clicks update in more-info and we get the backend response for invalid settings (end < start, or overlapping blocks). I could duplicate the error checking but not sure if it is necessary. Timegrid seems to handle this all fine so it doesn't break the UI and is easily recoverable.
Pressing
Escape
in the edit block dialog closes both that and the more-info at the same time, which is not desired, but I didn't discover a way to prevent it (didn't look that hard though).Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
Summary by CodeRabbit
New Features
Updates