Skip to content

feat: sticky filter preferences via localStorage#72

Merged
eclectic-coding merged 2 commits into
mainfrom
feat/sticky-filter-preferences
May 27, 2026
Merged

feat: sticky filter preferences via localStorage#72
eclectic-coding merged 2 commits into
mainfrom
feat/sticky-filter-preferences

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • Adds a FiltersController Stimulus controller that persists the last-used status tab and period pill to localStorage
  • On connect(), if the URL lacks explicit status/period params (e.g. when clicking the nav link), the controller reads from localStorage and redirects — restoring the previous filter automatically
  • Clicking "All" clears the saved period; any other period pill saves it
  • Jobs page: controller wraps the header + search form so both status tabs and period pills are in scope
  • Failed Jobs / History: controller scoped directly to the period-filter div

Test plan

  • bundle exec rake — 320 examples, 0 failures, 100% coverage, no RuboCop offenses
  • Manual: visit Jobs, click "Failed" tab, click "1h" period, navigate to Dashboard, click "Jobs" nav link — lands on Failed / 1h
  • Manual: click "All" period — clears localStorage period; next nav visit shows All
  • Manual: same flow for Failed Jobs and History period pills

Closes #59

🤖 Generated with Claude Code

eclectic-coding and others added 2 commits May 27, 2026 17:43
Add FiltersController (Stimulus) to persist the last-used status tab
and period pill across page reloads. On connect(), if the URL lacks
explicit status/period params, the controller reads from localStorage
and redirects — so clicking the "Jobs", "Failed", or "History" nav
link always restores where the user left off. Clicking "All" clears
the saved period. No server-side changes required.

- Jobs: wraps header + search form in a filters controller scope;
  status tabs call saveStatus, period pills call savePeriod
- Failed Jobs / History: controller scoped to the period-filter div

Closes #59

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit f928aa4 into main May 27, 2026
5 checks passed
@eclectic-coding eclectic-coding deleted the feat/sticky-filter-preferences branch May 27, 2026 21:44
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.

feat: sticky filter preferences

1 participant