T14.3 (D26, BL-061): the sync badge shows the true state and gets out of the way

The badge words live in one function, badgeModel(). States: sending, retrying,
held for sign-in, not saved on this device, rejected (with the reason), read and
queue, another person's changes, and all sent. Every state names the project.
Sign in is a real link to login.html?next=. Dismiss is a real button and removes
only the changes the project refused. Both are 44px or more with a focus ring.

BL-061: the console pages (Admin, User Directory) never show the badge. All sent
shows only after real work. The badge picks a free spot on the screen. One very
dense screen case is left and logged as BL-072.

tests/sync_badge_check.py (87 checks). autosave_check reads the new badge words.
This commit is contained in:
2026-10-17 15:12:25 -07:00
parent b78b9b3707
commit 6c2e457225
8 changed files with 551 additions and 71 deletions

View File

@@ -241,18 +241,16 @@ def main():
# Only what the badge RENDERS counts. The phrase still appears in the
# comment explaining why it was changed, and asserting on that would be
# asserting that the reason cannot be written down.
rendered = [ln for ln in src.split("\n")
if ("el.textContent" in ln or "el.innerHTML" in ln)
and "All changes saved" in ln]
# T14.3: the badge's words now live in one place, badgeModel(), as
# `text: '...'` entries. Those are the lines that render.
texts = [ln for ln in src.split("\n") if "text: '" in ln and "tone: '" in ln]
rendered = [ln for ln in texts if "All changes saved" in ln]
chk("the badge no longer renders 'All changes saved'", not rendered, rendered[:1])
chk("the badge words were found (a rename must not make this check empty)", len(texts) >= 7,
"found %d" % len(texts))
chk("...and every state it renders names the project",
all("the project" in ln
for ln in src.split("\n")
if ("el.textContent = '" in ln or "el.innerHTML = '" in ln)
and "wp-sync-badge" not in ln and ("✓" in ln or "⚠" in ln or "↻" in ln or "✕" in ln)),
[ln.strip()[:70] for ln in src.split("\n")
if ("el.textContent = '" in ln or "el.innerHTML = '" in ln)
and "the project" not in ln and ("✓" in ln or "⚠" in ln or "↻" in ln or "✕" in ln)])
all("the project" in ln for ln in texts),
[ln.strip()[:70] for ln in texts if "the project" not in ln])
print("\n7. autosave's own registration survives the retired analytics tracker")
# This section used to also assert the per-browser usage-analytics dwell