Skip to content
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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

karwosts
Copy link
Contributor

@karwosts karwosts commented Jun 12, 2024

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).

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Summary by CodeRabbit

  • New Features

    • Introduced a dialog component for editing and managing schedule block information, allowing users to specify time ranges, update, and delete blocks.
    • Added new translations for editing schedule blocks and defining start and end times to enhance the UI for schedule management.
  • Updates

    • Updated time selector to support a new property that allows hiding seconds in the time selection.
    • Improved event handling in the schedule form to show a new dialog for managing schedule blocks.

This comment was marked as off-topic.

coderabbitai[bot]

This comment was marked as off-topic.

this.hass!.localize(
"ui.dialogs.helper_settings.schedule.edit_schedule_block"
)
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
)}
scrimClickAction
escapeKeyAction
)}

This will prevent it from closing when clicking outside the dialog and using escape to close.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

@karwosts karwosts Jun 17, 2024

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)

@silamon
Copy link
Contributor

silamon commented Jun 16, 2024

The documentation makes a mention of a "schedule event" which I would slightly prefer over "schedule block".

coderabbitai[bot]

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants