AnjanJ / AnjanJ/rails_error_dashboard

Add search result count and 'no results' message

Open
#45 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Ruby
Stars
92
Forks
9
Avg merge
11h 34m
Merged PRs (30d)
54

Description

## 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

Contributor guide

Open the contributing guide

Research direction

Start with app/views/rails_error_dashboard/errors/index.html.erb and inspect how the error list and filters are rendered, then check rails_error_dashboard/errors_controller.rb for pagination and exposed counts. Use @errors.total_count for the filtered count and ErrorLog.count for the overall count. Done means the view shows the count, distinguishes filtered empty results from no logged errors, and provides the described clear-filters or onboarding guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
bootstrap, rails, ruby
Domain
frontend, observability
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.