ux: group device filter list by home, remove two-step home_ids filter - #2922
Closed
jingyulong wants to merge 4 commits into
Closed
ux: group device filter list by home, remove two-step home_ids filter#2922jingyulong wants to merge 4 commits into
jingyulong wants to merge 4 commits into
Conversation
The cloud device filter step mixed devices from every home into one flat multi-select, with a confusing two-step "home_ids" filter that required submitting the form twice. Users routinely imported devices from shared homes by accident. - Render one multi-select per home, keyed home__<home name>, with devices that have no home grouped under "Default Home" - Remove the home_ids two-step filter from the form - Merge all home__* groups back into did_list on submit (both the config and options flows) - Add tests for the grouped schema and the submit merge Wording fixes for the filter step are in PR al-one#2920.
- Devices without a home assignment (nearby/offline devices) are no longer shown in a synthetic 'Default Home' group - Keep the exclude/include labels and filter_did description in sync with PR al-one#2920
- Replace the flat cv.multi_select (inline checkbox list) with selector.SelectSelector(multiple, mode=dropdown) so each home group renders as a standard dropdown with removable chips - Drop the redundant filter_did field description; fold the "checking none includes all" warning into the step description - Label home-less devices as "Unassigned devices (nearby/offline)" via a static translation key, placed after the real homes
The HA frontend renders multi_select fields automatically: groups with fewer than 6 options as checkboxes and larger groups as dropdowns (SHOW_ALL_ENTRIES_LIMIT in ha-form-multi_select), so the explicit SelectSelector(dropdown) is redundant.
Author
|
Superseded by #2920 — the same commits are now on that PR (single PR for both the wording clarification and the grouped-by-home redesign). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes discussion in #2921.
Problem
The cloud device filter step mixed devices from every home into one flat multi-select, with a two-step
home_idsfilter that required submitting the form twice. Users routinely imported devices from shared homes by accident (see #2921 for the full story).Changes
get_cloud_filter_schema(via_did): render one multi-select per home, keyedhome__<home name>; devices without a home go underDefault Home; the flatdid_listfield and the two-stephome_idsfield are removed from the formhome__*groups back intodid_liston submitVerification
tests/test_cloud_filter_grouped.py(3 cases: grouped schema, preserved selection, submit merge)Screenshots
Open as draft per the discussion-first plan in #2921 — happy to adapt (e.g. keep
home_idsas an optional extra) if preferred.