Skip to content

Add search result count and 'no results' message #45

@AnjanJ

Description

@AnjanJ

Description

Improve search experience by showing result count and helpful message when no errors match filters.

Current Behavior

  • When filters return no results, page shows empty list
  • No indication of how many results were found
  • Users may not realize filters are too restrictive

Desired Behavior

  1. Result count: Show "Showing X of Y errors" above list
  2. No results message: When list is empty, show helpful message:
    • "No errors found matching your filters"
    • Suggest removing some filters
    • Show "Clear all filters" button
  3. Empty state: When truly no errors exist, show different message:
    • "No errors logged yet"
    • Show helpful onboarding text

Implementation Hints

  • Check @errors.total_count (from Pagy) for filtered count
  • Check ErrorLog.count for total count
  • Display above error list table
  • Add conditional rendering: if @errors.empty?
  • Style with Bootstrap alert component

Files to Modify

  • /app/views/rails_error_dashboard/errors/index.html.erb - Add count and empty state
  • /app/controllers/rails_error_dashboard/errors_controller.rb - May need to expose total count

Example UI

Showing 23 of 156 errors

[Error list...]

When no results:

┌─────────────────────────────────────┐
│  🔍 No errors found                 │
│                                     │
│  Try removing some filters or      │
│  [Clear All Filters] button        │
└─────────────────────────────────────┘

Good First Issue Because

  • Simple view changes
  • Improves UX significantly
  • Easy to test visually
  • Minimal backend changes

Nice to Have

  • Animated empty state icon
  • Show which filters are active
  • Link to clear individual filters

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions