feat(requests): enable auto-refresh by default on request monitoring page#1747
feat(requests): enable auto-refresh by default on request monitoring page#1747Ne0Zone wants to merge 1 commit into
Conversation
…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 SummaryThis PR changes the
Confidence Score: 4/5Safe 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
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); |
There was a problem hiding this comment.
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!
|
应该没必要,一直刷新挺耗资源的。一般也不会一直盯着 request 页面吧。 |
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: ChangeduseState(false)touseState(true)for theautoRefreshstate.Testing