From 481495d9298650eefbab06a25223fbefc1cb4daa Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Fri, 9 Oct 2026 09:07:27 +0000 Subject: [PATCH] fix(notes): show loading status and check the editor after a failed load The first load showed an empty status while the editor was read-only; it now says loading. check_notes.py also types and saves after a failed load and requires the stored file to stay unchanged. --- examples/org.weft.demo.notes/signature.sig | 2 +- examples/org.weft.demo.notes/ui/index.html | 2 +- tests/frame/check_notes.py | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/org.weft.demo.notes/signature.sig b/examples/org.weft.demo.notes/signature.sig index a6539c9..637f568 100644 --- a/examples/org.weft.demo.notes/signature.sig +++ b/examples/org.weft.demo.notes/signature.sig @@ -1 +1 @@ -a533f421c6e9b5d5df82d082b68af0b8408a7f02fd060bd71d1b33bc1579046a3791d73a929b90c8a62c7c42949f412bd88952c7e10f1575cc85cccb1602a40d \ No newline at end of file +e8c10750b142b9df4405fd33ea0c060e63d44b5293e7f9ffa5b076989146b05e81f716e9b92aaeeb139ce1dc9b13ed26f356385d6a61a19c7f3dcaf6e95d2d03 \ No newline at end of file diff --git a/examples/org.weft.demo.notes/ui/index.html b/examples/org.weft.demo.notes/ui/index.html index 446f273..f99a124 100644 --- a/examples/org.weft.demo.notes/ui/index.html +++ b/examples/org.weft.demo.notes/ui/index.html @@ -237,7 +237,7 @@ function setupIpc() { if (!window.weftIpc) { setTimeout(setupIpc, 50); return; } window.weftIpc.onmessage = onMessage; - load(''); + load('loading…'); } setLoaded(false); diff --git a/tests/frame/check_notes.py b/tests/frame/check_notes.py index 937ec1e..2d562ee 100644 --- a/tests/frame/check_notes.py +++ b/tests/frame/check_notes.py @@ -143,8 +143,15 @@ def run(args, desktop, home, xdotool): act("mousemove", "--sync", *DISCARD) act("click", "1") time.sleep(2) + # The editor stays read-only and nothing can be saved over the file. + act("mousemove", "--sync", "100", "300") + act("click", "1") + act("type", "--delay", "40", "x") + act("key", "ctrl+s") + time.sleep(2) if notes.read_bytes() != b"\xff not text": raise AssertionError("a failed load changed the stored notes") + act("mousemove", "--sync", *DISCARD) notes.write_text("repaired", encoding="utf-8") act("click", "1") time.sleep(2)