Add the ability to disable auto refresh
Problem
The Maintenance Tasks web UI auto-refreshes the task list page every 3 seconds to keep run statuses up to date. This behavior is driven by JavaScript in the application layout: when an element with data-refresh is present and truthy, the page periodically fetches the current URL and replaces the refreshed content in place.
While this is useful when monitoring active runs, it can be disruptive in other situations:
- Debugging or inspecting the page — the DOM is replaced every few seconds, making it hard to read logs, copy values, or use browser dev tools.
- Stable UI for screenshots or demos — auto-refresh causes the page to flicker and the cursor to change to a wait state.
- Reduced background activity — unnecessary polling when no runs are in progress or when the operator does not need live updates.
Today there is no way for users to turn this off on the task list page. Auto-refresh is always enabled (@refresh = true in TasksController#set_refresh).
Proposed solution
Add a user-facing toggle on the task list page to disable and re-enable auto-refresh.
Behavior
| State |
URL |
data-refresh attribute |
UI control |
| Default (auto-refresh on) |
/maintenance_tasks/ |
true |
"Disable auto-refresh" link |
| Auto-refresh off |
/maintenance_tasks/?refresh=false |
absent / empty |
"Enable auto-refresh" link |
- Auto-refresh remains on by default so existing behavior is unchanged.
- Disabling auto-refresh sets
?refresh=false on the URL, which the controller reads to set @refresh = false.
- Re-enabling auto-refresh navigates back to the root path without the query parameter.
- The toggle is a small button aligned to the top-right of the task list.
Implementation outline
-
Controller — Update MaintenanceTasks::TasksController#set_refresh to respect a refresh query parameter:
@refresh = params[:refresh] != "false"
-
View — Add toggle links above the task list in app/views/maintenance_tasks/tasks/index.html.erb, and continue to set data-refresh from @refresh so the existing JavaScript respects the preference.
-
Tests — Add integration tests covering:
- Task list auto-refreshes by default (
[data-refresh=true] present).
refresh=false disables auto-refresh ([data-refresh=true] absent).
- Correct toggle link is shown in each state.
-
Documentation — Document the toggle and ?refresh=false URL parameter in the README.
Scope
This change applies to the task list (TasksController#index) only. Individual task show pages already conditionally set data-refresh based on whether there are active runs (@task.refresh?), and that behavior is unchanged.
Acceptance criteria
Add the ability to disable auto refresh
Problem
The Maintenance Tasks web UI auto-refreshes the task list page every 3 seconds to keep run statuses up to date. This behavior is driven by JavaScript in the application layout: when an element with
data-refreshis present and truthy, the page periodically fetches the current URL and replaces the refreshed content in place.While this is useful when monitoring active runs, it can be disruptive in other situations:
Today there is no way for users to turn this off on the task list page. Auto-refresh is always enabled (
@refresh = trueinTasksController#set_refresh).Proposed solution
Add a user-facing toggle on the task list page to disable and re-enable auto-refresh.
Behavior
data-refreshattribute/maintenance_tasks/true/maintenance_tasks/?refresh=false?refresh=falseon the URL, which the controller reads to set@refresh = false.Implementation outline
Controller — Update
MaintenanceTasks::TasksController#set_refreshto respect arefreshquery parameter:View — Add toggle links above the task list in
app/views/maintenance_tasks/tasks/index.html.erb, and continue to setdata-refreshfrom@refreshso the existing JavaScript respects the preference.Tests — Add integration tests covering:
[data-refresh=true]present).refresh=falsedisables auto-refresh ([data-refresh=true]absent).Documentation — Document the toggle and
?refresh=falseURL parameter in the README.Scope
This change applies to the task list (
TasksController#index) only. Individual task show pages already conditionally setdata-refreshbased on whether there are active runs (@task.refresh?), and that behavior is unchanged.Acceptance criteria
?refresh=falseURL parameter.