Repository navigation
fix(frontend): use the loading skeleton for ladder configs and the static settings placeholder - #1450
Conversation
…atic settings placeholder Issue LeanerCloud#186 made skeletons the one loading pattern, with a "Still loading" note after 8s, but two plain-text loaders were left: the per-account ladder config table showed a "Loading..." paragraph while its configs loaded, and index.html's #settings-loading said "Loading settings..." until loadGlobalSettings replaced it. The ladder table now shows skeleton rows in its own 8-column shape (cleared on error too), and the static placeholder is the same skeleton markup with a screen-reader status, sized by two small CSS classes since static HTML cannot set inline sizes under the CSP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 6 billable files and costs up to $1.50. Or wait 58 minutes for your next included review. View limit details
Comment |
|
Independent review (IAmJSD's agent, fresh context, given only the diff, the issue and the PR text): VERDICT: APPROVE Blocking:
Non-blocking:
Attacked:
Body-stale:
Reviewer: rD1. Bar while the maintainers are away (set by IAmJSD as acting owner): one approving independent review on the head, two for money, auth and security paths. |
|
Local verification at |
|
Merged by IAmJSD's agent at IAmJSD's request (IAmJSD is acting owner while the maintainers are away), under the bar IAmJSD set: 1 approving independent review(s) on |
Closes #186
Why
#186 asked for one consistent loading pattern, plus a fallback so a slow or empty response does not look like a hang. Most of that is already on
main.lib/skeleton.tsis the one panel loader: it adds a screen-reader "Loading…" status, and after 8s it shows a visible "Still loading. This is taking longer than usual." note (tests-e2e/loading-fallback.spec.ts). Two plain-text loaders were still left:<p>Loading…</p>while its configs loaded (ladder.ts).index.html's static#settings-loadingsaid "Loading settings..." untilloadGlobalSettingsswapped in the skeleton.What
ladder.ts: the per-account table container now showsshowSkeletonRows(container, 3, LADDER_CONFIG_TABLE_COLUMNS). Its 8 columns match the real table, and the count is exported fromladder-config-table.tsnext to the header. The error path callsteardownSkeletonbefore rendering the error, so no slow-note timer oraria-busyis left behind.index.html:#settings-loadingis now the same skeleton markup thatshowSkeletonTextproduces: an sr-onlyrole="status""Loading…" and six aria-hidden shimmer lines. Static HTML cannot size blocks inline under the CSP, so two classes inbase.css(.skeleton-line,.skeleton-line-short) give the lines the same 1rem height and 60% last line that the JS helper uses.Out of scope: request timeout or abort (
AbortController). The issue's ask is a visible fallback for a slow or empty response, and the 8s "Still loading" note already provides it. Cancelling slow requests would be a separate change to the API client. This PR uses Closes on that reading; the owner may want a follow-up issue if aborting requests is also wanted.Verification
main'sladder.tsandindex.html, the new-t "issue #186"tests inladder.test.tsandskeleton.test.tsgive 2 failed (the ladder skeleton-rows test and theindex.htmlplaceholder test). With this change, all pass.npm run lint: 0 errors (141 warnings, all already on main).npm run typecheck: clean.npm run build: ok.npx jest --no-coverage: 171 suites, 4504 passed, 1 skipped.scripts/test-git-secrets-allowlist.sh: 183 PASS, 0 FAIL.🤖 Generated with Claude Code