Open
Conversation
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.
Add a count preview to maintenance task UI
Summary
Motivation
When running a maintenance task, operators had no way to gauge how many items would be processed beforehand. This made it difficult to assess the impact of a run or verify that parameters were configured correctly. A count preview solves this by showing a live estimate directly on the task show page.
What changed
New
countendpoint (GET /tasks/:id/count)countaction toTasksControllerthat returns{ count: <integer|null> }as JSON.{ count: null }so the UI can hide the indicator instead of showing a broken state.tasksresource.TaskDataShow#countmethod#countmethod, then falling back tocollection.count.nilfor CSV tasks (collection depends on uploaded file content), deleted tasks, and when the query times out.Timeoutto prevent long-running count queries from blocking the endpoint.TaskDataShow#no_collection?methodFrontend (show.html.erb)
#task-countdiv that starts with "Estimating expected items count..." placeholder text.<script>fetches the count on page load and displays it as "N items expected to be processed".focusoutandchangeevents on the task form to re-fetch when parameters are modified.How it looks