fix: Size the expanded dialog and grid columns to their content (#2611)

- Closes #2607
This commit is contained in:
Dermot Duffy
2026-07-25 13:46:31 -07:00
committed by GitHub
parent 5f2c7f5e4e
commit 2a84f199de
6 changed files with 301 additions and 22 deletions
+26 -1
View File
@@ -133,7 +133,32 @@ describe('StyleManager', () => {
expect(
element.style.getPropertyValue('--advanced-camera-card-expand-aspect-ratio'),
).toBe('800 / 600');
).toBe('unset');
expect(element.style.getPropertyValue('--advanced-camera-card-expand-width')).toBe(
'var(--advanced-camera-card-expand-max-width)',
);
expect(
element.style.getPropertyValue('--advanced-camera-card-expand-height'),
).toBe('none');
});
it('with a non-media view', () => {
const api = createCardAPI();
const element = document.createElement('div');
vi.mocked(api.getCardElementManager().getElement).mockReturnValue(element);
const view = createView({ view: 'timeline' });
vi.mocked(api.getViewManager().getView).mockReturnValue(view);
vi.mocked(api.getMediaLoadedInfoManager().getLastKnown).mockReturnValue({
width: 800,
height: 600,
});
const manager = new StyleManager(api);
manager.setExpandedMode();
expect(
element.style.getPropertyValue('--advanced-camera-card-expand-aspect-ratio'),
).toBe('unset');
expect(element.style.getPropertyValue('--advanced-camera-card-expand-width')).toBe(
'var(--advanced-camera-card-expand-max-width)',
);