Skip to content

feat(requests): enable auto-refresh by default on request monitoring page#1747

Open
Ne0Zone wants to merge 1 commit into
looplj:unstablefrom
Ne0Zone:feat/default-auto-refresh
Open

feat(requests): enable auto-refresh by default on request monitoring page#1747
Ne0Zone wants to merge 1 commit into
looplj:unstablefrom
Ne0Zone:feat/default-auto-refresh

Conversation

@Ne0Zone

@Ne0Zone Ne0Zone commented May 30, 2026

Copy link
Copy Markdown

What this PR does

Sets the auto-refresh toggle on the request monitoring page to enabled (true) by default.

Why

Currently the auto-refresh toggle defaults to false, which means users have to manually enable it every time they visit the request monitoring page or after a page refresh. This is inconvenient for users who want continuous monitoring of their requests.

Changes

  • frontend/src/features/requests/index.tsx: Changed useState(false) to useState(true) for the autoRefresh state.

Testing

  1. Visit the request monitoring page
  2. Verify the auto-refresh toggle is enabled by default
  3. Refresh the page and confirm the toggle remains enabled
  4. Navigate away and return to confirm the behavior persists

…page

The auto-refresh toggle on the request monitoring page defaults to off,
requiring users to manually enable it each session. This change sets
the default to enabled (true) for a better monitoring experience.
@greptile-apps

greptile-apps Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR changes the autoRefresh default from false to true on the request monitoring page, so the 10-second polling interval starts immediately on every visit without requiring a manual toggle.

  • The change is a one-line state initialisation update; the auto-refresh interval logic itself is unchanged.
  • Because the preference lives only in ephemeral React state (not localStorage or the URL), any explicit user opt-out is silently reset on re-mount — the same concern that motivated the pageSizeStorageKey pattern used elsewhere in this file.

Confidence Score: 4/5

Safe to merge; the one-line default change works correctly, though auto-refresh will restart every time the page is mounted regardless of a previous opt-out.

The change is minimal and the auto-refresh interval logic is otherwise untouched. The main gap is that an explicit user opt-out is not honoured across navigation, since the preference is stored only in ephemeral component state rather than localStorage.

frontend/src/features/requests/index.tsx — specifically whether the auto-refresh preference should survive navigation the way page-size does.

Important Files Changed

Filename Overview
frontend/src/features/requests/index.tsx Single-line change flipping autoRefresh initial state from false to true; the preference is not persisted, so an explicit user opt-out is silently undone on re-mount.

Reviews (1): Last reviewed commit: "feat(requests): enable auto-refresh by d..." | Re-trigger Greptile

);
const debouncedModelIDFilter = useDebounce(modelIDFilter, 300);
const [autoRefresh, setAutoRefresh] = useState(false);
const [autoRefresh, setAutoRefresh] = useState(true);

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.

P2 User preference not persisted across navigation

autoRefresh lives only in ephemeral React state. If a user disables auto-refresh and then navigates away and returns, the state reinitialises to true — effectively ignoring their explicit opt-out. The PR description describes this navigation-and-return cycle as expected behaviour ("Navigate away and return to confirm the behavior persists"), but what persists is the default, not the user's choice. Consider persisting this preference to localStorage (keyed e.g. requests-auto-refresh) so an explicit toggle is honoured across mounts, the same pattern used by pageSizeStorageKey for page size.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@looplj

looplj commented Jun 1, 2026

Copy link
Copy Markdown
Owner

应该没必要,一直刷新挺耗资源的。一般也不会一直盯着 request 页面吧。

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.

2 participants