Skip to content

Date/recent time-range picker and a bounded-by-default All Messages view - #3106

Merged
ramonsmits merged 2 commits into
ramon/audit-query-uxfrom
ramon/audit-super-date-picker
Sep 10, 2026
Merged

ramonsmits merged 2 commits into
ramon/audit-query-uxfrom
ramon/audit-super-date-picker

Conversation

@ramonsmits

@ramonsmits ramonsmits commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Stacked on:

Second PR in the audit query series. Makes the All Messages view bounded by default and gives users control over expensive queries. On a ~158M-message store the unbounded default query took 15–17 s; bounded to a recent window it returns in 1–2 s.

Time range picker (Sent: chip)

  • Replaces the calendar-only date range control with a compact chip in the query bar labeled for what it filters (time_sent)
  • Bounds are text expressions: relative (now-6h, now-1d/d) or tolerant RFC 3339 (2026-08-31Z, offsets honored); a pasted ISO 8601 interval splits across both bounds. Timestamps are frequently copied from logs, which is why typing/pasting is first-class next to the Grafana-style presets
  • Expressions stay in the URL and resolve at query time, so shared links and auto-refresh windows keep sliding
  • Default is the last 6 hours; a different default can be saved per browser, or the range cleared entirely
  • A timed-out query offers the next-narrower presets as one-click buttons; a query with no time filter is called out as an unbounded scan

Review feedback applied:

  • Grafana-style editor with a calendar per bound. The editor is two columns: the absolute range on the left with From and To on their own rows and a calendar button beside each, the quick ranges listed on the right. The calendar is the browser's own date picker (no picker library; date-only, so it closes on the day click), opened on the day the field currently resolves to. The day lands in the field and the time the field already says is kept, a UTC marker included; a field without an absolute time gets the start of the day for From and its end for To. Text stays the source of truth, so relative expressions and pasted timestamps work as before
  • "to" instead of an arrow between the bounds, on the chip, in the tooltip and on the default line. A range ending now is shown as its start only (now-90m), since "last N" is what it means
  • Old picker removed. DatePickerRange.vue and @vuepic/vue-datepicker had no remaining users and are gone
  • Diagnostics line removed. The "UTC … · local … · live" line under the editor is gone; the editor only gives feedback when the draft cannot be applied, and the resolved window remains as the chip tooltip

Still open from the review: the popover API for the popup and the presets as links. The wider From field no longer cuts the placeholder off.

The rest of the original scope of this PR moved into separate stacked PRs (see the stack list in the follow-up PRs).

@ramonsmits ramonsmits changed the title Super date picker and a bounded-by-default All Messages view New date/recent picker and a bounded-by-default All Messages view Sep 3, 2026
@ramonsmits ramonsmits added the Improvement Improvement label Sep 3, 2026
@ramonsmits ramonsmits added this to the 2.11.0 milestone Sep 3, 2026
@ramonsmits
ramonsmits force-pushed the ramon/audit-super-date-picker branch from 161f469 to fcebabe Compare September 4, 2026 21:58
@jpalac jpalac modified the milestones: 2.11.0, 2.12.0 Sep 6, 2026

@johnsimons johnsimons 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.

@ramonsmits there is a lot going on here.
Would it be possible to split this PR into more manageable slices.
Example:

  • The new date range picker on its own
  • The history for the search
  • The reorganizing of the UI
  • ....

@johnsimons

Copy link
Copy Markdown
Member

I haven't had time to look at the code yet @ramonsmits, but a few things to consider based on the screenshots.

  • Could the "history" be built into the text field, so, in other words, when the user's focus is on the search text field, we have a floating panel below it that shows them the history options? I kind of understand why you want to make it a separate dropdown because it is the history for the whole combined filters, but its location at the moment feels associated with the text field.
  • The date ranges using now-2d, I do like it. It reminds me of Grafana; it may be useful to look at the Grafana UI and get some ideas from it.
    image
    image
  • I am not sold on this text, it is hard to figure out what it says
    image
  • I think local vs utc times should be app wide not specific per screen
    image

@ramonsmits

Copy link
Copy Markdown
Member Author

@ramonsmits there is a lot going on here. Would it be possible to split this PR into more manageable slices. Example:

  • The new date range picker on its own
  • The history for the search
  • The reorganizing of the UI
  • ....

@johnsimons I understand, I'll check if I can split these.. thing is.. I already have 3 stacked PRs and this means even more stacked ones many share the same base.

@ramonsmits

Copy link
Copy Markdown
Member Author
  • Could the "history" be built into the text field, so, in other words, when the user's focus is on the search text field, we have a floating panel below it that shows them the history options? I kind of understand why you want to make it a separate dropdown because it is the history for the whole combined filters, but its location at the moment feels associated with the text field.

exactly this, its currently the combination.

  • The date ranges using now-2d, I do like it. It reminds me of Grafana; it may be useful to look at the Grafana UI and get some ideas from it.

Guess what the inspiration was ;-)

The difference was that I wanted a way to be able to paste timestamps as these are frequently copy/pasted from logs etc.

Do you miss anything critical? Already the ability to select options and also ability to enter timestamps with zone offsets or UTC is supported.

I do like the refresh style... maybe I can tweak that a bit more.

  • I am not sold on this text, it is hard to figure out what it says

TBH that is more for diagnostics to validate if the conversion from text input to url output was happening correctly. I'll update it to only show the resolved timezone offset (utc, local or specific offset)

  • I think local vs utc times should be app wide not specific per screen

I partially agree, there might be value in having user (or maybe only local) specific settings but in the primary use case for this screen is diagnostics based on data provided from support inquiries where a timestamp is likely not always fixed.

My assumption is that a user wants by default to show time based on their system settings on all screens. However, this screen specifically is search related to diagnostics (local) but engineers frequently want to see timestamps in UTC too for comparing as that is what servers usually are set to or in which timestamps are actually stored.

@johnsimons johnsimons 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.

I still think we need to have a calendar picker for dates, same as what Grafana provides
Image

Comment thread src/Frontend/src/components/audit/SuperDatePicker.vue
Comment thread src/Frontend/src/components/audit/SuperDatePicker.vue Outdated
Comment on lines +173 to +175
<button v-for="preset in rangePresets" :key="preset.label" type="button" class="quick-item" @click="applyPreset(preset.from, preset.to)">
{{ preset.label }}
</button>

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.

These are styled as links. Have you considered just making these a elements instead

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, but IMHO button is the right type, it isn't a link.

Comment thread src/Frontend/src/components/audit/SuperDatePicker.vue Outdated
@johnsimons

Copy link
Copy Markdown
Member

You can delete @/components/audit/DatePickerRange.vue" and also remove the @vuepic/vue-datepicker npm package

@ramonsmits
ramonsmits dismissed johnsimons’s stale review September 9, 2026 11:06

Addressed comment by adding a date picker similar to grafana

@ramonsmits
ramonsmits force-pushed the ramon/audit-super-date-picker branch from 77b8c73 to 931f0f6 Compare September 9, 2026 12:20
@mauroservienti
mauroservienti force-pushed the ramon/audit-super-date-picker branch from 931f0f6 to 3327709 Compare September 9, 2026 13:01
Replaces the calendar-only date range control with a compact chip in
the query bar, "Sent: Last 6 hours", labeled for what it filters
(time_sent) and styled like the neighboring dropdowns. The chip shows
the preset name, the live expression ("now-90m"; a range ending now is
what "last N" means) or "start to end" for an absolute range; the
resolved window in UTC and local time is its tooltip.

The editor is laid out like Grafana's: the absolute range on the left
with From and To on their own rows, the quick ranges listed on the
right. Each bound accepts relative expressions that stay live (now,
now-6h, now/d, now-1d/d), tolerant RFC 3339 (T or space separator,
seconds optional, zone optional; zone-less is local, Z forces UTC,
explicit offsets are honored) and pasted ISO 8601 intervals split
across both bounds; a hint under the fields says so. A calendar button
per bound opens the browser's own date picker (day only, so it closes
on the day click) and writes the day into the field while keeping the
time the field already says.

A timed-out query offers the two next-narrower presets as one-click
buttons (query cost grows with the window), and a query with no time
filter at all is called out as an unbounded scan of the whole store.

A per-browser default decides what the view opens on; the factory
default is the last 6 hours, so opening the view never scans the whole
audit store. Ranges travel in the URL as expressions, so shared links
re-evaluate and live ranges slide with auto-refresh.

The popup is not a Popover API popover: a popover sits in the top
layer, centred, and anchoring it under the chip needs CSS anchor
positioning, which Firefox ESR does not have yet.
DatePickerRange.vue lost its only user when the Sent chip took over the
filters panel; nothing else imported it or @vuepic/vue-datepicker, so
both go, along with the package's stylesheet from the bundle.
@ramonsmits
ramonsmits force-pushed the ramon/audit-super-date-picker branch from 3327709 to 81ee053 Compare September 10, 2026 08:58
@ramonsmits
ramonsmits merged commit ca79186 into master Sep 10, 2026
9 checks passed
@ramonsmits
ramonsmits deleted the ramon/audit-super-date-picker branch September 10, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants