Skip to content

feat: turbo frame for job filter (partial page reload)#4

Merged
eclectic-coding merged 1 commit into
mainfrom
feat/job-filter-turbo-frame
May 25, 2026
Merged

feat: turbo frame for job filter (partial page reload)#4
eclectic-coding merged 1 commit into
mainfrom
feat/job-filter-turbo-frame

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • Wraps the job filter form and results table in a <turbo-frame> so selecting a queue, priority, period, or submitting a class search reloads only that region instead of the full page
  • Fixes select onChange to use requestSubmit() instead of submit()submit() bypasses Turbo's event listener entirely, causing full page reloads regardless of frame context
  • Loads Turbo JS from esm.sh CDN in the engine layout — the engine renders its own <head> so the host app's Turbo was never present on these pages

How it works

  • <turbo-frame id="sqw-jobs-filter" data-turbo-action="advance"> wraps the filter form and #sqw-jobs-table div
  • Form submissions and period/clear link clicks navigate within the frame
  • data-turbo-action="advance" keeps the browser URL and history in sync
  • The existing turbo_stream discard (which targets #sqw-jobs-table directly) continues to work — Turbo Streams operate on the full DOM regardless of frame boundaries
  • Status tab links sit outside the frame and trigger normal full-page navigation as before

Test plan

  • bundle exec rake passes (21 examples)
  • Selecting a queue from the dropdown reloads only the table, not the full page
  • Selecting a priority reloads only the table
  • Clicking a period button (1h / 24h / 7d / All) reloads only the table
  • Submitting the class search reloads only the table
  • URL updates after each filter interaction (back button restores previous filter state)
  • Discarding a job still removes the row inline (turbo stream unaffected)
  • Switching status tabs triggers a full page navigation

🤖 Generated with Claude Code

…resh

Wraps the filter form and results table in a <turbo-frame> so selecting a
queue, priority, period, or submitting a search reloads only that region.
requestSubmit() replaces form.submit() on select onChange so Turbo
intercepts the event rather than bypassing it. data-turbo-action="advance"
keeps the browser URL in sync. Turbo JS loaded from esm.sh in the engine
layout since the engine renders its own <head>.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit 30bd972 into main May 25, 2026
5 checks passed
@eclectic-coding eclectic-coding deleted the feat/job-filter-turbo-frame branch May 25, 2026 15:41
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