Skip to content

Add the ability to disable auto refresh #1490

Description

@knightq

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

  1. Controller — Update MaintenanceTasks::TasksController#set_refresh to respect a refresh query parameter:

    @refresh = params[:refresh] != "false"
  2. 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.

  3. 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.
  4. 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

  • Task list auto-refreshes by default (no change to current default behavior).
  • Users can disable auto-refresh via a visible control on the task list page.
  • Disabling auto-refresh persists for the session via the ?refresh=false URL parameter.
  • Users can re-enable auto-refresh from the same page.
  • Integration tests cover both refresh states and the toggle links.
  • README documents the feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions