From f1b303d891dadf78d541dccef0afd14f682ac48c Mon Sep 17 00:00:00 2001 From: Alex Sorafumo Date: Fri, 2 Oct 2026 15:41:57 +1000 Subject: [PATCH] fix(signage): fill the frame with unpositioned floating items A floating template item with no saved position now defaults to 0, 0, so it fills the frame, matching the manager preview (#536). --- apps/signage/src/app/template-layout.ts | 7 ++++++- apps/signage/src/tests/template-layout.spec.ts | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/signage/src/app/template-layout.ts b/apps/signage/src/app/template-layout.ts index 58f04aeba66..6bf91ae81b4 100644 --- a/apps/signage/src/app/template-layout.ts +++ b/apps/signage/src/app/template-layout.ts @@ -19,7 +19,12 @@ export interface ComputedTemplateLayout { const EDGE_BAR_SIZE = 15; const SIDE_BAR_SIZE = 20; -const FLOATING_POSITION = 50; +/** + * Top-left corner of a floating item with no position, so it fills the frame. + * Keep in step with the manager preview + * (`apps/signage-manager/src/app/templates/template-layout.util.ts`). + */ +const FLOATING_POSITION = 0; const clamp = (value: number, max = 100) => Math.min(Math.max(value, 0), Math.max(max, 0)); diff --git a/apps/signage/src/tests/template-layout.spec.ts b/apps/signage/src/tests/template-layout.spec.ts index 2615acedc8f..27b9f6375c3 100644 --- a/apps/signage/src/tests/template-layout.spec.ts +++ b/apps/signage/src/tests/template-layout.spec.ts @@ -47,14 +47,14 @@ describe('computeTemplateLayout', () => { }); }); - it('places a floating item without a position at the centre', () => { + it('fills the frame with a floating item that has no position', () => { const result = computeTemplateLayout([layout('floating')]); expect(result.items[0].rect).toEqual({ - left: 50, - top: 50, - width: 50, - height: 50, + left: 0, + top: 0, + width: 100, + height: 100, }); });