22 Commits
Author SHA1 Message Date
Matthijsanddermotduffy 299973a1fa fix: size a newly selected grid cell in a single layout pass (#2730)
Selecting a camera in `live.display.mode: grid` lands in two visible
passes: the cell gets its 2-column width immediately but keeps its 1-row
height for ~400 ms, and the rest of the grid only settles ~700 ms after
the click (measured per-frame on `main`; v7.27.4 has the same two
passes, v8's early position resolution just leaves the late height
correction standing out as a lone vertical jump).

**Cause:** a grid cell's height follows its content in the same style
recalculation as its width (intrinsic media ratio,
`dimensions.aspect_ratio`, or the unsized 16:9 reservation), but the
slotted carousel carries an inline `max-height` from
`MediaHeightController` (debounced 0.3 s + 0.1 s transition; it sizes
the card outside grids). In a grid that cap can only ever delay growth:
it pins the freshly widened cell at its old height until the debounce
fires, and the correction then also rides the 300 ms `_throttledLayout`.
`selectCell()`'s existing `forceReflow()` + `layout()` was already
positioned to do this in one pass; the cap starves it of the final
height.

**Fix:** neutralize the cap on grid cells (`max-height: none
!important`; important is needed to beat the inline style). Covers the
live and viewer grids; non-grid behaviour is untouched. This also stops
the cap clipping cells by their border width (it was measured on the
slide's content box but applied to the cell's border box).

**Trade-off worth flagging:** in the *viewer* grid a cell's carousel
holds all of one camera's media. If those slides do not share one ratio,
the cell now sizes to its tallest slide (letterboxing shorter ones, no
re-layout per swipe) instead of tracking the selected one after a
debounce. If you would rather leave the viewer untouched, the rule can
be scoped to `::slotted(advanced-camera-card-live-carousel)` instead
(live grid cells always hold exactly one slide); say so and I will
rework the PR that way.

**Verification:**

- New browser test `tests/components/live/grid.browser.test.ts`: fails
on any frame where the newly selected cell is selected-wide but still
unselected-high. On `main` it fails with 22 such frames; with this
change there are none: the click settles in a single frame (~28 ms),
every cell at its final size and position.
- `yarn run test`, `yarn run test:browser` (chromium, firefox and webkit
for the new test), `yarn run lint`, `yarn run typecheck` pass.
- No resize oscillation in a cramped viewport with an
appearing/disappearing ancestor scrollbar (the #2306 scenario), on
window resizes, or under a narrow-screen `grid_columns: 2` override;
verified against a live HA 2026.8.3 dashboard (6 go2rtc cameras).

---------

Co-authored-by: dermotduffy <dermot.duffy@gmail.com>
2026-08-30 17:33:48 -07:00
Dermot Duffy 04c2da6379 fix: Do not use bare ha-icon for call controls (#2738)
- Closes: #2735
2026-08-30 14:31:33 -07:00
Dermot Duffy f2e8681daf fix: Default advanced-camera-card-icon to display: block (#2737)
- Inspired by @tieskuh and #2734
2026-08-30 13:40:35 -07:00
Dermot Duffy c9290fc6be fix: Remove bare method call for mp4 in go2rtc (#2727)
- Closes: #2721
2026-08-29 14:40:56 -07:00
Dermot Duffy 1135dd8ec0 fix: go2rtc live provider should work with non-proxied absolute URLs (#2724)
- Closes: #2719
2026-08-29 14:08:48 -07:00
Dermot Duffy 965f2b4c9d fix: Keep the notification popup open while its text is selected (#2706) 2026-08-22 21:29:04 -07:00
Dermot Duffy b2f3243f3e fix: Size the gallery fallback icon frame to fill the thumbnail box (#2705)
- Closes: #2701
2026-08-22 15:02:28 -07:00
Dermot Duffy 0aebf3c484 fix: Keep the notification popup visible / centered (#2702)
- Closes: #2693
2026-08-22 08:36:42 -07:00
Dermot Duffy 98a0084e7a fix: Stop the live media frame collapsing while a stream loads (#2671)
- Closes: #2574
2026-08-09 21:17:06 -07:00
Dermot Duffy 45f88a86a4 fix: Restore picture element actions on Home Assistant 2026.8+ (#2670)
- Closes: #2663
2026-08-09 20:58:15 -07:00
Dermot Duffy 5e199b5612 fix: Report media failures once per failure (#2666) 2026-08-09 10:48:17 -07:00
Dermot Duffy 8d8d486afa test: Split browser test-utils (#2662)
- Closes: #2660
2026-08-07 16:27:28 -07:00
Dermot Duffy 673d8fe133 test: Add browser tests for the media viewing gallery and viewer (#2661) 2026-08-07 16:08:56 -07:00
Dermot Duffy c137f4c00c fix: Report and retry media failures for every camera in a grid (#2658)
- Closes: #2637
 - Related: #2099
2026-08-05 21:35:47 -07:00
Dermot Duffy 2d124fe3cd test: Add a test harness for the built card (#2653)
Mounts the card from `dist/` the way Home Assistant does, by URL with a
HACS tag, and asserts the entry stays a facade, that no chunk imports
it, that the browser is served the file unmodified, and that the card
starts up and fetches a language chunk lazily.

Runs in Chromium, Firefox and WebKit, so a change of bundler or minifier
is checked against every engine.
2026-08-03 21:50:21 -07:00
Dermot Duffy 17146c8ca6 fix: Clear the initialized condition state when the card is not usable (#2646)
The `initialized` state (used in conditions/triggers) was written once
and never cleared, so it meant "has this card ever been initialized"
while everything reading it took it as "is this card usable now". Home
Assistant takes a card off the page and puts it back whenever its
dashboard tab is left and returned to, so the card initialized again
while the state claimed it was initialized throughout: `trigger:
initialized` fired once per card rather than once per startup, and
automations were dropped in between.

The card lifecycle is now an explicit state machine (`SessionManager`),
the only writer of `initialized`, which separates a card that is
starting up from one initializing part of itself again while it runs. A
new `ever` parameter (conditions/triggers) selects the old latched
behaviour.

`remote_control` uses that parameter to keep its two camera priorities
correct under repeated starts. With `camera_priority: entity` the card
now re-reads the entity every time it starts, so a camera selected while
the card was away is picked up on return. With `camera_priority: card`
the card writes the entity on its first start only, unchanged, since
repeating that write would overwrite a camera the user had selected.

Closes: #2642


BREAKING CHANGE: `condition: initialized` is now `false` whenever the
card is not usable, and `trigger: initialized` fires each time the card
starts up rather than only the first time. Set `ever: true` on either to
keep the previous behaviour.
2026-08-02 12:52:58 -07:00
Dermot Duffy e590f72783 test: Add a browser based test harness (#2641) 2026-07-31 10:16:58 -07:00
Dermot Duffy ad89aa9538 test: Split test utilities to improve test times (#2622) 2026-07-26 16:29:53 -07:00
Dermot Duffy c02c692f68 feat: Add experimental rewrite of go2rtc live provider (MSE/WebRTC/MP4/MJPEG) (#2580)
- Closes #2556
- Closes #2450

**Key intended features:**
 - go2rtc compatible
- 100% test coverage to significantly improve ability to test, maintain
and work around browser weirdnesses (e.g. Safari).
 - Written from the ground up in the style of the rest of the project.

**To use:**
 - Change `live_provider` from `go2rtc` to `go2rtc-experimental`.
2026-07-14 14:22:41 -07:00
Dermot Duffy a96dc2e863 chore: Enforce import order via @ianvs/prettier-plugin-sort-imports (#2542) 2026-06-30 17:45:13 -07:00
Dermot Duffy 921d45e577 chore: Enforce a few house rules via eslint (#2539) 2026-06-30 17:45:13 -07:00
Dermot Duffy 47bcce93d3 feat: Add hardened error handling and retries (#2451)
- Closes #1830
 - Closes #2099
2026-06-30 17:45:12 -07:00