Skip to content

Fix events search/filter silently missing results beyond the first page - #227

Merged
morcen merged 1 commit into
mainfrom
fix/issue-97-events-search-pagination
Sep 17, 2026
Merged

morcen merged 1 commit into
mainfrom
fix/issue-97-events-search-pagination

Conversation

@morcen

@morcen morcen commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

What was broken

The Events management page's search box and type filter (resources/js/Pages/Events/Index.vue) filtered purely client-side over props.events.data, which is only the current paginated page (15 records) returned by DashboardController::events(). For any account with more than one page of events, searching for (or filtering by type of) an event that existed on another page silently showed the "No events found" empty state, even though a real match existed. The type dropdown had the same problem: it only listed event_type values present on the currently loaded page, so types that only occurred on other pages never appeared as filter options at all.

This is worse than not having search/filtering, since it looks like it works but silently returns incomplete/wrong results.

What changed

  • DashboardController::events() now applies the search and type query params as server-side WHERE conditions before paginating, so filtering runs over the full result set instead of just the loaded page.
  • The endpoint now also returns eventTypes, a distinct list of event types across all of the user's events (not just the current page), so the type dropdown is complete.
  • Events/Index.vue submits search/type as query params via Inertia's router.get (on Enter for the search box, on change for the type select), mirroring the pattern already used on the Deliveries page's applyFilters(). The old client-side-only filtering computed properties were removed since filtering now happens server-side.

Tests

Added tests/Feature/DashboardEventsSearchFilterTest.php, covering:

  • Search finds a matching event even when 15+ other events exist (i.e. the match would previously have been on page 2 and missed).
  • Type filter finds a matching event under the same condition.
  • The eventTypes prop lists types across all of a user's events, not just the current page.
  • Search results stay scoped to the authenticated user's own events.

Full suite: composer test — 260 passed, 1 skipped.

Fixes #97

🤖 Generated with Claude Code

https://claude.ai/code/session_012RH3zCxQdDbtSWbnGrvDaC

Events/Index.vue filtered the search box and type dropdown purely
client-side over props.events.data, which is only the current
paginated page (15 records). Any account with more than one page of
events would see "No events found" for a search term or type that
existed on another page, even though a real match existed.

DashboardController::events() now applies the search/type filters
server-side before paginating, and returns the full list of distinct
event types (not just the ones on the current page) so the type
dropdown is complete. The Vue page submits filters as query params via
Inertia's router.get, mirroring the pattern already used on the
Deliveries page.

Fixes #97

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012RH3zCxQdDbtSWbnGrvDaC
@morcen
morcen merged commit 4582e70 into main Sep 17, 2026
2 checks passed
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.

Events Index.vue search/type filter only operates on the current paginated page, silently hiding real results

1 participant