feat(signage): menus play whole rounds, seconds fields with − / +, widget limit setting, widgets as big as their content (owner review 6)
- A menu board with pages plays whole rounds (menuMs rounds its seconds up); the editor says how long it really plays under "Seconds on screen", the card and the playlist total use it. - Seconds on screen / per page: shared NumberInput (− / +, may be emptied: an error under the field and Save blocked until filled; 1 s at least, server ge=1). - Performance (Signage -> Message & settings): widgets per slide (signage.max_widgets, 10 recommended, up to 50), checked by the server (signage.too_many_widgets) and the editor. - Text, clock, date, QR, weather, logo placed by hand: the box is exactly the content (its height x text size sets the size, the width follows; handles scale keeping the shape; text size grows the box); a slide's widget may run off the slide while 5 % stays on it. - Slider: the value as close to the slider as the frame's padding; floor and table-colour sliders use the shared Slider. Timeline cards' ring no longer clipped; larger playlist buttons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -102,3 +102,17 @@ test('the Slides library: what is saved, and a copy for a playlist', async () =>
|
||||
assert.equal(saved.content.widgets[0].kind, 'name') // a copy, never the kept slide
|
||||
})
|
||||
|
||||
|
||||
test('owner review 6: a box off the slide (a strip stays), a tight box scaled keeping its shape', async () => {
|
||||
const { moveLoose, scaleBox, secondsMissing } = await import('../src/pages/signage/signageLogic.js')
|
||||
assert.deepEqual(moveLoose({ x: 50, y: 10, w: 20, h: 10 }, 60, -30), { x: 95, y: -5, w: 20, h: 10 })
|
||||
assert.deepEqual(moveLoose({ x: 50, y: 10, w: 20, h: 10 }, -100, 0), { x: -15, y: 10, w: 20, h: 10 })
|
||||
assert.deepEqual(scaleBox({ x: 10, y: 10, w: 20, h: 10 }, 'se', 20, 0), { x: 10, y: 10, w: 40, h: 20 }) // twice as wide → twice as tall
|
||||
assert.deepEqual(scaleBox({ x: 10, y: 10, w: 20, h: 10 }, 'n', 0, -10), { x: 0, y: 0, w: 40, h: 20 }) // the bottom stays, centred across
|
||||
assert.deepEqual(scaleBox({ x: 10, y: 10, w: 20, h: 10 }, 'nw', 10, 2), { x: 14, y: 12, w: 16, h: 8 }) // a corner: the larger of the two (0.5, 0.8)
|
||||
assert.equal(secondsMissing({ kind: 'menu', duration_s: 10, content: { page_seconds: null } }), true)
|
||||
assert.equal(secondsMissing({ kind: 'text', duration_s: null, content: {} }), true)
|
||||
assert.equal(secondsMissing({ kind: 'video', video_to_end: true, duration_s: null, content: {} }), false)
|
||||
assert.equal(secondsMissing({ kind: 'blank', duration_s: 5, content: { widgets: [{ kind: 'stack', cells: [{ widgets: [{ kind: 'menu', board: { page_seconds: null } }] }] }] } }), true)
|
||||
assert.equal(secondsMissing({ kind: 'menu', duration_s: 5, content: { page_seconds: 3 } }), false)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user