-
Notifications
You must be signed in to change notification settings - Fork 13
ui: fix loss of WIP query after changing interval #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
hi @haileyok ! Is this PR ready for review? |
|
@julietshen yep! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an issue where modifying the query interval before submitting a work-in-progress (WIP) query would cause the query text to be lost. The fix introduces a separate selectedInterval state that tracks the user's interval selection independently from the currently executed query's interval.
Changes:
- Added
selectedIntervalstate to track the user's interval selection separately from the executed query's interval - Modified interval change logic to only update the active query when the query filter text hasn't been modified
- Updated the query submission to use the selected interval instead of the prop-based interval
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Currently, if you modify the query input text box and then change the selected query interval, you end up losing whatever WIP query you were writing. This is particularly annoying on a fresh load of the UI, where you may start writing a query and modify the desired interval after writing it - and before submitting it. Particularly since the default interval is "Last Day" - and you often probably don't want to query that far back - it's pretty easy to lose whatever you're working on.
This PR makes some changes to when the active query's interval actually gets updated. To achieve that, we keep two different intervals: the active query's interval (which gets passed in as a prop and only gets used to set the default value of the selected interval), and the selected query interval.
When picking a new interval, we only call
onExecutedQueryIntervalChangewhen the active query filter matches the query filter input's text or when submitting the query itself. We also update the selected interval whenever the executed query changes to reflect interval changes that occur from users selecting a query from the saved/historical queries list.Test Plan
Video_2025-12-03_11-44-10.mp4