Skip to content
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

[HDX-44] Time Query Presets Should Fill Absolute Time Range #53

Closed
MikeShi42 opened this issue Oct 1, 2023 · 1 comment
Closed

[HDX-44] Time Query Presets Should Fill Absolute Time Range #53

MikeShi42 opened this issue Oct 1, 2023 · 1 comment
Labels
linear Created by Linear-GitHub Sync

Comments

@MikeShi42
Copy link
Contributor

MikeShi42 commented Oct 1, 2023

Today when you click "Past 12h" the time query will become "Past 12h", this is problematic if you revisit the page later and try to refresh the page, expecting it to load the newest 12h of data but instead it will keep the same old static view.

Instead, the presets should just "materialize" the relative query into the actually timestamps like we do with every other query.

From SyncLinear.com | HDX-45

@MikeShi42 MikeShi42 changed the title [HDX-44] Time Query Presets Should Fill Absolute Time Range [HDX-45] [HDX-44] Time Query Presets Should Fill Absolute Time Range Oct 1, 2023
@MikeShi42 MikeShi42 changed the title [HDX-45] [HDX-44] Time Query Presets Should Fill Absolute Time Range [HDX-44] Time Query Presets Should Fill Absolute Time Range Oct 1, 2023
@MikeShi42
Copy link
Contributor Author

Some discussion notes, since this relates to our useTimeQuery hook and the complexity behind it.

If you change all relative/preset queries into an absolute time query ex. "Sept 30 14:00:00 - …" this would solve the confusing UX.

There's a thought that we can eliminate the tq query param as an input to the useTimeQuery hook because once the time query is always an absolute value, it can be derived from the from and to query params.

We still need to preserve the tq for user use on initial load, as some users specify a relative tq in the URL for internal tools linking into HyperDX.

This combined with some fixes to the useQueryHook (that has a ton of bugs) will likely simplify the useTimeQuery hook substantially.

@MikeShi42 MikeShi42 added the linear Created by Linear-GitHub Sync label Oct 1, 2023
kodiakhq bot pushed a commit that referenced this issue Oct 29, 2023
## Context

This PR relates to #53. From a chat with @MikeShi42 a while back we were discussing the UX of the time query presets (e.g. "Past 1h") and how it's kind of confusing atm. Once you click a preset, the label will remain as "Past 1h" and add a `from` and `to` param to the url. If after some time you refresh the page, the label will still say "Past 1h" but the `from` and `to` are the old values. At the same time, the existing useTimeQuery hook has a ton of complex logic which makes it very tricky to modify without causing regressions.

## This PR

Create a new version of the useTimeQuery hook (temporarily calling it useNewTimeQuery) and add detailed unit testing to it for all the different cases. This can eventually be used to replace all the existing callsites of the useTimeQuery hook. For the search page, we can move all the live tail functionality into a separate hook and integrate with this new time query hook to have better separation of concerns and make them both easier to maintain. I'll be making a separate PR for the live tail functionality.
@MikeShi42 MikeShi42 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

1 participant