Skip to content

Show the right message while the form list loads, fails or finds nothing - #249

Merged
PhilReinking merged 17 commits into
mainfrom
fix/bits-256-list-states
Oct 12, 2026
Merged

PhilReinking merged 17 commits into
mainfrom
fix/bits-256-list-states

Conversation

@PhilReinking

@PhilReinking PhilReinking commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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

  • First load: skeleton rows, tabs without counts. A sort change keeps the list, faded, with aria-busy.
  • Failed load: "Couldn't load your forms." and "Try again", only for the list that failed.
  • No match: "Clear search", "Show all forms" or "Show archived forms", then focus moves to the search.
  • A live region reads "3 forms" after a pause in typing. Only the latest list answer counts.
  • First-run card only when the team has no forms, archived ones included.
  • Row actions move the form between lists without loading. A restore reloads once for the sort order.
  • A row that leaves its tab hands focus to the next row's menu, else Create form.
  • The toast sits outside the faded card.

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

PhilReinking and others added 6 commits October 12, 2026 10:10
… 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>
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 PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread resources/js/Pages/Dashboard.vue Outdated
</div>
</div>
<div v-else class="px-6 py-14 text-center">
<p class="text-sm text-grey-600">{{ noMatch }}</p>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
<p class="text-sm text-grey-600">{{ noMatch }}</p>
<p class="break-words text-sm text-grey-600">{{ noMatch }}</p>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 99bb8db with break-words. At 360 px an 80-letter search no longer widens the page.

PhilReinking and others added 6 commits October 12, 2026 10:28
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 PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@PhilReinking
PhilReinking changed the base branch from feat/bits-255-search-filter-sort to main October 12, 2026 09:38
@PhilReinking PhilReinking reopened this Oct 12, 2026
PhilReinking and others added 4 commits October 12, 2026 11:58
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 PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@PhilReinking
PhilReinking merged commit 7e710b1 into main Oct 12, 2026
6 checks passed
@PhilReinking
PhilReinking deleted the fix/bits-256-list-states branch October 12, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant