Skip to content

app/vmui: add back action for hits chart time range - #1594

Open
Loori-R wants to merge 1 commit into
masterfrom
vmui/issue-1535/add-back-to-previous-range
Open

app/vmui: add back action for hits chart time range#1594
Loori-R wants to merge 1 commit into
masterfrom
vmui/issue-1535/add-back-to-previous-range

Conversation

@Loori-R

@Loori-R Loori-R commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Describe Your Changes

Add a Back action to the Hits chart, allowing users to return to the previously selected time range after interacting with the chart.

Related issue: #1535

Behavior

  • the Back button appears after changing the time range by zooming, panning, or clicking a bar
  • the button restores the time range selected before the latest chart interaction
  • only one previous time range is kept
  • a new chart interaction updates the range stored by the Back button
  • changing the time range through the time picker hides the Back button

Demo

restore.previous.range.mov

@Loori-R Loori-R added the web-ui Issues related to the user interface: layout, styling, usability, or UI-specific bugs. label Jul 13, 2026
@Loori-R Loori-R linked an issue Jul 13, 2026 that may be closed by this pull request

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Loori-R
Loori-R force-pushed the vmui/issue-1535/add-back-to-previous-range branch from 47a01ad to aae1a5d Compare July 13, 2026 11:50

@arturminchukov arturminchukov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I just have one nit question. I see that we can go back to the previous state only once.
Clearer behavior for me would be to remember the time range every time I press Execute manually, as well as on every other step that changes the time range. In this case, we could go back several times. Maybe we could also add a Reset button that resets the time range to the original one.

@Loori-R

Loori-R commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Looks good! I just have one nit question. I see that we can go back to the previous state only once. Clearer behavior for me would be to remember the time range every time I press Execute manually, as well as on every other step that changes the time range. In this case, we could go back several times. Maybe we could also add a Reset button that resets the time range to the original one.

Thanks! Just to clarify, pressing Execute itself does not change the time range. The time range can change in three ways:

  1. manually via the time picker;
  2. through an interaction with the chart;
  3. through an expression containing a _time filter.

The current behavior intentionally follows #1535: the Back button appears only after a chart interaction, stores a single previous time range, and disappears when the range is selected manually through the time picker.

Supporting multi-step Back and Reset requires defining history behavior for all time-range changes, including _time filters and relative time, so I suggest keeping this PR scoped to #1535 and handling that separately.

@arturminchukov

Copy link
Copy Markdown
Member

The current behavior intentionally follows #1535: the Back button appears only after a chart interaction, stores a single previous time range, and disappears when the range is selected manually through the time picker.

Got it. As a user, I expected that after zooming in on the bar chart twice, I'd be able to get back to the original state. So it has confused me a little bit.

@hagen1778

Copy link
Copy Markdown
Contributor

While I like how it works, it still bites me visually. The Back button requires a lot of horizontal space and breaks UI on 14" display:
image

Do you think it can be displayed in a different place so it doesn't compete for horizontal space? Or maybe we can change button text to something shorter: Back to prev range?

@Loori-R

Loori-R commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Do you think it can be displayed in a different place so it doesn't compete for horizontal space? Or maybe we can change button text to something shorter: Back to prev range?

Back to prev range sounds good. We can show the full date range in a tooltip on hover.

@Loori-R
Loori-R force-pushed the vmui/issue-1535/add-back-to-previous-range branch from aae1a5d to 14fa48f Compare July 28, 2026 11:42
@Loori-R

Loori-R commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Updated the button label:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web-ui Issues related to the user interface: layout, styling, usability, or UI-specific bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vmui: add Back to %date - %date button Hits Chart

3 participants