Filter partitions by state and sort by progress#552
Open
TheSentinel454 wants to merge 1 commit into
Open
Conversation
On the backfill detail page, the partitions table can be long and uniform. Add a state filter (All / RUNNING / PAUSED / COMPLETE / CANCELLED) and make the Progress (%) header click-to-sort (none -> desc -> asc -> none). Both operate client-side via a new Stimulus controller; state is persisted in the URL query string so it survives the 10s auto-reload tick and is shareable. Partitions still computing progress are sorted to the bottom regardless of direction. Also includes dev/seed_partitions.sql for populating an existing backfill with mixed-state synthetic partitions to test the new UI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mpawliszyn
approved these changes
May 11, 2026
Collaborator
mpawliszyn
left a comment
There was a problem hiding this comment.
I'd appreciate @adrw 's review first. But if he doesn't have time, its a small enough change.
| @@ -0,0 +1,47 @@ | |||
| -- Dev-only seed for the partitions table UI (testing filter + sort). | |||
Collaborator
There was a problem hiding this comment.
I don't love how brittle this is but I don't have a better solution right now.
Collaborator
Author
There was a problem hiding this comment.
Yeah, I'm open to just not committing this. I used this locally to just add some test data and agree this isn't the best long term approach. It seemed like a more niche usage for me.
| static targets = ["filter", "tbody", "sortIndicator"]; | ||
|
|
||
| connect() { | ||
| const params = new URLSearchParams(window.location.search); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
?state=RUNNING&sort=progress_desc) so it survives the 10s auto-reload tick and is shareable.dev/seed_partitions.sqlfor populating an existing backfill with mixed-state synthetic partitions to test the new UI locally.Implementation notes
data-partition-state/data-progress-pctattributes are emitted server-side; the controller reads them, hides non-matching rows via thehiddenclass, and reorders viatbody.appendChild.auto_reload_controller.js. Because the controller's element lives inside the partitions turbo-frame, every auto-reload swap triggers a freshconnect()which re-reads the URL and re-applies filter + sort — no custom cross-frame events needed.Test plan
mysql -u root backfila_development --init-command="SET @run_id := <ID>" < dev/seed_partitions.sqlto seed 10 partitions in mixed states.RUNNING— only the 5 running rows remain.Screen.Recording.2026-05-11.at.11.18.14.AM.mov
🤖 Generated with Claude Code