Skip to content

Conversation

@haileyok
Copy link
Collaborator

@haileyok haileyok commented Dec 3, 2025

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 onExecutedQueryIntervalChange when 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

  • Empty query input still works, and query interval changes are still reflected
  • Writing a query and adjusting the interval before submitting does not execute a query
  • Submitting a query uses the selected query interval
  • Modifying the query interval without modifying the existing query filter input updates the active interval
  • Interval changes do not get executed after modifying the query input
  • Selected interval changes to the correct value when selecting a saved/historical query
Video_2025-12-03_11-44-10.mp4

@julietshen
Copy link
Member

hi @haileyok ! Is this PR ready for review?

@haileyok
Copy link
Collaborator Author

haileyok commented Jan 9, 2026

@julietshen yep!

Copy link

Copilot AI left a 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 selectedInterval state 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.

@haileyok haileyok merged commit cd5c84c into main Jan 15, 2026
4 checks passed
@cassidyjames cassidyjames added this to the 1.0 milestone Jan 15, 2026
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.

5 participants