feat(signage): stacks, menu and text widgets, widget order (owner review 2)
- Stacks: horizontal / vertical, 2-6 parts with % shares; each part shows a widget, a stack one level deep, or a whole Slides-library slide - Menu widget (a board's list in its box), text widget, weather for tomorrow / the day after and in picture / degrees / both styles - Widgets' order (arrows, drag with a drop line), drawn in list order; arrow keys move the picked widget from its card too - Server: extras by widget path (QR links, menus, embedded slides), POST /preview/slide, resolve(keep_hidden) so hidden products stay greyed in the editor's list; screens told when an embedded slide changes - Editor rows tidied: framed sliders, colours as fields, text look on one row, Switch boxed toggles from its whole frame Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -155,3 +155,16 @@ test('a screen whose default is a library slide plays it when no line matches',
|
||||
playlists: { 1: { id: 1, slides: [] }, 'slide:3': one } }
|
||||
assert.equal(playlistNow(data, new Date('2026-11-21T12:00:00Z')), one)
|
||||
})
|
||||
|
||||
test('stacks: even shares and a part resized against its neighbour; hidden products never on the TV (2026-11-21)', async () => {
|
||||
const { boardPages, evenShares, setShare, visibleGroups } = await import('../src/logic.js')
|
||||
assert.deepEqual(evenShares(3), [34, 33, 33])
|
||||
assert.deepEqual(evenShares(2), [50, 50])
|
||||
assert.deepEqual(setShare([50, 50], 0, 25), [25, 75])
|
||||
assert.deepEqual(setShare([25, 25, 50], 2, 70), [25, 5, 70]) // the last part takes from the one before
|
||||
assert.deepEqual(setShare([50, 50], 1, 99), [5, 95]) // its neighbour keeps 5 %
|
||||
const groups = [{ category: { id: 1 }, items: [{ id: 1, hidden: true }] }, { category: { id: 2 }, items: [{ id: 2 }, { id: 3, hidden: true }] }]
|
||||
assert.deepEqual(visibleGroups(groups), [{ category: { id: 2 }, items: [{ id: 2 }] }])
|
||||
const pages = boardPages({ content: { columns: 1 }, menu: { groups } }, 0, 1920, 1080)
|
||||
assert.deepEqual(pages.flat().flatMap(g => g.items.map(i => i.id)), [2])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user