board: spinner during first load instead of "no cards found"
An empty board on first load blurting "no cards found" was alarming on a board the user knew had cards. Track a cardsLoaded flag that flips on the first /api/cards (meta or full) response — or on a cached-cards hydration — and show a centred spinner placeholder while it's still false. The "no cards found" copy only shows once we've actually heard back and the set is genuinely empty. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d31e186bd9
commit
41272bd9ce
5 files changed
+27
-7
No files matched your search
@@ -587,9 +587,18 @@ export function renderBoard() {
|
||||
board.style.display = 'flex';
|
||||
board.style.alignItems = 'center';
|
||||
board.style.justifyContent = 'center';
|
||||
board.innerHTML = `<div class="flex flex-col items-center text-center">
|
||||
<i class="ph ph-cards text-4xl text-t-dim mb-4 block"></i>
|
||||
<p class="font-pixel text-sm text-t-dim cursor-blink">no cards found</p></div>`;
|
||||
// Distinguish "genuinely empty" from "haven't heard back yet".
|
||||
// Blurting "no cards found" during the initial load is scary
|
||||
// on boards the user knows aren't empty.
|
||||
if (!state.cardsLoaded) {
|
||||
board.innerHTML = `<div class="flex flex-col items-center text-center">
|
||||
<i class="ph ph-circle-notch text-4xl text-t-dim mb-4 block card-spinner"></i>
|
||||
<p class="font-pixel text-sm text-t-dim">loading…</p></div>`;
|
||||
} else {
|
||||
board.innerHTML = `<div class="flex flex-col items-center text-center">
|
||||
<i class="ph ph-cards text-4xl text-t-dim mb-4 block"></i>
|
||||
<p class="font-pixel text-sm text-t-dim cursor-blink">no cards found</p></div>`;
|
||||
}
|
||||
const fc = $('footer-count');
|
||||
if (fc) fc.textContent = `0 cards · ${state.cards.length} total`;
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user