Skip to content

[FEATURE] Add disable_auto_refresh config - #212

Merged
jgbernalp merged 7 commits into
perses:mainfrom
mixturesolutions:feat/4295-disable-auto-refresh
Aug 20, 2026
Merged

[FEATURE] Add disable_auto_refresh config#212
jgbernalp merged 7 commits into
perses:mainfrom
mixturesolutions:feat/4295-disable-auto-refresh

Conversation

@mixturesolutions

@mixturesolutions mixturesolutions commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

Adds an optional admin config flag to centrally disable dashboard auto-refresh, addressing perses/perses#4295

Default: false (no behavior change unless explicitly enabled)

When enabled:

  • The auto-refresh interval dropdown is hidden in the UI
  • Dashboard refreshInterval and ?refresh= URL param are ignored
  • Follows the same pattern as disable_custom and disable_zoom

Note this is linked with another PR in the main perses repo

Screenshots

To enable, change in the respective perses config yaml file like the following:
Screenshot 2026-07-30 at 2 09 37 PM

Once the changes are deployed, config page will reflect the changes and the dashboard ui will look like:
image

Originally looks like:
image

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • E2E tests are stable and unlikely to be flaky.
    See e2e docs for more details. Common issues include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

…a server config (default false)

Signed-off-by: Iris Ye <iris.ye.cs@gmail.com>
@mixturesolutions
mixturesolutions force-pushed the feat/4295-disable-auto-refresh branch from 2e9c4cb to e7d4d0f Compare August 4, 2026 14:22
@mixturesolutions mixturesolutions changed the title [FEATURE] Allow admins to centrally disable dashboard auto-refresh via server [FEATURE] Add disable_auto_refresh config Aug 4, 2026
@jgbernalp

Copy link
Copy Markdown
Contributor

@mixturesolutions mind checking the tests and lint failures?

Comment thread plugin-system/src/runtime/TimeRangeProvider/TimeRangeProvider.tsx Outdated
Comment thread plugin-system/src/runtime/TimeRangeProvider/query-params.ts Outdated
mixturesolutions and others added 2 commits August 6, 2026 08:50
Co-authored-by: Gabriel Bernal <gabrielbernalp@gmail.com>
Signed-off-by: Iris Ye <143642859+mixturesolutions@users.noreply.github.com>
Signed-off-by: Iris Ye <iris.ye.cs@gmail.com>

@ibakshay ibakshay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Job! I left a minor comment. I also tested manually. Everything is working as expected! 🚀

Comment on lines +99 to +101
if (isAutoRefreshDisabled) {
return;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is redundant. The picker is disabled when isAutoRefreshDisabled is true
(line 239), so onChange never fires and this handler is never called. So, this check is safe to be removed.

Signed-off-by: Iris Ye <iris.ye.cs@gmail.com>
@Gladorme

Copy link
Copy Markdown
Member

I was wondering if it is not better to "hide" the selector, instead of disabled effect?
Because having a disabled selector taking place for nothing, could be bothering (at least to me)

Maybe more a question for people that want this feature 😄

@mixturesolutions

Copy link
Copy Markdown
Contributor Author

I was wondering if it is not better to "hide" the selector, instead of disabled effect? Because having a disabled selector taking place for nothing, could be bothering (at least to me)

Maybe more a question for people that want this feature 😄

@ibakshay Since you suggested the feature, what do you think?

@ibakshay

Copy link
Copy Markdown
Contributor

I was wondering if it is not better to "hide" the selector, instead of disabled effect? Because having a disabled selector taking place for nothing, could be bothering (at least to me)
Maybe more a question for people that want this feature 😄

@ibakshay Since you suggested the feature, what do you think?

Yes, hiding is fine with me. :) @mixturesolutions

@mixturesolutions
mixturesolutions force-pushed the feat/4295-disable-auto-refresh branch 10 times, most recently from c366771 to d2ad478 Compare August 19, 2026 15:12
);
const refreshIntervalPicker = screen.getByLabelText(/Select refresh interval/i);
expect(refreshIntervalPicker).not.toHaveAttribute('aria-disabled', 'true');
expect(screen.queryByText('Off')).not.toBeInTheDocument();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this makes sense, are we saying we hide the off option. So users cannot turn off the auto refresh? IIUC the goal is to hide the whole select component as users are not allowed to select any value. cc @ibakshay @mixturesolutions

@mixturesolutions mixturesolutions Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, the changes hides the entire refresh interval dropdown when disabled is true. It's just in the case of my ui display during testing, the picker defaults to off option, so the comment was highlighting the "Off" as representing the disabled state of the entire picker. I changed the PR to make the comment less ambiguous. Please reference the description UI photos if it matches what you had in mind.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thnx for the update, this test was getting the refresh interval picker and asserting content on it, but the suggestion was to remove the picker entirely as is updated now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the last change reverted, maybe we need to check again as this test is asserting something different than the proposal. The test should check that the interval picker does not exist in the DOM.

@mixturesolutions mixturesolutions Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was fixing the commit message for DCO and reverted my commits a couple times and repushed, it might have gotten the git commits out of sync with my current testing environment setup. It was my bad. Everything should be good now.

@mixturesolutions
mixturesolutions force-pushed the feat/4295-disable-auto-refresh branch 2 times, most recently from 96e91cb to fab9473 Compare August 19, 2026 16:42
…nabled

Signed-off-by: Iris Ye <iris.ye.cs@gmail.com>
@mixturesolutions
mixturesolutions force-pushed the feat/4295-disable-auto-refresh branch from fab9473 to 920c5a9 Compare August 19, 2026 16:51
Signed-off-by: Iris Ye <143642859+mixturesolutions@users.noreply.github.com>
value?: DurationString;
onChange: (value: DurationString) => void;
height?: string;
disabled?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed as is unused, the whole component is not rendered

@mixturesolutions
mixturesolutions force-pushed the feat/4295-disable-auto-refresh branch from 087bfe3 to dad1325 Compare August 19, 2026 17:15
…om previous disabling feature

Signed-off-by: Iris Ye <iris.ye.cs@gmail.com>
@mixturesolutions
mixturesolutions force-pushed the feat/4295-disable-auto-refresh branch from b93c6b6 to 10a5a99 Compare August 19, 2026 17:27

@ibakshay ibakshay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@jgbernalp jgbernalp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgbernalp
jgbernalp merged commit be78e66 into perses:main Aug 20, 2026
13 checks passed
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.

4 participants