Show when the dashboard is working, and log slow answers #201
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dashboard-busy-indicator"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this PR does
Makes the dashboard show that it's working, and stops the auto-refresh from cancelling a tap:
_BUSY_HTML/_BUSY_JS, added by_page()). A tap on a link to another dashboard page, or a form sent, marks the page busy at once. If the answer takes more than 150 ms, a bar slides across the top with a Working… label, which is also announced through arole=statusregion, so the cue isn't colour or motion alone. Under reduced motion the bar stays still. While busy, a second send of a form is dropped, so a double tap can't apply a change twice. Buttons aren't disabled, because a disabled button's value drops out of the form (the capture switch'saction). Downloads (<a download>), new tabs, links off the device, jumps within the page, modified or middle clicks and gestures a page script already handled (the map's drag) are left alone. It clears when the page is shown again (the back button), and after a minute in any case. Without scripts the pages work as before._BUSY_TEST). Before, a reload that landed while a tapped page was loading replaced it, so the tap seemed to be ignored.web: slow response: METHOD ROUTE took N sfor anything that tookSLOW_RESPONSE_SECONDS(2 s) or more, up to the body being ready, with the sign-in check included. The route is the rule's pattern (a plugin page with its plugin's name), never the URL, whose query can carry a login token.PASSwith none andINFOwith the list otherwise, andSKIPon a daemon that doesn't log them yet. CLAUDE.md ("Verifying a beta") andtools/beta-check/README.md("Checks every beta keeps") make it a standing item. The sharedpkg_dir/pkg_hashelpers moved above section 1 so it can use them.deferred.md, to be picked up once item 1.6 showsPOST /captureamong the slow ones.Checklist
bash -npass locally; shellcheck and the ansible/yamllint steps aren't installed here, so the Lint workflow is the check.test_web.pypotfile-import tests that also fail locally onmain(werkzeug version); CI runs the full suite. The new tests run the indicator script under node with a small stand-in DOM (a slow load shows it, a download or new tab doesn't, a second form send is dropped, the back button clears it) and skip where node isn't installed. They also cover the refresh guard and the slow-response log (route not URL, a token never logged, a quick answer not logged). Three older tests that counted<script>tags now discount the shell's script.GUIDE_MD(the dashboard section),docs/developer/web-ui-conventions.md(the indicator, the refresh rule, the slow log, a checklist line),docs/developer/deferred.md,tools/beta-check/README.md, CLAUDE.md.Release impact
kestrel_pipackage (web.py,userguide.py) ships. The beta-check scripts and docs aren't shipped.Notes for review
SKIPon a device still running beta.5 or earlier.🤖 Generated with Claude Code