Skip to content

Search, filter and sort the form list - #248

Merged
PhilReinking merged 10 commits into
mainfrom
feat/bits-255-search-filter-sort
Oct 12, 2026
Merged

PhilReinking merged 10 commits into
mainfrom
feat/bits-255-search-filter-sort

Conversation

@PhilReinking

Copy link
Copy Markdown
Contributor

The form list gets a search, status tabs with counts and four plain sort options. The choice lives in the URL, and the toolbar fits a phone.

Fixes BITS-255

  • Search filters the loaded list in the browser, by name, ignoring case and accents. "/" focuses it, Esc clears it.
  • Status and sort changes add a history entry, so Back undoes them. Inertia rebuilds the page from the URL.
  • Published and Unpublished filter in the browser; Archived still loads from the server when chosen. Sort still runs on the server.
  • The list sits in a white card, and the date column is "Last edited".
  • A search without a match shows an empty list for now. BITS-256 adds the message.

Heads-up: old dashboard links with ?filter= now show all forms. The URL uses ?status= and short sort names.

Tested: Vitest (the new page tests fail on main), lint, vue-tsc, build. By hand at 1440, 1024, 800, 390 and 360 px, including Back.

Not tested: Firefox, Safari, a real phone.

Screenshots: on BITS-255.

🤖 Generated with Claude Code

PhilReinking and others added 7 commits October 12, 2026 09:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Status tabs with counts on desktop and a select on phones, four sort options
with Recently edited as default, status and sort changes in the browser history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… edited

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 11a9615, CI green. One should, inline.

The 6 page tests also fail on main with $page stubbed, for the missing search, tabs and sort. Odd URL values (lists, repeats, upper case, constructor, old ?filter= and ?sort=created_at:desc) fall back before the API call, so the page only sends sort values the API accepts. "muller", "İSTANBUL", "cafe" and emoji find their forms.

Comment thread resources/js/Pages/Dashboard.vue Outdated

const text = search.toString();
const url = `${window.location.pathname}${text ? `?${text}` : ""}`;
window.history[mode](window.history.state, "", url);

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.

Should: the history entry keeps Inertia's first url ("/"). When Back reloads the page (the browser dropped its cached copy, say after a long edit), Inertia puts that url back: the list falls back to All and Recently edited, and Forward is lost. Setting the url in the copied state fixes it:

Suggested change
window.history[mode](window.history.state, "", url);
// Inertia reads this url when Back reloads the page
const state = window.history.state && { ...window.history.state, url };
window.history[mode](state, "", url);

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 8016b2c with your suggestion, plus a test. Checked by hand: Back that reloads the page keeps status and sort, and Forward works.

PhilReinking and others added 3 commits October 12, 2026 10:13
…ame-value entries

Inertia restores the url from the history state when Back reloads the
page, so the copied state now carries the new url. Picking the current
status or sort again adds no history entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 a14b0ca, CI green.

The Back fix is the suggested one, and the 2 new tests fail on 11a9615 and pass here. The 44 px class lands on the search input and on both select buttons. The darker tab count is about 6.9:1 on the grey tab, where the old one was about 4.3:1.

@PhilReinking
PhilReinking merged commit 5f81e2a into main Oct 12, 2026
6 checks passed
@PhilReinking
PhilReinking deleted the feat/bits-255-search-filter-sort branch October 12, 2026 09:57
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