feat(signage): More settings for every widget (opacity, rotation, shadow, border, entrance animation, a logo's fit; text weight, highlight, typing out; date and clock formats; a logo in a QR code)

Folded under each widget card like Text and colours. The TV puts them on the element
that places the widget (fx), animations on translate / scale so its place's transform
stays (an older TV only fades); an entrance animates to the widget's own opacity.
Calibrating: a strict-mode remount no longer ends it. Plan 6R.17, F-115.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 15:01:42 +02:00
co-authored by Claude Opus 5.5
parent 1eb7e5e3a9
commit 673113aff7
11 changed files with 444 additions and 26 deletions
+17
View File
@@ -99,3 +99,20 @@ def test_reviews_typed_in_by_hand(client, owner_h, screens, sent):
assert client.get("/api/signage/reviews", headers=owner_h).json()["reviews"][1]["name"] == "John"
assert client.put("/api/signage/reviews", headers=owner_h, json={"reviews": [{"name": "x", "stars": 6, "text": "y"}]}).status_code == 422
assert client.put("/api/signage/reviews", headers=owner_h, json={"reviews": [{"name": "x", "stars": 5, "text": ""}]}).status_code == 422
def test_more_settings_of_widgets(client, owner_h, media_dir):
from tests.test_signage import playlist, slide
logo = up(client, owner_h, jpeg(200, 200)).json()
p = playlist(client, owner_h)
w = {"kind": "date", "opacity": 60, "rotation": -15, "shadow": "glow", "border_width": 4, "border_colour": "#ff0000", "border_radius": 20,
"animation": "pop", "animation_delay": 5, "weight": 300, "highlight": "#ffff0080", "text_effect": "typewriter",
"date_format": "numeric", "date_separator": "."}
q = {"kind": "qr", "media_id": logo["id"], "clock_format": "12", "clock_blink": True}
s = slide(client, owner_h, p["id"], "blank", content={"widgets": [w, q]})
got = s["content"]["widgets"][0]
assert {k: got[k] for k in w} == w
assert s["content"]["widgets"][1]["media_id"] == logo["id"]
for bad in ({"kind": "date", "opacity": 5}, {"kind": "date", "animation": "spin"}, {"kind": "date", "date_separator": "|"}, {"kind": "clock", "weight": 1000}):
r = client.post(f"/api/signage/playlists/{p['id']}/slides", headers=owner_h, json={"kind": "blank", "content": {"widgets": [bad]}})
assert err(r) == "signage.content_invalid", bad