-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
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
Change todo move API to reference previous uid #102795
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
# Prepare items for moving | ||
previous_uid: str | None = None | ||
if dst_idx is not None: | ||
previous_uid = uids[dst_idx] |
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.
Can we make the previous uid a test parameter instead?
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.
We don't know it until it is created since uids are created on the fly. We could seed with a fixed database, or mock out uid creation deep in the library, though my thought is that might be too tight of a coupling with an internal detail. However ical does this for it's own tests so there are some util hooks for that.
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 was replying for ical though same techniques could be used across both)
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.
Hmm ok. I guess it's ok like this then.
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.
Looks good if we add a note about the meaning of previous uid and when it's None.
Can be merged when the frontend PR is approved. |
@MartinHjelmare Frontend PR approved and merged. |
Proposed change
Change todo move API to reference previous uid so that the frontend can sort items without worrying about the ordering for complete vs needs-action items.
This is a partial revert to the original API in #100019 and #102627 with some additional simplifications, so it should be re-reviewed.
This is a breaking change for the todo api, but should be save since it has not been released yet.
This PR needs a frontend PR approved before merge: home-assistant/frontend#18410
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: