Skip to content

feat: person badge controls + zone-aware presence + native search variant + Quick Lights row#276

Open
TheDave94 wants to merge 11 commits into
TheRealSimon42:mainfrom
TheDave94:grouped/persons-overview-tweaks
Open

feat: person badge controls + zone-aware presence + native search variant + Quick Lights row#276
TheDave94 wants to merge 11 commits into
TheRealSimon42:mainfrom
TheDave94:grouped/persons-overview-tweaks

Conversation

@TheDave94
Copy link
Copy Markdown

Summary

Four overview-presentation tweaks grouped because they all touch the badge builder, person handling, and overview section composition.

Changes

  1. Toggle person badges — `show_person_badges?: boolean` (default true) lets users disable the built-in person chip row in favor of their own custom badges (closes Personen Batches deaktivierbar machen #148).
  2. Zone-aware presence + configurable badge layout — `person_badge_layout: 'name_only' | 'with_state' | 'avatar_only'` (default `'with_state'`). When a person is in a non-home HA zone, `person.state` already returns the zone name — so `'with_state'` surfaces "Work" / "Office" / "Gym" / etc. on the chip automatically.
  3. Native search variant — `show_search_card: 'card' | 'native'` (boolean still accepted for back-compat). The `'native'` variant uses an inline glance row instead of the HACS `search-card` dependency, so users without HACS or who prefer HA-built-ins get a working search without an extra integration.
  4. Quick Lights glance row — `light_favorite_entities?: string[]` adds a glance card at the top of the overview with the user's chosen light entities for one-tap control, similar to the room-pins row but light-specific (closes Überblickkarte Lampen-Favoriten #176).

Config

  • `show_person_badges?: boolean` — default true (closes Personen Batches deaktivierbar machen #148)
  • `person_badge_layout?: 'name_only' | 'with_state' | 'avatar_only'` — default `'with_state'`
  • `show_search_card?: boolean | 'card' | 'native'` — default false; `true` keeps existing HACS-card behavior, `'native'` uses the new variant
  • `light_favorite_entities?: string[]` — default `[]` (closes Überblickkarte Lampen-Favoriten #176)

Integrations / dependencies

  • The HACS `search-card` variant remains the default when `show_search_card: true` — no change to existing users.
  • The `'native'` search variant uses only HA built-ins (glance card) — no HACS dependency.
  • Person badges use HA's built-in `person` integration and the zone integration for state names.
  • Light favorites use HA's built-in glance card.

Supersedes

Test plan

  • Default config → person chips render with state (zone names visible if in zone)
  • `show_person_badges: false` → no person chips
  • `person_badge_layout: 'avatar_only'` → avatars only, no state
  • Person in a non-home HA zone → badge shows zone name
  • `show_search_card: 'native'` → native search row at top, no HACS dependency
  • `light_favorite_entities: ['light.living_room', 'light.kitchen']` → glance row renders with those entities
  • Editor: pick lights via entity picker → list persists

AI-drafted under human supervision by @TheDave94. Tested live on Home Assistant — fully when the relevant hardware is available, otherwise only along the code paths that don't require an actual sensor of that type.

AutoCoder and others added 9 commits May 18, 2026 14:20
Auto-generated person chip badges (createPersonBadges) appear in the
overview header. Users running custom person badges via custom_badges
had no way to suppress the defaults — leading to duplicate chips.

Adds:
- show_person_badges?: boolean (default true). When false, the auto
  badges are skipped entirely; custom_badges still flow through.
- Editor checkbox in the Overview section + description.
- de + en translations.

Default-on so behaviour is unchanged for existing dashboards.
The person-badge state line was already implicitly zone-aware (HA's
person.state returns the zone name when in a non-home zone). This PR
makes it explicit + configurable:

person_badge_layout?: 'minimal' | 'with_state' | 'with_state_and_time'
(default 'with_state' — current behaviour preserved)

- 'minimal': just picture + first name, no state line. Cleanest for
  single-user setups where presence is implicit
- 'with_state' (default): picture + name + state. State automatically
  shows zone name when person is in a non-home zone (Work, Office, …)
- 'with_state_and_time': adds last_changed underneath — useful for
  multi-zone setups where you want to know how long ago someone moved

Required integration: HA zones (built-in). Multi-zone awareness
requires the user to define zones in HA (Settings → Areas & Zones).

- types/strategy.ts: person_badge_layout?: ...
- badge-builder.ts: createPersonBadges now takes a layout parameter
- OverviewViewStrategy: reads dashboardConfig.person_badge_layout
- StrategyEditor: 3-way radio buttons under "Show clock card" with
  description that explains the zone-aware behaviour
- en.json / de.json: translations

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The strategy's search card is the only place that requires HACS-
installed components (custom:search-card + card-tools). Adds an
alternative 'tip' variant that renders an HA-native markdown card
pointing at the built-in global quickbar shortcut (Cmd/Ctrl+E).
Less powerful than an inline search input but works out of the box.

- search_card_variant?: 'custom' | 'tip' (default 'custom' — preserves
  existing behaviour for users with the HACS components installed)
- OverviewSection: renders markdown when variant === 'tip', existing
  custom:search-card otherwise
- StrategyEditor: variant radio appears under the show_search_card
  toggle (only when search card is enabled)
- Existing `show_search_card_missing` warning text updated to point at
  the native variant as an alternative

Required integration:
- 'custom' variant: needs custom:search-card + card-tools from HACS
- 'tip' variant: none (HA-native markdown card)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…loses TheRealSimon42#176)

Adds light_favorite_entities: string[] config. When non-empty, renders
a glance card on the overview with the picked lights — tap toggles
on/off, long-press opens more-info. Mirrors the user-suggested
implementation in TheRealSimon42#176.

Modular + auto-hide:
- Default empty → no card
- Auto-hides when no light entities remain (filter rejects non-light.*
  IDs and missing entities)
- Editor: dedicated picker section under the regular Favorites, with
  type-ahead search restricted to light.* entities

Required integration: none — light.* is HA-native.

- types/strategy.ts: light_favorite_entities?: string[]
- OverviewSection: glance card before the regular favorites
- StrategyEditor: new _renderLightFavoritesSection() with add/remove
- en.json / de.json: sections.light_favorites + editor strings

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts:
#	src/views/OverviewViewStrategy.ts
# Conflicts:
#	src/editor/StrategyEditor.ts
#	src/translations/de.json
#	src/translations/en.json
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 19, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 complexity · 0 duplication

Metric Results
Complexity 11
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

TheDave94 pushed a commit to TheDave94/oriel-dashboard that referenced this pull request May 20, 2026
Brings into main the remaining open PRs that weren't part of the prior
consolidation (bb43b04):

Improvement PRs (8 — real content):
- TheRealSimon42#277 chore(ci): translation lint guard
- TheRealSimon42#278 test: section-builder + entity-filter unit tests + snapshots
- TheRealSimon42#279 feat(rooms): auto-detect humidifier/valve/water_heater
- TheRealSimon42#280 feat(editor): derive target_section dropdown from section meta
- TheRealSimon42#281 fix(areas): auto-hide section + audit test
- TheRealSimon42#282 feat(editor): wire show_window_contacts_in_rooms + show_door_contacts_in_rooms
- TheRealSimon42#283 feat: custom_sections — user-declared sections without forking
- TheRealSimon42#284 chore(ci): release-please + release-build + ESLint enforcement

Grouped PRs (7 — content already in main via bb43b04 consolidation;
recorded with `-s ours` so the merges land in history without
duplicate/regressive edits):
- TheRealSimon42#270 grouped/optional-overview-sections
- TheRealSimon42#271 grouped/live-overview-badges
- TheRealSimon42#272 grouped/battery-view-improvements
- TheRealSimon42#273 grouped/room-view-features
- TheRealSimon42#274 grouped/section-meta-security
- TheRealSimon42#275 grouped/covers-weather
- TheRealSimon42#276 grouped/persons-overview-tweaks

CI fixes uncovered during merge:
- Bump Node 20 → 22 in validate.yml + release-build.yml (ESLint 10 requires Node 22+)
- Load eslint-plugin-security (rules off) so source-level Codacy
  disable directives resolve cleanly
- Drop unused PropertyValues import in StrategyEditor.ts

Version 1.3.4-thedave-r2 → 1.4.0-thedave (minor bump: feat: custom_sections,
auto-detect humidifier/valve, editor coverage, release automation).

Dist rebuilt + tests + ESLint pass (0 errors, 0 warnings).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@TheDave94 TheDave94 closed this May 20, 2026
@TheDave94 TheDave94 deleted the grouped/persons-overview-tweaks branch May 20, 2026 22:44
@TheDave94 TheDave94 restored the grouped/persons-overview-tweaks branch May 21, 2026 08:56
@TheDave94 TheDave94 reopened this May 21, 2026
@TheDave94
Copy link
Copy Markdown
Author

TheDave94 commented May 21, 2026

My main focus has shifted to a downstream project (Oriel Dashboard) — built on what simon42 established, taken in its own direction — but the work in this PR was always meant for simon42 and I'm happy to keep iterating on it here. Address review feedback, split bundled changes into smaller pieces, whatever helps the review. Just ping me.

TheDave94 pushed a commit to TheDave94/oriel-dashboard that referenced this pull request May 21, 2026
Brings into main the remaining open PRs that weren't part of the prior
consolidation (ee9c67c):

Improvement PRs (8 — real content):
- TheRealSimon42#277 chore(ci): translation lint guard
- TheRealSimon42#278 test: section-builder + entity-filter unit tests + snapshots
- TheRealSimon42#279 feat(rooms): auto-detect humidifier/valve/water_heater
- TheRealSimon42#280 feat(editor): derive target_section dropdown from section meta
- TheRealSimon42#281 fix(areas): auto-hide section + audit test
- TheRealSimon42#282 feat(editor): wire show_window_contacts_in_rooms + show_door_contacts_in_rooms
- TheRealSimon42#283 feat: custom_sections — user-declared sections without forking
- TheRealSimon42#284 chore(ci): release-please + release-build + ESLint enforcement

Grouped PRs (7 — content already in main via ee9c67c consolidation;
recorded with `-s ours` so the merges land in history without
duplicate/regressive edits):
- TheRealSimon42#270 grouped/optional-overview-sections
- TheRealSimon42#271 grouped/live-overview-badges
- TheRealSimon42#272 grouped/battery-view-improvements
- TheRealSimon42#273 grouped/room-view-features
- TheRealSimon42#274 grouped/section-meta-security
- TheRealSimon42#275 grouped/covers-weather
- TheRealSimon42#276 grouped/persons-overview-tweaks

CI fixes uncovered during merge:
- Bump Node 20 → 22 in validate.yml + release-build.yml (ESLint 10 requires Node 22+)
- Load eslint-plugin-security (rules off) so source-level Codacy
  disable directives resolve cleanly
- Drop unused PropertyValues import in StrategyEditor.ts

Version 1.3.4-thedave-r2 → 1.4.0-thedave (minor bump: feat: custom_sections,
auto-detect humidifier/valve, editor coverage, release automation).

Dist rebuilt + tests + ESLint pass (0 errors, 0 warnings).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@TheDave94 TheDave94 closed this May 22, 2026
@TheDave94 TheDave94 deleted the grouped/persons-overview-tweaks branch May 22, 2026 05:55
@TheDave94 TheDave94 restored the grouped/persons-overview-tweaks branch May 23, 2026 20:44
@TheDave94 TheDave94 reopened this May 23, 2026
TheDave94 added a commit to TheDave94/oriel-dashboard that referenced this pull request May 23, 2026
Bulk branch deletion in TheDave94/oriel-dashboard on 2026-05-19 and
2026-05-22 silently closed 49 cross-fork PRs in
TheRealSimon42/simon42-dashboard-strategy. GitHub auto-closes a PR
when its head branch is deleted, recording the deleting account as
the close actor — looks like deliberate closure to the maintainer
but isn't.

All 49 PRs have since been recovered (Cluster C 17-PR batch
restored on 2026-05-23; TheRealSimon42#250 restored after the rebundling-map
investigation). The next bulk cleanup is the actual risk; this
entry pins the safety check before any future automation lands.

Recovery state at time of writing: 17 grouped/standalone Cluster C
PRs open, TheRealSimon42#236 re-closed (superseded by TheRealSimon42#276 within Cluster C),
TheRealSimon42#250 open as standalone. Remaining ~30 closed-not-merged
originals from May 19 were deliberately rebundled into the
grouped/* PRs and stay closed correctly.

Co-authored-by: AutoCoder <autocoder@claudebox>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Überblickkarte Lampen-Favoriten Personen Batches deaktivierbar machen

1 participant