Skip to content

Fix label grouping and preserve user-defined exclude states#160

Merged
ccpk1 merged 2 commits into
mainfrom
issue-label-filtering
Jun 1, 2026
Merged

Fix label grouping and preserve user-defined exclude states#160
ccpk1 merged 2 commits into
mainfrom
issue-label-filtering

Conversation

@ccpk1
Copy link
Copy Markdown
Owner

@ccpk1 ccpk1 commented Jun 1, 2026

This pull request introduces significant improvements to how chore labels are handled, normalized, and filtered throughout the ChoreOps dashboard and backend. The main focus is to ensure labels are consistently represented as objects with both id and name fields, support case-insensitive filtering, and improve label grouping and display logic. These changes enhance the reliability of label-based filtering and grouping, especially when labels may be stored as either strings or objects.

Label normalization and filtering improvements:

  • All label lists (pref_exclude_label_list, pref_label_display_order) are now consistently lowercased for case-insensitive filtering and ordering in context_v1.yaml.
  • In prepare_groups_v1.yaml, chores' labels are normalized into a structure containing both lowercased terms (for filtering) and display names, allowing robust exclusion and grouping regardless of the label format (string or mapping).
  • Label exclusion and display order logic now uses lowercased comparisons and ensures only valid, non-excluded labels are used for grouping and display. [1] [2]

Backend label handling updates:

  • The sensor backend now stores and exposes chore labels as lists of {id, name} objects rather than plain strings, supporting both display and filtering needs in the dashboard. [1] [2] [3] [4]
  • The extra_state_attributes method now exposes the raw label list for compatibility, while the dashboard-facing attributes use the normalized label objects. [1] [2]

Other logic adjustments:

  • The dashboard no longer forcibly excludes certain states (completed, etc.) from pref_exclude_states in context_v1.yaml, giving more control to user preferences.
  • Minor logic tweaks ensure that label grouping and filtering are robust to empty or malformed label lists, and improve the consistency of label handling throughout the dashboard code.

These changes collectively make label-based features more reliable, flexible, and user-friendly across both backend and frontend components.

ccpk1 added 2 commits June 1, 2026 20:11
What changed:

Normalize chore labels as {id, name} for dashboard rendering
Fix Jinja grouping logic so label filters and grouped label buttons work again
Remove the redundant label_details export
Why:

Preserves the single labels payload shape while restoring label grouping and filtering behavior
@ccpk1 ccpk1 self-assigned this Jun 1, 2026
@ccpk1 ccpk1 added bug Something is not working area: integration Integration logic and state area: dashboard Dashboard UI and template behavior labels Jun 1, 2026
@ccpk1 ccpk1 merged commit 4441196 into main Jun 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: dashboard Dashboard UI and template behavior area: integration Integration logic and state bug Something is not working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant