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.
This commit is contained in:
Marco Allegretti 2026-10-09 09:07:27 +00:00
parent c1ea57fbef
commit 481495d929
No known key found for this signature in database
3 changed files with 9 additions and 2 deletions

View file

@ -1 +1 @@
a533f421c6e9b5d5df82d082b68af0b8408a7f02fd060bd71d1b33bc1579046a3791d73a929b90c8a62c7c42949f412bd88952c7e10f1575cc85cccb1602a40d
e8c10750b142b9df4405fd33ea0c060e63d44b5293e7f9ffa5b076989146b05e81f716e9b92aaeeb139ce1dc9b13ed26f356385d6a61a19c7f3dcaf6e95d2d03

View file

@ -237,7 +237,7 @@
function setupIpc() {
if (!window.weftIpc) { setTimeout(setupIpc, 50); return; }
window.weftIpc.onmessage = onMessage;
load('');
load('loading…');
}
setLoaded(false);

View file

@ -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)