feat(editor): derive target_section dropdown from section meta map#280
Open
TheDave94 wants to merge 1 commit into
Open
feat(editor): derive target_section dropdown from section meta map#280TheDave94 wants to merge 1 commit into
TheDave94 wants to merge 1 commit into
Conversation
The custom-card editor's target_section dropdown was hardcoded to the five canonical sections (custom_cards/overview/areas/weather/energy). That meant any new section type (plants, agenda, vacuums, etc.) couldn't receive a custom card via the editor — users had to hand-edit YAML. Switch the source of truth to _sectionMeta, the same Map already populated for the section-order panel. New sections automatically appear in target_section dropdowns without any further editor changes.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
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>
Author
|
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>
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.
Summary
The custom-card editor's `target_section` dropdown was hardcoded to the five canonical sections:
```ts
(['custom_cards', 'overview', 'areas', 'weather', 'energy'] as const).map(...)
```
Switch it to derive options from `_sectionMeta` — the same `Map<SectionKey, { icon, labelKey }>` already used for the section-order panel.
Why
If/when a new section type is added (plants, agenda, vacuums, todos, maintenance — any of the bundled PRs in #270, or future additions), the hardcoded list silently excludes it. Users wanting to target a custom card at a new section have to hand-edit YAML, which violates the editor-driven principle.
After this change, any section registered in `_sectionMeta` automatically appears in the dropdown. Single source of truth.
Test plan
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.