Repository navigation
Show the right message while the form list loads, fails or finds nothing - #249
Conversation
… nothing Skeleton rows on the first load, the list stays faded during a refetch, an alert with Try again when the load fails, a no-match message with a way back, and the first-run card only when the team has no forms at all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…' into fix/bits-256-list-states
Two quick sort picks could land out of order, so the list showed one sort while the address said another. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A polite live region says "{n} forms" while the search has text, and
why the list is empty when it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
Changes at 389c26c: one must, one nit, inline. No CI yet (stacked on #248).
The 9 new tests fail on the base and pass here, the archived-failure one too. A refetch under a no-match message keeps the live region text, so it isn't read again. The first Archived load shows skeleton rows, not the faded list the PR text says. That looks right to me.
| all?.data.length === 0 && !trashed && !archived.value | ||
| ? await callListForms("trashed", apiSort[sort.value]) | ||
| : trashed; | ||
| if (request !== latest) return; |
There was a problem hiding this comment.
Must: an Archived click drops a load that's still running, but changeStatus fetches only the archived forms. Archived during the first load (or after it failed), then All: skeleton rows, no counts, for good. After a quick sort change, All keeps the old order. Fix at line 277:
// a load still running is replaced, so this one loads the forms too
updateList(isLoading.value || !forms.value);There was a problem hiding this comment.
Fixed in 14bbef4 with your suggestion, plus a test for case (a) that fails without it. Checked by hand: Archived during the first load, then All, shows the list.
| </div> | ||
| </div> | ||
| <div v-else class="px-6 py-14 text-center"> | ||
| <p class="text-sm text-grey-600">{{ noMatch }}</p> |
There was a problem hiding this comment.
Nit: a long search without spaces, like a pasted link, pushes this line past the card, so the page scrolls sideways at 360 px. break-words wraps it, as the form names already do:
| <p class="text-sm text-grey-600">{{ noMatch }}</p> | |
| <p class="break-words text-sm text-grey-600">{{ noMatch }}</p> |
There was a problem hiding this comment.
Fixed in 99bb8db with break-words. At 360 px an 80-letter search no longer widens the page.
Picking Archived during a load dropped that load and fetched only the archived forms, so All stayed on skeleton rows or kept the old order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When only the archived forms failed, All showed the error too, though its forms were loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All showed "No forms." with no way on. It now says "All your forms are archived." with "Show archived forms". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…px on phones Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at f345368. No CI yet (stacked on #248), so it still needs green CI on this commit.
The 5 new or changed tests fail on 389c26c and pass here. An Archived click after a failed first load, or right after a sort change, now ends with All showing its forms in the new order. A Try again that fails again keeps focus on its button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page fades the card and marks it busy during a refetch. The toast and its live region now sit next to the card, so they stay readable and a busy card doesn't hold back what they announce. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Publishing, unpublishing, archiving or restoring a form in its row now moves it to the right status tab and updates the tab counts, without loading the list again. A restored form loads the list once, so it gets its place in the sort. When a row leaves the list, focus goes to the next row's menu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
Changes at 06d6668, CI green: one must, inline.
The merge keeps both sides in FormListTable.vue and CHANGELOG.md. The 5 new tests fail on the code before these commits and pass here. The toast now sits outside the faded card, so it stays clear and is still read out. A dialog in a row that leaves closes without its fade, and the modal still clears the scroll lock when it goes.
| forms.value = form.is_trashed | ||
| ? drop(forms.value, form) | ||
| : put(forms.value, form); | ||
| archived.value = form.is_trashed |
There was a problem hiding this comment.
Must: a row also sends changed after "Delete permanently", still trashed, so put keeps the deleted form in archived. Its row draws nothing: deleting the last archived form leaves an empty card, not "No archived forms.", and no first-run card. A search counts it too. Maybe a deleted event:
// FormListItem.vue, in act()
if (isDeleted.value) emit("deleted", props.form);
else emit("changed", { ...props.form, is_published: isPublished.value, is_trashed: isTrashed.value });
// FormListTable.vue passes it on: @deleted="$emit('deleted', $event)"
// Dashboard.vue: @deleted="dropForm"
const dropForm = (form: FormModel) => {
forms.value = drop(forms.value, form);
archived.value = drop(archived.value, form);
};There was a problem hiding this comment.
Fixed in a9781f5: a deleted row now sends deleted, and the page drops it from both lists. New tests cover it.
After Delete permanently, the row told the page the form was still archived, so the page kept counting it. Deleting the last archived form left an empty card, and a search counted the deleted form. The row now sends deleted, and the page drops the form from both lists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at a9781f5, CI green.
The 2 new checks fail on 06d6668 and pass here. With the page, the list and real rows together, deleting the team's last form shows "Create your first form" and moves focus to Create form. During a search the count drops from 2 forms to 1 and focus goes to the next row's menu. Deleting the last match says so and offers Clear search. Every BITS-256 criterion holds.
The form list says the right thing while it loads, fails or finds nothing, and a row action moves the form to its tab.
Fixes BITS-256
aria-busy.Tested: Vitest (new tests fail without the change, one guard test aside), lint, types, build. All states and row moves by hand at 1440 and 390 px.
Not tested: first run and archived-only with real data. Screen reader by ear.
Screenshots: on BITS-256.
🤖 Generated with Claude Code