Date/recent time-range picker and a bounded-by-default All Messages view - #3106
Date/recent time-range picker and a bounded-by-default All Messages view#3106ramonsmits wants to merge 3 commits into
Conversation
161f469 to
fcebabe
Compare
johnsimons
left a comment
There was a problem hiding this comment.
@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
- ....
|
I haven't had time to look at the code yet @ramonsmits, but a few things to consider based on the screenshots.
|
@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. |
exactly this, its currently the combination.
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.
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 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. |
fcebabe to
c55fca7
Compare
c55fca7 to
376729b
Compare
376729b to
fe6c289
Compare
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, live expressions, or a compact resolved range; the full dual-zone RFC 3339 detail is its tooltip. Clicking opens the editor: 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, 2026-08-31Z forces UTC, explicit offsets are honored) and pasted ISO 8601 intervals split across both bounds, with a live echo showing the resolved range in UTC and local time. Quick presets and a per-browser default complete it: 'Save current range as default' (confirmed, with reset) decides what the view opens on — 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.
Query cost grows with the time window, so the error banner now explains that and offers the two next-narrower presets as buttons (widest first). A query with no time filter at all gets called out explicitly — an unbounded scan of the whole audit store is the most likely reason it timed out — with the widest bounded presets as the escape hatch.
The "UTC … · local … · live" line under the range editor was a development aid to check the expression-to-URL conversion and was hard to read. It is gone; the editor only shows feedback when the draft cannot be applied. The resolved window (UTC and local) stays available as the tooltip of the collapsed chip.
fe6c289 to
e9a04e1
Compare
| async function toggleOpen() { | ||
| open.value = !open.value; | ||
| if (open.value) { | ||
| // Discard unapplied edits from a previous visit | ||
| fromText.value = timeRangeFrom.value; | ||
| toText.value = timeRangeTo.value; | ||
| await nextTick(); | ||
| fromInput.value?.focus(); | ||
| } | ||
| } | ||
|
|
||
| function onOutsidePointer(event: PointerEvent) { | ||
| if (open.value && root.value && !root.value.contains(event.target as Node)) open.value = false; | ||
| } | ||
| function onKeydown(event: KeyboardEvent) { | ||
| if (event.key === "Escape") open.value = false; | ||
| } | ||
| onMounted(() => document.addEventListener("pointerdown", onOutsidePointer)); | ||
| onBeforeUnmount(() => document.removeEventListener("pointerdown", onOutsidePointer)); |
There was a problem hiding this comment.
A lot of this code can be removed if you use the popover api, it has all this build into it 😉
| @keydown.enter="apply" | ||
| @paste="onPaste" | ||
| /> | ||
| <span class="arrow" aria-hidden="true">→</span> |
There was a problem hiding this comment.
This is my preference, but have you considered using the word "to" instead of an arrow?
| <button v-for="preset in rangePresets" :key="preset.label" type="button" class="quick-item" @click="applyPreset(preset.from, preset.to)"> | ||
| {{ preset.label }} | ||
| </button> |
There was a problem hiding this comment.
These are styled as links. Have you considered just making these a elements instead
| spellcheck="false" | ||
| autocomplete="off" | ||
| aria-label="Time range start" | ||
| placeholder="now-6h or 2026-09-01 08:00Z" |
|
You can delete @/components/audit/DatePickerRange.vue" and also remove the @vuepic/vue-datepicker npm package |






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)time_sent)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 presetsReview feedback applied: the "UTC … · local … · live" diagnostics line under the editor is gone. The editor only gives feedback when the draft cannot be applied; the resolved window remains as the chip tooltip.
The rest of the original scope of this PR moved into separate stacked PRs (see the stack list in the follow-up PRs).