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:
@@ -77,9 +77,12 @@ def test_blank_slides_and_widgets_placed_by_hand(client, owner_h):
|
||||
p = playlist(client, owner_h)
|
||||
s = slide(client, owner_h, p["id"], "blank", content={"widgets": [
|
||||
{"kind": "clock", "position": "custom", "box": {"x": 90, "y": 5, "w": 20, "h": 10}, "align": "right"},
|
||||
{"kind": "date", "position": "top-left", "size": "custom", "box": {"x": 1, "y": 1, "w": 5, "h": 5}}]})
|
||||
clock, date = s["content"]["widgets"]
|
||||
assert clock["size"] == "custom" and clock["box"] == {"x": 80, "y": 5, "w": 20, "h": 10} and clock["align"] == "right" # kept on the slide
|
||||
{"kind": "date", "position": "top-left", "size": "custom", "box": {"x": 1, "y": 1, "w": 5, "h": 5}},
|
||||
{"kind": "text", "text": "Big", "position": "custom", "box": {"x": 99, "y": -50, "w": 30, "h": 20}}]})
|
||||
clock, date, big = s["content"]["widgets"]
|
||||
# owner review 6: a box may run off the slide (here past the right edge), a strip of it stays on it
|
||||
assert clock["size"] == "custom" and clock["box"] == {"x": 90, "y": 5, "w": 20, "h": 10} and clock["align"] == "right"
|
||||
assert big["box"] == {"x": 95, "y": -15, "w": 30, "h": 20}
|
||||
assert date["size"] == "medium" and date["box"] is None # a corner: no box, a real size
|
||||
r = client.put(f"/api/signage/slides/{s['id']}", headers=owner_h, json={"content": {"widgets": [{"kind": "clock", "position": "custom"}]}})
|
||||
assert err(r) == "signage.content_invalid" # placed by hand needs its box
|
||||
|
||||
@@ -173,3 +173,19 @@ def test_the_venues_badges_and_a_widgets_own_look(client, owner_h, menu, screens
|
||||
url = f"/api/signage/playlists/{p['id']}/slides"
|
||||
for bad in ({"badges": {sid: ["a", "b", "c", "d", "e"]}}, {"board_valign": "centre"}, {"widgets": [{"kind": "clock", "text_size": 400}]}):
|
||||
assert err(client.post(url, headers=owner_h, json={"kind": "menu", "content": bad})) == "signage.content_invalid", bad
|
||||
|
||||
|
||||
def test_how_many_widgets_a_slide_may_hold_is_the_venues(client, owner_h):
|
||||
"""Owner review 6 (2026-11-21): 10 widgets a slide (recommended), more when the venue allows them
|
||||
(Signage → Message & settings → Performance), never over 50; a menu with pages may now turn them
|
||||
every second."""
|
||||
assert client.get("/api/signage/performance", headers=owner_h).json() == {"max_widgets": 10, "recommended": 10, "cap": 50}
|
||||
p = playlist(client, owner_h)
|
||||
url = f"/api/signage/playlists/{p['id']}/slides"
|
||||
eleven = [{"kind": "clock"}] * 11
|
||||
assert err(client.post(url, headers=owner_h, json={"kind": "blank", "content": {"widgets": eleven}})) == "signage.too_many_widgets"
|
||||
assert client.put("/api/signage/performance", headers=owner_h, json={"max_widgets": 12}).json()["max_widgets"] == 12
|
||||
assert client.post(url, headers=owner_h, json={"kind": "blank", "content": {"widgets": eleven}}).status_code == 201
|
||||
assert err(client.put("/api/signage/performance", headers=owner_h, json={"max_widgets": 51})) is not None
|
||||
s = slide(client, owner_h, p["id"], "menu", content={"page_seconds": 1}, duration_s=1)
|
||||
assert s["content"]["page_seconds"] == 1 and s["duration_s"] == 1
|
||||
|
||||
Reference in New Issue
Block a user