feat(signage): look rows that wrap, one colour field with opacity, badges' text, several widgets per stack part, pages up to 2200 px (owner review 4)
- Menu text look: each field names its part ("Headings size"), rows wrap in aligned columns on
alternating bands; names align left / right; line and letter spacing as lists (Auto default);
each field changes only itself (followers frozen before the other changes); badge colour +
badge text colour (auto: readableOn); "Reset the look" with a question.
- ColourField everywhere in signage: a Popover panel (new @xenia/ui Popover, portal, kept in the
window) with 12 presets, picker, opacity (#rrggbbaa) and typed code; HEX accepts 8 digits.
- Stacks: Cell.widgets (a stored `widget` still reads), several widgets per part laid across the
stack's direction; extras by path stack.part.place; Add a widget adds, each removable / ordered.
- Page rule: --x-page-max is 2200px (no longer follows the window height).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,7 @@ def test_text_weather_and_stack_widgets_are_checked(client, owner_h):
|
||||
ws = s["content"]["widgets"]
|
||||
assert ws[0]["text"] == "Happy hour 18-20"
|
||||
assert ws[1]["weather_from"] == 1 and ws[1]["weather_days"] == 2 and ws[1]["weather_style"] == "icon" # the forecast has 3 days
|
||||
assert [c["share"] for c in ws[2]["cells"]] == [30, 70] and ws[2]["cells"][1]["widget"]["direction"] == "column"
|
||||
assert [c["share"] for c in ws[2]["cells"]] == [30, 70] and ws[2]["cells"][1]["widgets"][0]["direction"] == "column"
|
||||
assert ws[0]["cells"] == [] and ws[0]["board"] is None
|
||||
url = f"/api/signage/playlists/{p['id']}/slides"
|
||||
bad = [
|
||||
@@ -57,12 +57,12 @@ def test_a_stack_shows_a_library_slide_and_a_menu_widget(client, owner_h, screen
|
||||
got = client.get("/api/signage/screen", headers=tv["h"]).json()["playlist"]["slides"][0]
|
||||
ex = got["extras"]
|
||||
assert ex["0"]["link"] and got["content"]["widgets"][0]["link"] == ex["0"]["link"]
|
||||
assert names(ex["1.0"]["menu"]) == [] and ex["1.0"]["menu"]["count"] == 0 # Beer hidden; Wine: delivery only
|
||||
assert names(ex["1.0.0"]["menu"]) == [] and ex["1.0.0"]["menu"]["count"] == 0 # Beer hidden; Wine: delivery only
|
||||
inner = ex["1.1"]["slide"]
|
||||
assert inner["id"] == promo["id"] and inner["kind"] == "text" and inner["content"]["title"] == "Fresh fish"
|
||||
assert inner["extras"]["0"]["link"] # its own widgets' extras
|
||||
# the editor: the hidden product stays in the list, marked
|
||||
ed = client.get(f"/api/signage/playlists/{p['id']}", headers=owner_h).json()["slides"][0]["extras"]["1.0"]["menu"]
|
||||
ed = client.get(f"/api/signage/playlists/{p['id']}", headers=owner_h).json()["slides"][0]["extras"]["1.0.0"]["menu"]
|
||||
assert [(i["name"], i.get("hidden", False)) for g in ed["groups"] for i in g["items"]] == [("Beer", True)] and ed["count"] == 0
|
||||
# a change to the library slide reaches the screens that show it inside a stack
|
||||
sent.clear()
|
||||
@@ -89,7 +89,7 @@ def test_the_editor_previews_any_slide(client, owner_h, menu):
|
||||
{"share": 50, "slide_id": promo["id"]})]}})
|
||||
assert r.status_code == 200, r.text
|
||||
got = r.json()
|
||||
assert [i.get("hidden") for g in got["extras"]["0.0"]["menu"]["groups"] for i in g["items"]] == [True]
|
||||
assert [i.get("hidden") for g in got["extras"]["0.0.0"]["menu"]["groups"] for i in g["items"]] == [True]
|
||||
assert got["extras"]["0.1"]["slide"]["content"]["title"] == "Inside" and got["menu"] is None and got["media"] == {}
|
||||
r = client.post("/api/signage/preview/slide", headers=owner_h, json={"kind": "menu", "content": {"select": "all", "exclude_ids": [menu["beer"].id]}})
|
||||
m = r.json()["menu"]
|
||||
@@ -117,3 +117,27 @@ def test_a_board_has_its_own_names_and_the_look_of_each_part(client, owner_h, me
|
||||
url = f"/api/signage/playlists/{p['id']}/slides"
|
||||
for bad in ({"names": {"x": "a"}}, {"heading_style": {"size": 20}}, {"dot_style": {"style": "wavy"}}, {"line_height": 9}, {"photo_shape": "star"}):
|
||||
assert err(client.post(url, headers=owner_h, json={"kind": "menu", "content": bad})) == "signage.content_invalid", bad
|
||||
|
||||
|
||||
def test_a_part_holds_several_widgets_and_colours_can_be_see_through(client, owner_h, menu):
|
||||
"""Owner review 4 (2026-11-21): a stack's part holds several widgets (each with its own extras,
|
||||
by path "stack.part.place"); a part stored with one `widget` still reads; colours #rrggbbaa; a
|
||||
board's badges have their own text colour."""
|
||||
p = playlist(client, owner_h)
|
||||
s = slide(client, owner_h, p["id"], "blank", content={"background": {"colour": "#11182780"}, "widgets": [
|
||||
stack({"share": 40, "widgets": [{"kind": "clock"}, {"kind": "qr"}, {"kind": "menu", "board": {"product_ids": [menu["steak"].id]}}]},
|
||||
{"share": 60, "widget": {"kind": "date"}}),
|
||||
]})
|
||||
cells = s["content"]["widgets"][0]["cells"]
|
||||
assert [w["kind"] for w in cells[0]["widgets"]] == ["clock", "qr", "menu"] and [w["kind"] for w in cells[1]["widgets"]] == ["date"]
|
||||
assert "widget" not in cells[1] and s["content"]["background"]["colour"] == "#11182780"
|
||||
ex = client.get(f"/api/signage/playlists/{p['id']}", headers=owner_h).json()["slides"][0]["extras"]
|
||||
assert ex["0.0.1"]["link"] and names(ex["0.0.2"]["menu"]) == [["Grill", ["Steak"]]]
|
||||
url = f"/api/signage/playlists/{p['id']}/slides"
|
||||
for bad in (stack({"share": 50, "widgets": [{"kind": "clock"}], "slide_id": 1}),
|
||||
stack({"share": 50, "widgets": [{"kind": "clock"}] * 7})):
|
||||
assert err(client.post(url, headers=owner_h, json={"kind": "blank", "content": {"widgets": [bad]}})) == "signage.content_invalid", bad
|
||||
m = slide(client, owner_h, p["id"], "menu", content={"accent_colour": "#1e3a8a", "badge_text_colour": "#fde68aCC"})["content"]
|
||||
assert m["badge_text_colour"] == "#fde68aCC" and m["accent_colour"] == "#1e3a8a"
|
||||
for bad in ({"badge_text_colour": "#fff"}, {"text_colour": "#12345"}):
|
||||
assert err(client.post(url, headers=owner_h, json={"kind": "menu", "content": bad})) == "signage.content_invalid", bad
|
||||
|
||||
Reference in New Issue
Block a user