Skip to content

Home Information - Your home, your data, organized.

Python

CollectionView interaction-intent model + panel ROW/TILE rename (#341)

Tony Cd7d2d0e67c9d
diff --git a/docs/dev/frontend/entity-state-panels.md b/docs/dev/frontend/entity-state-panels.md
index 49b4e19b..b98921c1 100644
--- a/docs/dev/frontend/entity-state-panels.md
+++ b/docs/dev/frontend/entity-state-panels.md
@@ -68,7 +68,7 @@ from hi.apps.entity.state_panel_base import EntityStatePanel
panel = EntityStatePanel(
name = 'thermostat_single_setpoint',
entity_type = EntityType.THERMOSTAT,
- display_contexts = { DisplayContext.MODAL, DisplayContext.LIST, DisplayContext.GRID },
+ display_contexts = { DisplayContext.MODAL, DisplayContext.ROW, DisplayContext.TILE },
priority = 20,
required_roles = {
EntityStateRole.THERMOSTAT_CURRENT_TEMPERATURE,
@@ -95,17 +95,73 @@ Every `EntityStateRole` declared in `required_roles` or `optional_roles` is the
Extras — roles on the entity outside the panel's declared set — are framework-owned. The panel template does not see them.
-## Display contexts and extras
+## Display contexts
-| `DisplayContext` | Extras behavior |
-|---|---|
-| `MODAL` | Framework auto-appends an expandable **"Other states"** section below the panel chrome whenever extras exist. Renders each extra row using the existing fallback `state_row.html`. |
-| `LIST` | Framework ignores extras silently. |
-| `GRID` | Framework ignores extras silently. |
+The framework defines three `DisplayContext` values. They name **shape** — the per-author design budget — not consumer layout. CollectionView and other consumers map their own layout choices to these contexts; the panel author thinks in shape budgets and authors a template per context the panel chooses to handle.
+
+| `DisplayContext` | Shape | Design budget | Extras behavior |
+|---|---|---|---|
+| `MODAL` | Roomy, unbounded height | ~480–640px wide, height grows with content | Framework auto-appends an expandable **"Other states"** section below the panel chrome whenever extras exist; renders each extra row using fallback `state_row.html`. |
+| `TILE` | Square-ish, gridable | 240–280 wide × 200–260 tall target; 200 × 200 min; ~320 max wide; aspect 1:1 to 5:4 | Framework ignores extras silently. |
+| `ROW` | Wide, single horizontal strip | full container width × ~80px tall target; 56 min / 128 max height; aspect ≥ 4:1 | Framework ignores extras silently. |
+
+Modal-context invariant: **every `EntityState` on an entity is reachable in the modal view, always.** Either the active panel handles it (declared role) or the framework surfaces it (extra). Authors cannot opt out.
+
+TILE and ROW are compact-by-intent; extras are intentionally invisible there to keep card layouts tight. Users who want to see every state open the modal.
+
+### Size-budget CSS variables
+
+Budgets are documented and shared via CSS variables so panel CSS and wrapper layout reference the same numbers:
+
+```css
+--hi-panel-tile-min-size: 200px;
+--hi-panel-tile-target-size: 240px;
+--hi-panel-tile-max-size: 320px;
+--hi-panel-row-min-height: 56px;
+--hi-panel-row-target-height: 80px;
+--hi-panel-row-max-height: 128px;
+```
+
+**Enforcement is soft.** No `max-width` / `max-height` clamping by the framework. Panel authors who exceed budgets see content visibly cramped or sliding; the feedback loop is immediate. Wrappers use `auto-fit` + `minmax(var(--hi-panel-tile-min-size), 1fr)` for TILE grids and `flex-direction: column` for ROW lists — column count follows from container width without JS.
+
+### Template filename convention
+
+By convention each context's template is named for the context:
+
+```
+state_panels/<name>/modal.html
+state_panels/<name>/row.html
+state_panels/<name>/tile.html
+```
+
+Filename is not enforced — `panel.template_name` names the template explicitly per panel declaration. The convention exists for navigation.
+
+## CollectionView integration
+
+CollectionView consumes the panel framework through four `CollectionViewType` values, parallel to `LocationViewType`:
+
+| `CollectionViewType` | Panel content | Click |
+|---|---|---|
+| `DEFAULT` | none — icon + name only; framework dispatch is **skipped** | whole card → entity status/edit modal |
+| `GRID` | panels rendered in `TILE` context | whole card → modal |
+| `LIST` | panels rendered in `ROW` context | whole card → modal |
+| `SECURITY` | panels rendered in `TILE` context | whole card → modal (aspirational placeholder paralleling `LocationViewType.SECURITY`; no distinct behavior today) |
+
+`DEFAULT` is the primary case. Most entities in a typical install are information-only items (manuals, warranties, plant care notes) — no states, no controllers, just editable attributes. For these, the collection is a clickable index; rendering a panel adds nothing useful. Collections with integration-backed entities opt into `GRID` / `LIST` / `SECURITY` for richer surfacing.
+
+`GRID` and `SECURITY` render identically today; they differ only as user-facing labels (and as scaffolding for future cross-view SECURITY semantics that haven't been designed yet).
+
+### Whole-card click contract
+
+In every CollectionView mode, the entire card is the click target — wrapped in an `<a>` to the status modal. **Controllers within a card must consume their own clicks** so taps on a slider / checkbox / button don't bubble to the wrapping `<a>` and trigger the modal:
+
+- **JS handlers**: call `event.stopPropagation()` (and `preventDefault()` where relevant) inside controller click / change handlers.
+- **CSS**: nothing special — `<input>` / `<button>` elements stop click propagation naturally on most browsers, but explicit `stopPropagation` in handlers is the safer guarantee.
+- **Touch-target sizing**: controllers must be **≥44pt** on the smallest side (Apple HIG; ~48dp Material) so finger taps land squarely on the controller and not the background card.
-This produces a framework-level invariant for the modal context: **every `EntityState` on an entity is reachable in the modal view, always.** Either the active panel handles it (declared role) or the framework surfaces it (extra). Authors cannot opt out — the contract belongs to the user.
+Panels with controllers in their ROW / TILE templates carry the responsibility for both. Panels without controllers (smoke detector, plain camera) have no extra work — every card-pixel routes to the modal.
-Grid and list are compact-by-intent; extras are intentionally invisible there to keep card layouts tight. Users who want to see every state open the modal.
+Edit mode overrides all of this: when `request.view_parameters.is_editing` is set, JS intercepts card clicks and opens the entity edit pane regardless of the wrapper `<a>`'s `href`. This behavior is owned by the collection app, not by panels.
## Template authoring
@@ -218,7 +274,7 @@ Append `?debug_panel=1` to any view that renders an entity status panel to see t
5. Tag refreshable elements per the polling-update contract (see [`entity-status-display.md`](entity-status-display.md)).
6. Drop panel-private CSS and JS in `src/hi/static/state_panels/<name>/` if needed.
7. Register any panel JS handlers via `Hi.statePanels.registerInit` / `registerUpdate`.
-8. Verify in the simulator: open the entity status modal, change values on the simulator side, watch the panel refresh; open a collection containing the entity and check the list and grid contexts. If the panel doesn't render where expected, hit the URL with `?debug_panel=1` and check the resolution trace.
+8. Verify in the simulator: open the entity status modal, change values on the simulator side, watch the panel refresh; open a collection containing the entity and check the ROW and TILE contexts (CollectionViewType LIST and GRID, respectively). If the panel doesn't render where expected, hit the URL with `?debug_panel=1` and check the resolution trace.
## Exemplars
@@ -237,4 +293,6 @@ Read the existing panels when starting a new one — copy from the closest match
- **Don't render extras inside the panel.** The modal context auto-appends an "Other states" section for any role outside the panel's declared set. Panels that try to render unknown states inside their own chrome will duplicate them.
- **Declare what you display, display what you declare.** If a role appears in `required_roles` or `optional_roles`, the template must render it (subject to `{% if %}` for optionals). If a role is rendered but not declared, the framework will still treat it as an "extra" and may surface it twice in modal.
- **Don't branch a template by `DisplayContext`.** If the panel needs context-specific layout, split into separate declarations with their own templates rather than `{% if context == ... %}` inside one file.
+- **Controllers must stop click propagation.** CollectionView wraps every card in an `<a>` to the entity modal. Sliders / checkboxes / buttons in ROW or TILE templates need to call `event.stopPropagation()` in their handlers (and meet the ≥44pt touch-target rule) so taps don't accidentally trigger the modal.
+- **Don't author for `DEFAULT` CollectionViewType.** DEFAULT collections skip the panel framework entirely — they render icon + name through the collection wrapper, not through any panel template. Panels are dispatched only for GRID, LIST, and SECURITY view types.
- **Shared partials live where they were first authored.** The flat state list and per-state row templates live under `state_panels/fallback/` (where they were born). Other panels that want the same list reference them from that path; there's no separate "shared" namespace.
diff --git a/src/hi/apps/collection/collection_manager.py b/src/hi/apps/collection/collection_manager.py
index 8eea55e1..8d612ac5 100644
--- a/src/hi/apps/collection/collection_manager.py
+++ b/src/hi/apps/collection/collection_manager.py
@@ -8,7 +8,7 @@ from hi.apps.collection.edit.forms import CollectionPositionForm
from hi.apps.common.singleton import Singleton
from hi.apps.entity.enums import DisplayContext, EntityGroupType
from hi.apps.entity.models import Entity
-from hi.apps.entity.state_panel_dispatch import StatePanelDispatcher
+from hi.apps.entity.state_panel_dispatch import EntityStatePanelData, StatePanelDispatcher
from hi.apps.location.models import Location, LocationView
from hi.apps.location.svg_item_factory import SvgItemFactory
from hi.apps.monitor.display_data import EntityDisplayData
@@ -69,22 +69,49 @@ class CollectionManager(Singleton):
entity_status_data_list = StatusDisplayManager().get_entity_status_data_list(
entities = entity_list,
)
- display_context = (
- DisplayContext.GRID if collection.collection_view_type.is_grid
- else DisplayContext.LIST
- )
- state_panel_data_list = [
- StatePanelDispatcher.build_state_panel_data(
- EntityDisplayData( entity_status_data = status_data ),
- display_context,
- )
- for status_data in entity_status_data_list
- ]
+ display_context = self._resolve_display_context( collection.collection_view_type )
+ if display_context is None:
+ # DEFAULT view skips the panel framework. Construct a minimal
+ # ``EntityStatePanelData`` (no panel template, no panel context)
+ # so the wrapper template can still read ``state_panel_data.entity``
+ # and ``state_panel_data.entity_display_data`` uniformly with the
+ # other modes.
+ state_panel_data_list = [
+ EntityStatePanelData(
+ entity_display_data = EntityDisplayData( entity_status_data = status_data ),
+ panel_template = '',
+ panel_context = {},
+ )
+ for status_data in entity_status_data_list
+ ]
+ else:
+ state_panel_data_list = [
+ StatePanelDispatcher.build_state_panel_data(
+ EntityDisplayData( entity_status_data = status_data ),
+ display_context,
+ )
+ for status_data in entity_status_data_list
+ ]
return CollectionData(
collection = collection,
state_panel_data_list = state_panel_data_list,
)
+ @staticmethod
+ def _resolve_display_context( collection_view_type ) -> 'DisplayContext':
+ """Map a ``CollectionViewType`` to the panel-framework
+ ``DisplayContext`` that drives template selection. Returns
+ ``None`` for ``DEFAULT`` (the information-index view that
+ skips the panel framework entirely)."""
+ if collection_view_type.is_default:
+ return None
+ if collection_view_type.is_list:
+ return DisplayContext.ROW
+ # GRID, GRID_LARGE, and SECURITY all use TILE — they differ
+ # only in the wrapper-level column-count budget, not in the
+ # panel template selection.
+ return DisplayContext.TILE
+
def create_collection( self, name : str ) -> Collection:
"""Create a new ``Collection`` with sensible defaults
(default collection_type, default collection_view_type,
diff --git a/src/hi/apps/collection/enums.py b/src/hi/apps/collection/enums.py
index fe918159..aeb8df3d 100644
--- a/src/hi/apps/collection/enums.py
+++ b/src/hi/apps/collection/enums.py
@@ -30,15 +30,30 @@ class CollectionType(LabeledEnum):
class CollectionViewType(LabeledEnum):
- GRID = ( 'Grid', '' )
- LIST = ( 'List', '' )
+ DEFAULT = ( 'Default', '' )
+ GRID = ( 'Grid', '' )
+ GRID_LARGE = ( 'Grid (Large)', '' )
+ LIST = ( 'List', '' )
+ SECURITY = ( 'Security', '' )
+
+ @property
+ def is_default(self):
+ return self == CollectionViewType.DEFAULT
@property
def is_grid(self):
return self == CollectionViewType.GRID
+ @property
+ def is_grid_large(self):
+ return self == CollectionViewType.GRID_LARGE
+
@property
def is_list(self):
return self == CollectionViewType.LIST
+ @property
+ def is_security(self):
+ return self == CollectionViewType.SECURITY
+
diff --git a/src/hi/apps/collection/migrations/0003_camera_collections_to_security_view.py b/src/hi/apps/collection/migrations/0003_camera_collections_to_security_view.py
new file mode 100644
index 00000000..f63754c4
--- /dev/null
+++ b/src/hi/apps/collection/migrations/0003_camera_collections_to_security_view.py
@@ -0,0 +1,34 @@
+from django.db import migrations
+
+
+def map_cameras_typed_to_security_view(apps, schema_editor):
+ Collection = apps.get_model('collection', 'Collection')
+ Collection.objects.filter(
+ collection_type_str = 'CAMERAS',
+ ).update(
+ collection_view_type_str = 'SECURITY',
+ )
+
+
+def reverse_map_security_view_to_grid(apps, schema_editor):
+ Collection = apps.get_model('collection', 'Collection')
+ Collection.objects.filter(
+ collection_type_str = 'CAMERAS',
+ collection_view_type_str = 'SECURITY',
+ ).update(
+ collection_view_type_str = 'GRID',
+ )
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('collection', '0002_alter_collection_order_id_and_more'),
+ ]
+
+ operations = [
+ migrations.RunPython(
+ map_cameras_typed_to_security_view,
+ reverse_code = reverse_map_security_view_to_grid,
+ ),
+ ]
diff --git a/src/hi/apps/collection/templates/collection/panes/collection_view.html b/src/hi/apps/collection/templates/collection/panes/collection_view.html
index 9b857414..83877b2c 100644
--- a/src/hi/apps/collection/templates/collection/panes/collection_view.html
+++ b/src/hi/apps/collection/templates/collection/panes/collection_view.html
@@ -1,37 +1,52 @@
<div id="hi-collection-view-main" class="hi-collection-view draggable-container">
<div class="h4"><small>Collection:</small> {{ collection.name }}</div>
- {% if collection.collection_view_type.is_grid %}
- <div class="collection-grid {{ collection_grid_css_class }}">
- {% for state_panel_data in state_panel_data_list %}
- <div id="{{ state_panel_data.entity.html_id }}"
- class="entity-item {{ state_panel_data.display_category.css_class }} {% if request.view_parameters.is_editing %}draggable{% endif %}"
- {% if request.view_parameters.is_editing %}draggable="true"{% endif %} >
- {% include "collection/panes/entity_card_grid.html" with state_panel_data=state_panel_data %}
- </div>
- {% endfor %}
- </div>
-
- {% else %}
+ {% if state_panel_data_list %}
- <div class="collection-list">
- {% for state_panel_data in state_panel_data_list %}
- <div id="{{ state_panel_data.entity.html_id }}"
- class="entity-row {{ state_panel_data.display_category.css_class }} {% if request.view_parameters.is_editing %}draggable{% endif %}"
- {% if request.view_parameters.is_editing %}draggable="true"{% endif %} >
- {% include "collection/panes/entity_card_list.html" with state_panel_data=state_panel_data %}
- </div>
- {% endfor %}
- </div>
+ {% if collection.collection_view_type.is_default %}
+ <div class="collection-default">
+ {% for state_panel_data in state_panel_data_list %}
+ <div id="{{ state_panel_data.entity.html_id }}"
+ class="entity-item {{ state_panel_data.display_category.css_class }} {% if request.view_parameters.is_editing %}draggable{% endif %}"
+ {% if request.view_parameters.is_editing %}draggable="true"{% endif %}>
+ {% include "collection/panes/entity_card_default.html" with state_panel_data=state_panel_data %}
+ </div>
+ {% endfor %}
+ </div>
- {% endif %}
+ {% elif collection.collection_view_type.is_list %}
+ <div class="collection-row-list">
+ {% for state_panel_data in state_panel_data_list %}
+ <div id="{{ state_panel_data.entity.html_id }}"
+ class="entity-item {{ state_panel_data.display_category.css_class }} {% if request.view_parameters.is_editing %}draggable{% endif %}"
+ {% if request.view_parameters.is_editing %}draggable="true"{% endif %}>
+ {% include "collection/panes/entity_card_row.html" with state_panel_data=state_panel_data %}
+ </div>
+ {% endfor %}
+ </div>
- {% if not state_panel_data_list %}
- <div class="alert alert-info text-center w-100">
- <div class="h4">No items in collection.</div>
- {% if not request.view_parameters.is_editing %}
- <div><em>Use <a href="{% url 'edit_start' %} ">Edit Mode</a> to add items.</em></div>
+ {% else %}
+ {# GRID, GRID_LARGE, and SECURITY dispatch panels to the TILE #}
+ {# context; the wrapper modifier class drives the column-count #}
+ {# budget. SECURITY is an aspirational placeholder, rendering #}
+ {# identically to GRID today. #}
+ <div class="collection-tile-grid{% if collection.collection_view_type.is_grid_large %} collection-tile-grid--large{% endif %}">
+ {% for state_panel_data in state_panel_data_list %}
+ <div id="{{ state_panel_data.entity.html_id }}"
+ class="entity-item {{ state_panel_data.display_category.css_class }} {% if request.view_parameters.is_editing %}draggable{% endif %}"
+ {% if request.view_parameters.is_editing %}draggable="true"{% endif %}>
+ {% include "collection/panes/entity_card_tile.html" with state_panel_data=state_panel_data %}
+ </div>
+ {% endfor %}
+ </div>
{% endif %}
- </div>
+
+ {% else %}
+ <div class="alert alert-info text-center w-100">
+ <div class="h4">No items in collection.</div>
+ {% if not request.view_parameters.is_editing %}
+ <div><em>Use <a href="{% url 'edit_start' %} ">Edit Mode</a> to add items.</em></div>
+ {% endif %}
+ </div>
{% endif %}
</div>
diff --git a/src/hi/apps/collection/templates/collection/panes/entity_card_default.html b/src/hi/apps/collection/templates/collection/panes/entity_card_default.html
new file mode 100644
index 00000000..4a500e4c
--- /dev/null
+++ b/src/hi/apps/collection/templates/collection/panes/entity_card_default.html
@@ -0,0 +1,10 @@
+{% with entity=state_panel_data.entity %}
+<div class="entity-card entity-card--default"
+ data-href="{% if request.view_parameters.is_editing %}{% url 'entity_edit_mode' entity_id=entity.id %}{% else %}{% url 'entity_status' entity_id=entity.id %}{% endif %}"
+ data-async="{% if request.view_parameters.is_editing %}true{% else %}modal{% endif %}">
+ <div class="entity-card__icon">
+ {% include "entity/panes/entity_display_only_svg_icon.html" with svg_icon_item=state_panel_data.entity_display_data.display_only_svg_icon_item %}
+ </div>
+ <div class="entity-card__name">{{ entity.name }}</div>
+</div>
+{% endwith %}
diff --git a/src/hi/apps/collection/templates/collection/panes/entity_card_grid.html b/src/hi/apps/collection/templates/collection/panes/entity_card_grid.html
deleted file mode 100644
index 6395bc9a..00000000
--- a/src/hi/apps/collection/templates/collection/panes/entity_card_grid.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{% load state_panel_tags %}
-<div class="card h-100">
- <div class="card-body p-3">
- {% include "collection/panes/entity_card_title.html" with entity_status_data=state_panel_data.entity_display_data %}
- {% if collection.collection_type.is_cameras %}
- <div>
- {% include "console/panes/entity_live_view_w_link.html" with entity=state_panel_data.entity %}
- </div>
- {% else %}
- {% include_panel state_panel_data %}
- {% endif %}
- </div>
-</div>
diff --git a/src/hi/apps/collection/templates/collection/panes/entity_card_list.html b/src/hi/apps/collection/templates/collection/panes/entity_card_list.html
deleted file mode 100644
index 1b7c0198..00000000
--- a/src/hi/apps/collection/templates/collection/panes/entity_card_list.html
+++ /dev/null
@@ -1,19 +0,0 @@
-{% load state_panel_tags %}
-<div class="card h-100">
- <div class="card-body">
- <div class="d-flex">
- <div class="entity-title-section flex-shrink-0">
- {% include "collection/panes/entity_card_title.html" with entity_status_data=state_panel_data.entity_display_data %}
- </div>
- {% if collection.collection_type.is_cameras %}
- <div>
- {% include "console/panes/entity_live_view_w_link.html" with entity=state_panel_data.entity %}
- </div>
- {% else %}
- <div class="entity-content-section flex-grow-1 ml-3">
- {% include_panel state_panel_data %}
- </div>
- {% endif %}
- </div>
- </div>
-</div>
diff --git a/src/hi/apps/collection/templates/collection/panes/entity_card_row.html b/src/hi/apps/collection/templates/collection/panes/entity_card_row.html
new file mode 100644
index 00000000..d00abeb4
--- /dev/null
+++ b/src/hi/apps/collection/templates/collection/panes/entity_card_row.html
@@ -0,0 +1,8 @@
+{% load state_panel_tags %}
+{% with entity=state_panel_data.entity %}
+<div class="entity-card entity-card--row"
+ data-href="{% if request.view_parameters.is_editing %}{% url 'entity_edit_mode' entity_id=entity.id %}{% else %}{% url 'entity_status' entity_id=entity.id %}{% endif %}"
+ data-async="{% if request.view_parameters.is_editing %}true{% else %}modal{% endif %}">
+ {% include_panel state_panel_data %}
+</div>
+{% endwith %}
diff --git a/src/hi/apps/collection/templates/collection/panes/entity_card_tile.html b/src/hi/apps/collection/templates/collection/panes/entity_card_tile.html
new file mode 100644
index 00000000..69d31709
--- /dev/null
+++ b/src/hi/apps/collection/templates/collection/panes/entity_card_tile.html
@@ -0,0 +1,8 @@
+{% load state_panel_tags %}
+{% with entity=state_panel_data.entity %}
+<div class="entity-card entity-card--tile"
+ data-href="{% if request.view_parameters.is_editing %}{% url 'entity_edit_mode' entity_id=entity.id %}{% else %}{% url 'entity_status' entity_id=entity.id %}{% endif %}"
+ data-async="{% if request.view_parameters.is_editing %}true{% else %}modal{% endif %}">
+ {% include_panel state_panel_data %}
+</div>
+{% endwith %}
diff --git a/src/hi/apps/collection/templates/collection/panes/entity_card_title.html b/src/hi/apps/collection/templates/collection/panes/entity_card_title.html
deleted file mode 100644
index a7b3c6ad..00000000
--- a/src/hi/apps/collection/templates/collection/panes/entity_card_title.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{% with entity=entity_status_data.entity %}
-{# Collection cards show only a subset of state (per the state panel #}
-{# declaration); the full status modal mirrors what LocationView #}
-{# clicks open. Edit-mode clicks fall through to the per-entity #}
-{# inline edit view as before. #}
-<a href="{% if request.view_parameters.is_editing %}{% url 'entity_edit_mode' entity_id=entity_status_data.entity.id %}{% else %}{% url 'entity_status' entity_id=entity_status_data.entity.id %}{% endif %}"
- data-async="{% if request.view_parameters.is_editing %}true{% else %}modal{% endif %}">
-
- <div class="d-flex justify-content-start">
- <div class="display-only-svg-icon pr-2">
- {% include "entity/panes/entity_display_only_svg_icon.html" with svg_icon_item=entity_status_data.display_only_svg_icon_item %}
- </div>
- <div>
- {{ entity.name }}
- </div>
- </div>
-</a>
-{% endwith %}
diff --git a/src/hi/apps/collection/tests/test_enums.py b/src/hi/apps/collection/tests/test_enums.py
index e4f648bc..373614ff 100644
--- a/src/hi/apps/collection/tests/test_enums.py
+++ b/src/hi/apps/collection/tests/test_enums.py
@@ -56,31 +56,40 @@ class TestCollectionViewType(BaseTestCase):
self.assertTrue(grid_collection.collection_view_type.is_grid)
self.assertTrue(list_collection.collection_view_type.is_list)
- def test_all_collection_view_types_support_required_ui_modes(self):
- """Test CollectionViewType completeness - ensures UI can handle all types."""
- # Every view type must be classifiable as either grid or list for UI rendering
- unclassified_types = []
- ambiguous_types = []
-
+ def test_each_view_type_has_exactly_one_classification(self):
+ """Every CollectionViewType value must classify as exactly one
+ of the is_* properties so consumers can dispatch on a single
+ property without ambiguity."""
for view_type in CollectionViewType:
- is_grid = view_type.is_grid
- is_list = view_type.is_list
-
- # Each type must be exactly one classification
- if not (is_grid or is_list):
- unclassified_types.append(view_type)
- elif is_grid and is_list:
- ambiguous_types.append(view_type)
-
- # No view types should be unclassified or ambiguous
- self.assertEqual(unclassified_types, [],
- f"View types missing classification: {unclassified_types}")
- self.assertEqual(ambiguous_types, [],
- f"View types with ambiguous classification: {ambiguous_types}")
-
- # Verify we have both grid and list types available
- grid_types = [vt for vt in CollectionViewType if vt.is_grid]
- list_types = [vt for vt in CollectionViewType if vt.is_list]
-
- self.assertGreater(len(grid_types), 0, "No grid view types available")
- self.assertGreater(len(list_types), 0, "No list view types available")
+ classifications = [
+ view_type.is_default,
+ view_type.is_grid,
+ view_type.is_grid_large,
+ view_type.is_list,
+ view_type.is_security,
+ ]
+ true_count = sum( 1 for c in classifications if c )
+ self.assertEqual(
+ true_count, 1,
+ f'{view_type} has {true_count} true classifications; expected exactly 1',
+ )
+
+ def test_default_view_type_is_classified(self):
+ collection = Collection.objects.create(
+ name = 'Info Index', collection_type_str = 'OTHER',
+ collection_view_type_str = 'DEFAULT',
+ )
+ self.assertTrue( collection.collection_view_type.is_default )
+ self.assertFalse( collection.collection_view_type.is_grid )
+ self.assertFalse( collection.collection_view_type.is_list )
+ self.assertFalse( collection.collection_view_type.is_security )
+
+ def test_security_view_type_is_classified(self):
+ collection = Collection.objects.create(
+ name = 'Camera Watch', collection_type_str = 'CAMERAS',
+ collection_view_type_str = 'SECURITY',
+ )
+ self.assertTrue( collection.collection_view_type.is_security )
+ self.assertFalse( collection.collection_view_type.is_default )
+ self.assertFalse( collection.collection_view_type.is_grid )
+ self.assertFalse( collection.collection_view_type.is_list )
diff --git a/src/hi/apps/collection/transient_models.py b/src/hi/apps/collection/transient_models.py
index 5e58738a..5621e8a9 100644
--- a/src/hi/apps/collection/transient_models.py
+++ b/src/hi/apps/collection/transient_models.py
@@ -19,21 +19,9 @@ class CollectionData:
return {
'collection': self.collection,
'state_panel_data_list': self.state_panel_data_list,
- 'collection_grid_css_class': self.grid_css_class,
'entity_count': len(self.state_panel_data_list),
}
- @property
- def grid_css_class(self):
- if self.collection.collection_type.is_cameras:
- return 'grid-2-items'
- entity_count = len(self.state_panel_data_list)
- if entity_count >= 3:
- return 'grid-3-plus-items'
- if entity_count == 2:
- return 'grid-2-items'
- return 'grid-1-item'
-
@dataclass
class CollectionViewItem:
diff --git a/src/hi/apps/entity/enums.py b/src/hi/apps/entity/enums.py
index aee4f6e4..dd2b4afd 100644
--- a/src/hi/apps/entity/enums.py
+++ b/src/hi/apps/entity/enums.py
@@ -347,11 +347,17 @@ class EntityStateRole(LabeledEnum):
class DisplayContext(LabeledEnum):
- """For views/templates that depend on where they are being displayed."""
+ """Author-facing shape vocabulary for panel templates.
+
+ Each value names a shape the panel author designs for; consumers
+ (CollectionView, modal renderers, etc.) map their layout choices
+ onto these shapes. See ``docs/dev/frontend/entity-state-panels.md``
+ for size budgets and the CSS-variable contract.
+ """
MODAL = ( 'Modal', '' )
- LIST = ( 'List' , '' )
- GRID = ( 'Grid' , '' )
+ ROW = ( 'Row' , '' ) # wide, full-width strip; ~80px tall
+ TILE = ( 'Tile', '' ) # square-ish, gridable; 240-280 wide × 200-260 tall
class EntityStateType(LabeledEnum):
diff --git a/src/hi/apps/entity/state_panels/camera/panel.py b/src/hi/apps/entity/state_panels/camera/panel.py
index 40448676..8b8c658e 100644
--- a/src/hi/apps/entity/state_panels/camera/panel.py
+++ b/src/hi/apps/entity/state_panels/camera/panel.py
@@ -21,22 +21,22 @@ modal_panel = EntityStatePanel(
role_data_template_aliases = _ROLE_DATA_TEMPLATE_ALIASES,
)
-list_panel = EntityStatePanel(
- name = 'camera_list',
+row_panel = EntityStatePanel(
+ name = 'camera_row',
entity_type = EntityType.CAMERA,
- display_contexts = { DisplayContext.LIST },
+ display_contexts = { DisplayContext.ROW },
priority = 100,
- template_name = 'entity/state_panels/camera/list.html',
+ template_name = 'entity/state_panels/camera/row.html',
optional_roles = _OPTIONAL_ROLES,
role_data_template_aliases = _ROLE_DATA_TEMPLATE_ALIASES,
)
-grid_panel = EntityStatePanel(
- name = 'camera_grid',
+tile_panel = EntityStatePanel(
+ name = 'camera_tile',
entity_type = EntityType.CAMERA,
- display_contexts = { DisplayContext.GRID },
+ display_contexts = { DisplayContext.TILE },
priority = 100,
- template_name = 'entity/state_panels/camera/grid.html',
+ template_name = 'entity/state_panels/camera/tile.html',
optional_roles = _OPTIONAL_ROLES,
role_data_template_aliases = _ROLE_DATA_TEMPLATE_ALIASES,
)
diff --git a/src/hi/apps/entity/state_panels/fallback/panel.py b/src/hi/apps/entity/state_panels/fallback/panel.py
index 596cf8f4..6b04375f 100644
--- a/src/hi/apps/entity/state_panels/fallback/panel.py
+++ b/src/hi/apps/entity/state_panels/fallback/panel.py
@@ -10,18 +10,18 @@ modal_panel = EntityStatePanel(
template_name = 'entity/state_panels/fallback/modal.html',
)
-list_panel = EntityStatePanel(
- name = 'fallback_list',
+row_panel = EntityStatePanel(
+ name = 'fallback_row',
entity_type = None,
- display_contexts = { DisplayContext.LIST },
+ display_contexts = { DisplayContext.ROW },
priority = 1000,
- template_name = 'entity/state_panels/fallback/list.html',
+ template_name = 'entity/state_panels/fallback/row.html',
)
-grid_panel = EntityStatePanel(
- name = 'fallback_grid',
+tile_panel = EntityStatePanel(
+ name = 'fallback_tile',
entity_type = None,
- display_contexts = { DisplayContext.GRID },
+ display_contexts = { DisplayContext.TILE },
priority = 1000,
- template_name = 'entity/state_panels/fallback/grid.html',
+ template_name = 'entity/state_panels/fallback/tile.html',
)
diff --git a/src/hi/apps/entity/state_panels/smoke_detector/panel.py b/src/hi/apps/entity/state_panels/smoke_detector/panel.py
index 4959c373..4fae7459 100644
--- a/src/hi/apps/entity/state_panels/smoke_detector/panel.py
+++ b/src/hi/apps/entity/state_panels/smoke_detector/panel.py
@@ -27,23 +27,23 @@ modal_panel = EntityStatePanel(
role_data_template_aliases = _ROLE_DATA_TEMPLATE_ALIASES,
)
-list_panel = EntityStatePanel(
- name = 'smoke_detector_list',
+row_panel = EntityStatePanel(
+ name = 'smoke_detector_row',
entity_type = EntityType.SMOKE_DETECTOR,
- display_contexts = { DisplayContext.LIST },
+ display_contexts = { DisplayContext.ROW },
priority = 100,
- template_name = 'entity/state_panels/smoke_detector/list.html',
+ template_name = 'entity/state_panels/smoke_detector/row.html',
required_roles = _REQUIRED_ROLES,
optional_roles = _OPTIONAL_ROLES,
role_data_template_aliases = _ROLE_DATA_TEMPLATE_ALIASES,
)
-grid_panel = EntityStatePanel(
- name = 'smoke_detector_grid',
+tile_panel = EntityStatePanel(
+ name = 'smoke_detector_tile',
entity_type = EntityType.SMOKE_DETECTOR,
- display_contexts = { DisplayContext.GRID },
+ display_contexts = { DisplayContext.TILE },
priority = 100,
- template_name = 'entity/state_panels/smoke_detector/grid.html',
+ template_name = 'entity/state_panels/smoke_detector/tile.html',
required_roles = _REQUIRED_ROLES,
optional_roles = _OPTIONAL_ROLES,
role_data_template_aliases = _ROLE_DATA_TEMPLATE_ALIASES,
diff --git a/src/hi/apps/entity/state_panels/thermostat/panel.py b/src/hi/apps/entity/state_panels/thermostat/panel.py
index 78c61b1f..b5fcd460 100644
--- a/src/hi/apps/entity/state_panels/thermostat/panel.py
+++ b/src/hi/apps/entity/state_panels/thermostat/panel.py
@@ -44,23 +44,23 @@ modal_panel = EntityStatePanel(
role_data_template_aliases = _ROLE_DATA_TEMPLATE_ALIASES,
)
-list_panel = EntityStatePanel(
- name = 'thermostat_list',
+row_panel = EntityStatePanel(
+ name = 'thermostat_row',
entity_type = EntityType.THERMOSTAT,
- display_contexts = { DisplayContext.LIST },
+ display_contexts = { DisplayContext.ROW },
priority = 100,
- template_name = 'entity/state_panels/thermostat/list.html',
+ template_name = 'entity/state_panels/thermostat/row.html',
required_roles = _REQUIRED_ROLES,
optional_roles = _OPTIONAL_ROLES,
role_data_template_aliases = _ROLE_DATA_TEMPLATE_ALIASES,
)
-grid_panel = EntityStatePanel(
- name = 'thermostat_grid',
+tile_panel = EntityStatePanel(
+ name = 'thermostat_tile',
entity_type = EntityType.THERMOSTAT,
- display_contexts = { DisplayContext.GRID },
+ display_contexts = { DisplayContext.TILE },
priority = 100,
- template_name = 'entity/state_panels/thermostat/grid.html',
+ template_name = 'entity/state_panels/thermostat/tile.html',
required_roles = _REQUIRED_ROLES,
optional_roles = _OPTIONAL_ROLES,
role_data_template_aliases = _ROLE_DATA_TEMPLATE_ALIASES,
diff --git a/src/hi/apps/entity/templates/entity/state_panels/camera/list.html b/src/hi/apps/entity/templates/entity/state_panels/camera/row.html
similarity index 86%
rename from src/hi/apps/entity/templates/entity/state_panels/camera/list.html
rename to src/hi/apps/entity/templates/entity/state_panels/camera/row.html
index d16a911a..4d7fdc14 100644
--- a/src/hi/apps/entity/templates/entity/state_panels/camera/list.html
+++ b/src/hi/apps/entity/templates/entity/state_panels/camera/row.html
@@ -1,6 +1,6 @@
{# Aliases declared in panel.py (role_data_template_aliases): #}
{# motion_data (optional). #}
-<div class="hi-state-panel-camera hi-state-panel-camera--list">
+<div class="hi-state-panel-camera hi-state-panel-camera--row">
<div class="stream">
{% if entity.has_live_view %}
@@ -13,7 +13,7 @@
{% endif %}
</div>
- <div class="list-meta">
+ <div class="row-meta">
<div class="entity-name">{{ entity.name }}</div>
</div>
diff --git a/src/hi/apps/entity/templates/entity/state_panels/camera/grid.html b/src/hi/apps/entity/templates/entity/state_panels/camera/tile.html
similarity index 85%
rename from src/hi/apps/entity/templates/entity/state_panels/camera/grid.html
rename to src/hi/apps/entity/templates/entity/state_panels/camera/tile.html
index 6332517b..b95b1b17 100644
--- a/src/hi/apps/entity/templates/entity/state_panels/camera/grid.html
+++ b/src/hi/apps/entity/templates/entity/state_panels/camera/tile.html
@@ -1,6 +1,6 @@
{# Aliases declared in panel.py (role_data_template_aliases): #}
{# motion_data (optional). #}
-<div class="hi-state-panel-camera hi-state-panel-camera--grid">
+<div class="hi-state-panel-camera hi-state-panel-camera--tile">
<div class="stream">
{% if entity.has_live_view %}
@@ -13,7 +13,7 @@
{% endif %}
</div>
- <div class="grid-overlay">
+ <div class="tile-overlay">
<div class="entity-name">{{ entity.name }}</div>
</div>
diff --git a/src/hi/apps/entity/templates/entity/state_panels/fallback/grid.html b/src/hi/apps/entity/templates/entity/state_panels/fallback/grid.html
deleted file mode 100644
index 1233641f..00000000
--- a/src/hi/apps/entity/templates/entity/state_panels/fallback/grid.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{# Framework fallback for the collection grid card context: renders #}
-{# the entity's state list. Currently identical to the list-context #}
-{# fallback; panels wanting a denser grid layout provide their own #}
-{# grid.html. #}
-{% if state_status_data_list %}
-{% include "entity/state_panels/fallback/state_list.html" with entity_state_status_data_list=state_status_data_list %}
-{% endif %}
diff --git a/src/hi/apps/entity/templates/entity/state_panels/fallback/list.html b/src/hi/apps/entity/templates/entity/state_panels/fallback/list.html
deleted file mode 100644
index 1592e50c..00000000
--- a/src/hi/apps/entity/templates/entity/state_panels/fallback/list.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{# Framework fallback for the collection list card context: renders #}
-{# the entity's state list. The surrounding card wrapper #}
-{# (``entity_card_list.html``) supplies the entity-name title and #}
-{# the video stream (when present) above this panel body, so this #}
-{# panel only renders the per-state rows. #}
-{% if state_status_data_list %}
-{% include "entity/state_panels/fallback/state_list.html" with entity_state_status_data_list=state_status_data_list %}
-{% endif %}
diff --git a/src/hi/apps/entity/templates/entity/state_panels/fallback/row.html b/src/hi/apps/entity/templates/entity/state_panels/fallback/row.html
new file mode 100644
index 00000000..95326fd6
--- /dev/null
+++ b/src/hi/apps/entity/templates/entity/state_panels/fallback/row.html
@@ -0,0 +1,14 @@
+{# Framework fallback for the ROW context. Renders the entity's icon #}
+{# and name, plus the per-state row list when states exist. Self- #}
+{# contained so stateless entities still surface their identity. #}
+<div class="hi-state-panel-fallback hi-state-panel-fallback--row">
+ <div class="hi-state-panel-fallback__icon">
+ {% include "entity/panes/entity_display_only_svg_icon.html" with svg_icon_item=entity_status_data.display_only_svg_icon_item %}
+ </div>
+ <div class="hi-state-panel-fallback__body">
+ <div class="hi-state-panel-fallback__name">{{ entity.name }}</div>
+ {% if state_status_data_list %}
+ {% include "entity/state_panels/fallback/state_list.html" with entity_state_status_data_list=state_status_data_list %}
+ {% endif %}
+ </div>
+</div>
diff --git a/src/hi/apps/entity/templates/entity/state_panels/fallback/tile.html b/src/hi/apps/entity/templates/entity/state_panels/fallback/tile.html
new file mode 100644
index 00000000..1c110757
--- /dev/null
+++ b/src/hi/apps/entity/templates/entity/state_panels/fallback/tile.html
@@ -0,0 +1,12 @@
+{# Framework fallback for the TILE context. Renders the entity's icon #}
+{# and name, plus the per-state row list when states exist. Self- #}
+{# contained so stateless entities still surface their identity. #}
+<div class="hi-state-panel-fallback hi-state-panel-fallback--tile">
+ <div class="hi-state-panel-fallback__icon">
+ {% include "entity/panes/entity_display_only_svg_icon.html" with svg_icon_item=entity_status_data.display_only_svg_icon_item %}
+ </div>
+ <div class="hi-state-panel-fallback__name">{{ entity.name }}</div>
+ {% if state_status_data_list %}
+ {% include "entity/state_panels/fallback/state_list.html" with entity_state_status_data_list=state_status_data_list %}
+ {% endif %}
+</div>
diff --git a/src/hi/apps/entity/templates/entity/state_panels/smoke_detector/list.html b/src/hi/apps/entity/templates/entity/state_panels/smoke_detector/row.html
similarity index 96%
rename from src/hi/apps/entity/templates/entity/state_panels/smoke_detector/list.html
rename to src/hi/apps/entity/templates/entity/state_panels/smoke_detector/row.html
index 893e3d3e..8395c08a 100644
--- a/src/hi/apps/entity/templates/entity/state_panels/smoke_detector/list.html
+++ b/src/hi/apps/entity/templates/entity/state_panels/smoke_detector/row.html
@@ -1,14 +1,14 @@
{% load humanize tz %}
{# Aliases declared in panel.py (role_data_template_aliases): #}
{# smoke_data, battery_data. #}
-<div class="hi-state-panel-smoke_detector hi-state-panel-smoke_detector--list"
+<div class="hi-state-panel-smoke_detector hi-state-panel-smoke_detector--row"
data-state-id="{{ smoke_data.entity_state.id }}"
data-status
status="{{ smoke_data.svg_status_style.status_value }}">
{% include "entity/state_panels/smoke_detector/badge.html" %}
- <div class="list-meta">
+ <div class="row-meta">
<div class="entity-name">{{ entity.name }}</div>
<div class="status-label status-label--idle">All Clear</div>
<div class="status-label status-label--active">Smoke Detected</div>
diff --git a/src/hi/apps/entity/templates/entity/state_panels/smoke_detector/grid.html b/src/hi/apps/entity/templates/entity/state_panels/smoke_detector/tile.html
similarity index 98%
rename from src/hi/apps/entity/templates/entity/state_panels/smoke_detector/grid.html
rename to src/hi/apps/entity/templates/entity/state_panels/smoke_detector/tile.html
index cfcaaba7..9d160fb9 100644
--- a/src/hi/apps/entity/templates/entity/state_panels/smoke_detector/grid.html
+++ b/src/hi/apps/entity/templates/entity/state_panels/smoke_detector/tile.html
@@ -1,6 +1,6 @@
{# Aliases declared in panel.py (role_data_template_aliases): #}
{# smoke_data, battery_data. #}
-<div class="hi-state-panel-smoke_detector hi-state-panel-smoke_detector--grid"
+<div class="hi-state-panel-smoke_detector hi-state-panel-smoke_detector--tile"
data-state-id="{{ smoke_data.entity_state.id }}"
data-status
status="{{ smoke_data.svg_status_style.status_value }}">
diff --git a/src/hi/apps/entity/templates/entity/state_panels/thermostat/list.html b/src/hi/apps/entity/templates/entity/state_panels/thermostat/row.html
similarity index 99%
rename from src/hi/apps/entity/templates/entity/state_panels/thermostat/list.html
rename to src/hi/apps/entity/templates/entity/state_panels/thermostat/row.html
index 990bff21..ad2dce53 100644
--- a/src/hi/apps/entity/templates/entity/state_panels/thermostat/list.html
+++ b/src/hi/apps/entity/templates/entity/state_panels/thermostat/row.html
@@ -1,7 +1,7 @@
{# Aliases declared in panel.py (role_data_template_aliases): #}
{# current_data, target_data, low_data, high_data, #}
{# action_data, mode_data, humidity_data. #}
-<div class="hi-state-panel-thermostat hi-state-panel-thermostat--list"
+<div class="hi-state-panel-thermostat hi-state-panel-thermostat--row"
{% if action_data %}data-state-id="{{ action_data.entity_state.id }}" data-status status="{{ action_data.latest_sensor_value }}"{% endif %}
{% if mode_data %}data-hvac-mode-state-id="{{ mode_data.entity_state.id }}" data-hvac-mode="{{ mode_data.latest_sensor_value }}"{% endif %}>
@@ -42,7 +42,7 @@
</div>
</div>
- <div class="list-meta">
+ <div class="row-meta">
<div class="entity-name">{{ entity.name }}</div>
{% if low_data and high_data %}
<div class="setpoint-summary setpoint-summary--dual">
diff --git a/src/hi/apps/entity/templates/entity/state_panels/thermostat/grid.html b/src/hi/apps/entity/templates/entity/state_panels/thermostat/tile.html
similarity index 98%
rename from src/hi/apps/entity/templates/entity/state_panels/thermostat/grid.html
rename to src/hi/apps/entity/templates/entity/state_panels/thermostat/tile.html
index ef5c2b17..0ecc20bb 100644
--- a/src/hi/apps/entity/templates/entity/state_panels/thermostat/grid.html
+++ b/src/hi/apps/entity/templates/entity/state_panels/thermostat/tile.html
@@ -1,11 +1,11 @@
{# Aliases declared in panel.py (role_data_template_aliases): #}
{# current_data, target_data, low_data, high_data, #}
{# action_data, mode_data. #}
-<div class="hi-state-panel-thermostat hi-state-panel-thermostat--grid"
+<div class="hi-state-panel-thermostat hi-state-panel-thermostat--tile"
{% if action_data %}data-state-id="{{ action_data.entity_state.id }}" data-status status="{{ action_data.latest_sensor_value }}"{% endif %}
{% if mode_data %}data-hvac-mode-state-id="{{ mode_data.entity_state.id }}" data-hvac-mode="{{ mode_data.latest_sensor_value }}"{% endif %}>
- <div class="grid-temp"
+ <div class="tile-temp"
data-state-id="{{ current_data.entity_state.id }}"
data-display-text>
{{ current_data.latest_display_label }}
diff --git a/src/hi/apps/entity/tests/test_state_panel_framework.py b/src/hi/apps/entity/tests/test_state_panel_framework.py
index e77a7048..cbe9cd5f 100644
--- a/src/hi/apps/entity/tests/test_state_panel_framework.py
+++ b/src/hi/apps/entity/tests/test_state_panel_framework.py
@@ -208,11 +208,11 @@ class TestResolvePanel( BaseTestCase ):
fallback = self._register( _make_panel(
name = 'fallback',
entity_type = None,
- display_contexts = { DisplayContext.MODAL, DisplayContext.GRID },
+ display_contexts = { DisplayContext.MODAL, DisplayContext.TILE },
) )
resolution = StatePanelDispatcher.resolve_panel(
entity_type = EntityType.THERMOSTAT,
- display_context = DisplayContext.GRID,
+ display_context = DisplayContext.TILE,
present_roles = set(),
)
self.assertIs( resolution.panel, fallback )
@@ -248,7 +248,7 @@ class TestResolvePanel( BaseTestCase ):
with self.assertRaises( RuntimeError ):
StatePanelDispatcher.resolve_panel(
entity_type = EntityType.THERMOSTAT,
- display_context = DisplayContext.GRID,
+ display_context = DisplayContext.TILE,
present_roles = set(),
)
@@ -260,20 +260,20 @@ class TestProductionPanelDiscovery( BaseTestCase ):
EXPECTED_TYPED_PANELS = {
(EntityType.THERMOSTAT, DisplayContext.MODAL): 'thermostat_modal',
- (EntityType.THERMOSTAT, DisplayContext.LIST): 'thermostat_list',
- (EntityType.THERMOSTAT, DisplayContext.GRID): 'thermostat_grid',
+ (EntityType.THERMOSTAT, DisplayContext.ROW): 'thermostat_row',
+ (EntityType.THERMOSTAT, DisplayContext.TILE): 'thermostat_tile',
(EntityType.SMOKE_DETECTOR, DisplayContext.MODAL): 'smoke_detector_modal',
- (EntityType.SMOKE_DETECTOR, DisplayContext.LIST): 'smoke_detector_list',
- (EntityType.SMOKE_DETECTOR, DisplayContext.GRID): 'smoke_detector_grid',
+ (EntityType.SMOKE_DETECTOR, DisplayContext.ROW): 'smoke_detector_row',
+ (EntityType.SMOKE_DETECTOR, DisplayContext.TILE): 'smoke_detector_tile',
(EntityType.CAMERA, DisplayContext.MODAL): 'camera_modal',
- (EntityType.CAMERA, DisplayContext.LIST): 'camera_list',
- (EntityType.CAMERA, DisplayContext.GRID): 'camera_grid',
+ (EntityType.CAMERA, DisplayContext.ROW): 'camera_row',
+ (EntityType.CAMERA, DisplayContext.TILE): 'camera_tile',
}
EXPECTED_FALLBACK_PANELS = {
DisplayContext.MODAL: 'fallback_modal',
- DisplayContext.LIST: 'fallback_list',
- DisplayContext.GRID: 'fallback_grid',
+ DisplayContext.ROW: 'fallback_row',
+ DisplayContext.TILE: 'fallback_tile',
}
def test_typed_panels_resolve_with_required_roles( self ):
diff --git a/src/hi/settings/base.py b/src/hi/settings/base.py
index 0f009b18..74441eb3 100644
--- a/src/hi/settings/base.py
+++ b/src/hi/settings/base.py
@@ -256,6 +256,7 @@ PIPELINE = {
'css/attribute.css',
'css/stream-browser.css',
'css/control.css',
+ 'state_panels/fallback/fallback.css',
'state_panels/smoke_detector/smoke_detector.css',
'state_panels/camera/camera.css',
'state_panels/thermostat/thermostat.css',
diff --git a/src/hi/static/css/main.css b/src/hi/static/css/main.css
index 72a0cc0b..a3f21757 100644
--- a/src/hi/static/css/main.css
+++ b/src/hi/static/css/main.css
@@ -70,7 +70,20 @@
--on-status-ok-color: white;
--on-status-bad-color: white;
--on-status-idle-color: black;
-
+
+ /* Panel size budgets. Soft enforcement: collection wrappers reference
+ these via auto-fit/minmax for adaptive column counts; panels
+ reference them when their content scales with the budget.
+ See docs/dev/frontend/entity-state-panels.md. */
+ --hi-panel-tile-min-size: 240px;
+ --hi-panel-tile-target-size: 280px;
+ --hi-panel-tile-max-size: 360px;
+ --hi-panel-tile-large-min-size: 380px;
+ --hi-panel-row-min-height: 56px;
+ --hi-panel-row-target-height: 80px;
+ --hi-panel-row-max-height: 128px;
+ --hi-panel-default-tile-min-size: 160px;
+
}
html, body {
@@ -1716,229 +1729,133 @@ g[hover] {
min-width: 0; /* Allow text truncation if needed */
}
-/* ================================= */
-/* Collection Grid Layout */
-/* ================================= */
+/* ================================================================ */
+/* Collection layouts */
+/* ================================================================ */
+/* Three per-CollectionViewType wrappers; column counts come from */
+/* CSS auto-fit + minmax referencing the panel size budgets. */
-.collection-grid {
+.collection-tile-grid,
+.collection-default {
display: grid;
- gap: 15px;
+ gap: 16px;
margin-bottom: 1rem;
}
-
-/* Grid responsive layouts */
-.grid-1-item {
- grid-template-columns: 1fr 2fr;
-}
-
-.grid-2-items {
- grid-template-columns: 1fr 1fr;
-}
-
-.grid-3-plus-items {
- grid-template-columns: 1fr 1fr 1fr;
-}
-
-/* Card hover effects for better interaction */
-.collection-grid .card {
- transition: all 0.2s ease;
- border: 1px solid var(--line-color);
- background: var(--white);
-}
-
-.collection-grid .card:hover {
- transform: translateY(-2px);
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
- border-color: var(--primary-color);
-}
-
-/* Enhanced typography and spacing in cards */
-.collection-grid .card-body {
- padding: 1rem !important;
+.collection-tile-grid {
+ grid-template-columns: repeat(
+ auto-fit, minmax(var(--hi-panel-tile-min-size), 1fr)
+ );
}
-
-/* Grid card entity title styling */
-.collection-grid .card .entity-status-title {
- margin-bottom: 0.75rem;
- font-weight: 600;
-}
-
-.collection-grid .card .display-only-svg-icon {
- width: 2.5rem;
- height: 2.5rem;
-}
-
-/* Ensure consistent card heights in grid */
-.collection-grid .card {
- height: 100%;
- display: flex;
- flex-direction: column;
+/* GRID_LARGE bumps the minimum tile size so each tile gets more
+ * pixels; column count still adapts to container width (2 on
+ * tablet, 3 on standard desktop, 4 on wide desktop). Used when
+ * panel content benefits from larger presentation — camera streams,
+ * dial-heavy panels, etc.
+ */
+.collection-tile-grid--large {
+ grid-template-columns: repeat(
+ auto-fit, minmax(var(--hi-panel-tile-large-min-size), 1fr)
+ );
}
-
-.collection-grid .card-body {
- flex: 1;
- display: flex;
- flex-direction: column;
+.collection-default {
+ grid-template-columns: repeat(
+ auto-fit, minmax(var(--hi-panel-default-tile-min-size), 1fr)
+ );
}
-/* ================================= */
-/* Collection List Layout */
-/* ================================= */
-
-.collection-list {
+.collection-row-list {
display: flex;
flex-direction: column;
+ gap: 8px;
+ margin-bottom: 1rem;
}
-.entity-row {
- display: flex;
- align-items: flex-start;
- border-top: 1px solid var(--line-color);
- padding: 15px 0;
- transition: background-color 0.2s ease;
-}
+/* ================================================================ */
+/* Entity card wrapper */
+/* ================================================================ */
+/* The wrapper is a <div data-async data-href> click target — see */
+/* docs/dev/frontend/entity-state-panels.md for the whole-card- */
+/* click contract. */
-.entity-row:hover {
- background-color: var(--muted-bg-light);
+.entity-card {
+ display: block;
+ cursor: pointer;
+ border: 1px solid var(--line-color);
+ border-radius: 4px;
+ background: var(--white);
+ overflow: hidden;
+ transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
-
-.entity-row:first-child {
- border-top: none;
+.entity-card:hover {
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
+ border-color: var(--primary-color);
}
-/* Entity type-specific flex behavior for responsive layout */
-.entity-row .entity-title-section {
+.entity-card--default {
display: flex;
- align-items: flex-start;
- margin-right: 15px;
- min-width: 0; /* Allow shrinking */
- flex: 0 0 200px; /* Default fixed width for consistent alignment */
-}
-
-.entity-row .entity-content-section {
- flex: 1;
- min-width: 0; /* Allow shrinking */
-}
-
-/* User-defined entities get more flexible title space to reduce blank space */
-.entity-row.user-defined .entity-title-section {
- flex: 1;
- max-width: none;
+ align-items: center;
+ gap: 8px;
+ padding: 8px 12px;
}
-
-/* Sensor/controller entities maintain fixed title width for tabular consistency */
-.entity-row.sensor-controller .entity-title-section {
- flex: 0 0 200px;
+.entity-card--default .entity-card__icon {
+ width: 28px;
+ height: 28px;
+ flex-shrink: 0;
}
-
-/* Video stream entities maintain fixed title width for tabular consistency */
-.entity-row.video-stream .entity-title-section {
- flex: 0 0 200px;
+.entity-card--default .entity-card__icon svg {
+ width: 100%;
+ height: 100%;
}
-
-/* Enhanced styling for entity title display in list view */
-.entity-row .entity-title-section a {
+.entity-card--default .entity-card__name {
font-weight: 500;
color: var(--black);
- text-decoration: none;
-}
-
-.entity-row .entity-title-section a:hover {
- color: var(--primary-color);
- text-decoration: none;
-}
-
-/* Better spacing and alignment for entity state content */
-.entity-row .entity-content-section .d-flex {
- align-items: center;
- flex-wrap: wrap;
- gap: 0.5rem;
-}
-
-.entity-row .entity-content-section .text-center {
- margin-right: 1rem;
-}
-
-/* Improve typography hierarchy in list view */
-.collection-list .entity-row h6,
-.collection-list .entity-row .h6 {
- margin-bottom: 0.25rem;
- font-weight: 600;
- color: var(--black);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
-.collection-list .entity-row small {
- color: var(--muted-color);
- font-size: 0.85rem;
+.entity-card--tile {
+ min-height: var(--hi-panel-tile-min-size);
}
-/* Responsive adjustments for smaller screens */
-@media (max-width: 768px) {
- .grid-3-plus-items {
- grid-template-columns: 1fr 1fr;
- }
-
- .grid-1-item {
- grid-template-columns: 1fr;
- }
-
- .entity-row.sensor-controller .entity-title-section,
- .entity-row.video-stream .entity-title-section {
- flex: 0 0 150px;
- }
+.entity-card--row {
+ min-height: var(--hi-panel-row-min-height);
}
-@media (max-width: 576px) {
- .grid-2-items,
- .grid-3-plus-items {
- grid-template-columns: 1fr;
- }
-
- .collection-grid {
- gap: 10px;
- }
-
- .entity-row {
- flex-direction: column;
- align-items: stretch;
- }
-
- .entity-row .entity-title-section {
- margin-right: 0;
- margin-bottom: 10px;
- flex: none;
- }
+/* Edit mode: the entire card is a single click target opening the edit
+ * pane. Inner interactive elements (live-view links, controllers) are
+ * blocked at the CSS layer so panel authors don't need to gate their own
+ * click handlers on edit mode — clicks never reach the inner elements,
+ * they fall through to the card's data-async handler.
+ */
+[hi-edit="True"] .entity-card * {
+ pointer-events: none;
}
-
-/* ================================= */
-/* Drag and Drop Styling */
-/* ================================= */
-
-/* Draggable items in collection view */
-.collection-grid .draggable {
- cursor: grab;
+[hi-edit="True"] .entity-card {
+ pointer-events: auto;
}
-.collection-grid .draggable:active {
- cursor: grabbing;
-}
+/* ================================================================ */
+/* Drag and Drop Styling */
+/* ================================================================ */
-.collection-list .draggable {
+.collection-tile-grid .draggable,
+.collection-default .draggable,
+.collection-row-list .draggable {
cursor: grab;
}
-
-.collection-list .draggable:active {
+.collection-tile-grid .draggable:active,
+.collection-default .draggable:active,
+.collection-row-list .draggable:active {
cursor: grabbing;
}
-
-/* Visual feedback during drag operations */
-.collection-grid .draggable.ui-sortable-helper {
+.collection-tile-grid .draggable.ui-sortable-helper,
+.collection-default .draggable.ui-sortable-helper {
transform: rotate(2deg) scale(1.05);
z-index: 1000;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
-
-.collection-list .draggable.ui-sortable-helper {
+.collection-row-list .draggable.ui-sortable-helper {
background: var(--white);
border: 2px solid var(--primary-color);
border-radius: 4px;
diff --git a/src/hi/static/js/antinode.js b/src/hi/static/js/antinode.js
index 23151412..787e638b 100644
--- a/src/hi/static/js/antinode.js
+++ b/src/hi/static/js/antinode.js
@@ -39,9 +39,11 @@
// Basic async loading:
// <a href="/path" data-async="#target-id">Load Content</a>
// <form action="/submit" data-async="#result-area">...</form>
+// <div data-href="/path" data-async="modal">Wide click target</div>
//
// Attributes:
// data-async="{selector}" - jQuery selector for target element, or "modal" for new modal
+// data-href="{url}" - URL fallback for non-anchor elements where ``href`` is not valid HTML5
// data-mode="insert" - (default) Replace inner HTML of target
// data-mode="replace" - Replace entire target element
// data-hide="{selector}" - Hide elements when triggered
@@ -453,7 +455,10 @@ function asyncClickHandler(event) {
$mode = 'insert';
}
- let url = $anchor.attr('href');
+ // ``href`` is the standard source. ``data-href`` is the fallback
+ // for elements where ``href`` is not valid HTML5 (e.g. a ``<div
+ // data-async>`` wrapper used as a wide click target).
+ let url = $anchor.attr('href') || $anchor.attr('data-href');
if ( $anchor.attr('data-params') ) {
url += '?' + $anchor.attr('data-params');
}
diff --git a/src/hi/static/state_panels/camera/camera.css b/src/hi/static/state_panels/camera/camera.css
index e5e0e73c..44d7e2e1 100644
--- a/src/hi/static/state_panels/camera/camera.css
+++ b/src/hi/static/state_panels/camera/camera.css
@@ -81,18 +81,18 @@
/* List card layout */
/* ============================================================== */
-.hi-state-panel-camera--list {
+.hi-state-panel-camera--row {
display: grid;
grid-template-columns: 160px 1fr;
gap: 12px;
align-items: center;
}
-.hi-state-panel-camera--list .stream {
+.hi-state-panel-camera--row .stream {
width: 160px;
aspect-ratio: 16 / 9;
}
-.hi-state-panel-camera--list .list-meta { min-width: 0; }
-.hi-state-panel-camera--list .entity-name {
+.hi-state-panel-camera--row .row-meta { min-width: 0; }
+.hi-state-panel-camera--row .entity-name {
font-size: 13px; font-weight: 600; line-height: 1.2;
}
@@ -100,16 +100,16 @@
/* Grid card layout — video fills, name overlay along the bottom. */
/* ============================================================== */
-.hi-state-panel-camera--grid {
+.hi-state-panel-camera--tile {
position: relative;
width: 100%;
height: 100%;
}
-.hi-state-panel-camera--grid .stream {
+.hi-state-panel-camera--tile .stream {
width: 100%;
height: 100%;
}
-.hi-state-panel-camera--grid .grid-overlay {
+.hi-state-panel-camera--tile .tile-overlay {
position: absolute;
bottom: 0;
left: 0;
@@ -118,7 +118,7 @@
background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.75) 100%);
color: white;
}
-.hi-state-panel-camera--grid .entity-name {
+.hi-state-panel-camera--tile .entity-name {
font-size: 11px;
font-weight: 600;
line-height: 1.2;
@@ -174,8 +174,8 @@
}
/* Smaller chip in compact contexts. */
-.hi-state-panel-camera--list .motion-chip,
-.hi-state-panel-camera--grid .motion-chip {
+.hi-state-panel-camera--row .motion-chip,
+.hi-state-panel-camera--tile .motion-chip {
width: 24px;
height: 24px;
top: 4px;
diff --git a/src/hi/static/state_panels/fallback/fallback.css b/src/hi/static/state_panels/fallback/fallback.css
new file mode 100644
index 00000000..eb8e66e7
--- /dev/null
+++ b/src/hi/static/state_panels/fallback/fallback.css
@@ -0,0 +1,55 @@
+/* Framework fallback panel for ROW and TILE contexts. Renders entity
+ * icon + name plus an optional state list — self-contained so the
+ * collection-card wrapper does not need to add any chrome of its own.
+ */
+
+.hi-state-panel-fallback__icon {
+ width: 32px;
+ height: 32px;
+ flex-shrink: 0;
+}
+.hi-state-panel-fallback__icon svg {
+ width: 100%;
+ height: 100%;
+}
+.hi-state-panel-fallback__name {
+ font-weight: 500;
+ color: var(--black);
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+/* ROW: icon left, body right (name above optional state list). */
+.hi-state-panel-fallback--row {
+ display: flex;
+ align-items: flex-start;
+ gap: 12px;
+ padding: 8px 12px;
+ min-height: var(--hi-panel-row-min-height);
+}
+.hi-state-panel-fallback--row .hi-state-panel-fallback__body {
+ flex: 1;
+ min-width: 0;
+}
+.hi-state-panel-fallback--row .hi-state-panel-fallback__name {
+ margin-bottom: 4px;
+ white-space: nowrap;
+}
+
+/* TILE: icon centered atop name; state list (when present) below. */
+.hi-state-panel-fallback--tile {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 8px;
+ padding: 12px;
+ text-align: center;
+}
+.hi-state-panel-fallback--tile .hi-state-panel-fallback__icon {
+ width: 48px;
+ height: 48px;
+}
+.hi-state-panel-fallback--tile .hi-state-panel-fallback__name {
+ font-size: 13px;
+ line-height: 1.2;
+}
diff --git a/src/hi/static/state_panels/smoke_detector/smoke_detector.css b/src/hi/static/state_panels/smoke_detector/smoke_detector.css
index 9c1511f5..1cba3d7d 100644
--- a/src/hi/static/state_panels/smoke_detector/smoke_detector.css
+++ b/src/hi/static/state_panels/smoke_detector/smoke_detector.css
@@ -144,24 +144,24 @@
/* List card layout */
/* ============================================================== */
-.hi-state-panel-smoke_detector--list {
+.hi-state-panel-smoke_detector--row {
display: grid;
grid-template-columns: 60px 1fr auto;
gap: 12px;
align-items: center;
padding: 4px;
}
-.hi-state-panel-smoke_detector--list .badge { width: 60px; height: 60px; }
-.hi-state-panel-smoke_detector--list .list-meta { min-width: 0; }
-.hi-state-panel-smoke_detector--list .entity-name {
+.hi-state-panel-smoke_detector--row .badge { width: 60px; height: 60px; }
+.hi-state-panel-smoke_detector--row .row-meta { min-width: 0; }
+.hi-state-panel-smoke_detector--row .entity-name {
font-size: 14px; font-weight: 600; line-height: 1.2;
}
-.hi-state-panel-smoke_detector--list .status-label { font-size: 12px; }
-.hi-state-panel-smoke_detector--list .last-event {
+.hi-state-panel-smoke_detector--row .status-label { font-size: 12px; }
+.hi-state-panel-smoke_detector--row .last-event {
font-size: 11px;
line-height: 1.2;
}
-.hi-state-panel-smoke_detector--list .aux-bits {
+.hi-state-panel-smoke_detector--row .aux-bits {
font-size: 11px;
color: var(--text-muted, #6c757d);
}
@@ -170,7 +170,7 @@
/* Grid card layout */
/* ============================================================== */
-.hi-state-panel-smoke_detector--grid {
+.hi-state-panel-smoke_detector--tile {
display: flex;
flex-direction: column;
align-items: center;
@@ -179,18 +179,18 @@
gap: 6px;
height: 100%;
}
-.hi-state-panel-smoke_detector--grid .badge { width: 72px; height: 72px; margin-top: 6px; }
-.hi-state-panel-smoke_detector--grid .status-label { font-size: 13px; line-height: 1.1; }
-.hi-state-panel-smoke_detector--grid .entity-name {
+.hi-state-panel-smoke_detector--tile .badge { width: 72px; height: 72px; margin-top: 6px; }
+.hi-state-panel-smoke_detector--tile .status-label { font-size: 13px; line-height: 1.1; }
+.hi-state-panel-smoke_detector--tile .entity-name {
font-size: 10px;
color: var(--text-muted, #6c757d);
line-height: 1.2;
margin-top: 4px;
}
-.hi-state-panel-smoke_detector--grid[status="idle"] { background: var(--hi-smoke-idle-bg); }
-.hi-state-panel-smoke_detector--grid[status="active"] { background: var(--hi-smoke-active-bg); }
-.hi-state-panel-smoke_detector--grid[status="recent"] { background: var(--hi-smoke-recent-bg); }
-.hi-state-panel-smoke_detector--grid[status="past"] { background: var(--hi-smoke-past-bg); }
+.hi-state-panel-smoke_detector--tile[status="idle"] { background: var(--hi-smoke-idle-bg); }
+.hi-state-panel-smoke_detector--tile[status="active"] { background: var(--hi-smoke-active-bg); }
+.hi-state-panel-smoke_detector--tile[status="recent"] { background: var(--hi-smoke-recent-bg); }
+.hi-state-panel-smoke_detector--tile[status="past"] { background: var(--hi-smoke-past-bg); }
/* ============================================================== */
/* Battery low-state escalation. */
@@ -205,12 +205,12 @@
color: var(--hi-smoke-active-color);
font-weight: 600;
}
-.hi-state-panel-smoke_detector--list .aux-bits span[status="low"] {
+.hi-state-panel-smoke_detector--row .aux-bits span[status="low"] {
color: var(--hi-smoke-active-color);
font-weight: 600;
}
-.hi-state-panel-smoke_detector--grid .low-battery-warning {
+.hi-state-panel-smoke_detector--tile .low-battery-warning {
display: none;
margin-top: 6px;
font-size: 9px;
@@ -219,6 +219,6 @@
letter-spacing: 0.05em;
color: var(--hi-smoke-active-color);
}
-.hi-state-panel-smoke_detector--grid .low-battery-warning[status="low"] {
+.hi-state-panel-smoke_detector--tile .low-battery-warning[status="low"] {
display: block;
}
diff --git a/src/hi/static/state_panels/thermostat/thermostat.css b/src/hi/static/state_panels/thermostat/thermostat.css
index 85726efc..fc8c22b1 100644
--- a/src/hi/static/state_panels/thermostat/thermostat.css
+++ b/src/hi/static/state_panels/thermostat/thermostat.css
@@ -116,7 +116,7 @@
}
.hi-state-panel-thermostat--modal .thermostat-modes-grid {
display: grid;
- grid-template-columns: 1fr 1fr;
+ tile-template-columns: 1fr 1fr;
gap: 12px 16px;
}
.hi-state-panel-thermostat--modal .control-group {
@@ -203,25 +203,25 @@
/* List card layout */
/* ============================================================== */
-.hi-state-panel-thermostat--list {
+.hi-state-panel-thermostat--row {
display: grid;
- grid-template-columns: 96px 1fr;
+ tile-template-columns: 96px 1fr;
gap: 14px;
align-items: center;
}
-.hi-state-panel-thermostat--list .dial {
+.hi-state-panel-thermostat--row .dial {
width: 96px;
height: 96px;
}
-.hi-state-panel-thermostat--list .dial-temp { font-size: 26px; }
-.hi-state-panel-thermostat--list .entity-name {
+.hi-state-panel-thermostat--row .dial-temp { font-size: 26px; }
+.hi-state-panel-thermostat--row .entity-name {
font-size: 14px; font-weight: 600; line-height: 1.2;
}
-.hi-state-panel-thermostat--list .setpoint-summary {
+.hi-state-panel-thermostat--row .setpoint-summary {
font-size: 12px; color: var(--text-muted, #6c757d); margin-top: 2px;
}
-.hi-state-panel-thermostat--list .setpoint-summary strong { color: #1f2328; font-weight: 500; }
-.hi-state-panel-thermostat--list .humidity-line {
+.hi-state-panel-thermostat--row .setpoint-summary strong { color: #1f2328; font-weight: 500; }
+.hi-state-panel-thermostat--row .humidity-line {
font-size: 11px; color: var(--text-muted, #6c757d); margin-top: 2px;
}
@@ -229,7 +229,7 @@
/* Grid card layout — flat number, color-tinted background. */
/* ============================================================== */
-.hi-state-panel-thermostat--grid {
+.hi-state-panel-thermostat--tile {
display: flex;
flex-direction: column;
align-items: center;
@@ -238,18 +238,18 @@
padding: 8px;
height: 100%;
}
-.hi-state-panel-thermostat--grid[status="heating"] { background: var(--hi-thermo-heating-bg); }
-.hi-state-panel-thermostat--grid[status="cooling"] { background: var(--hi-thermo-cooling-bg); }
-.hi-state-panel-thermostat--grid .grid-temp {
+.hi-state-panel-thermostat--tile[status="heating"] { background: var(--hi-thermo-heating-bg); }
+.hi-state-panel-thermostat--tile[status="cooling"] { background: var(--hi-thermo-cooling-bg); }
+.hi-state-panel-thermostat--tile .tile-temp {
font-size: 44px;
font-weight: 300;
line-height: 1;
}
-.hi-state-panel-thermostat--grid .entity-name {
+.hi-state-panel-thermostat--tile .entity-name {
font-size: 11px; color: var(--text-muted, #6c757d);
margin-top: 6px; line-height: 1.2;
}
-.hi-state-panel-thermostat--grid .setpoint-line {
+.hi-state-panel-thermostat--tile .setpoint-line {
font-size: 9px;
letter-spacing: 0.04em;
text-transform: uppercase;
@@ -257,8 +257,8 @@
margin-top: 3px;
font-weight: 600;
}
-.hi-state-panel-thermostat--grid[status="heating"] .setpoint-line { color: var(--hi-thermo-heating-color); }
-.hi-state-panel-thermostat--grid[status="cooling"] .setpoint-line { color: var(--hi-thermo-cooling-color); }
+.hi-state-panel-thermostat--tile[status="heating"] .setpoint-line { color: var(--hi-thermo-heating-color); }
+.hi-state-panel-thermostat--tile[status="cooling"] .setpoint-line { color: var(--hi-thermo-cooling-color); }
/* ============================================================== */
/* Setpoint visibility (dual vs single). */