From 96b15b75e6b51f37db176ab39bb568130483720f Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 30 Jun 2026 12:42:25 -0400 Subject: [PATCH] feat(web/diagnostics): default to recent 500, move time window to Advanced The diagnostics view already defaulted to the most recent 500 events (no window); make that the obvious path. Device/Kind stay primary; the start/end window + row cap move into a collapsed "Advanced filters" disclosure (auto-opens when a window is active) with a "Reset to recent 500" action. Caption now states whether you're seeing the recent default or a windowed slice. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01K55iTxn95BtshocgdE1shW --- web/src/routes/admin/diagnostics/+page.svelte | 181 +++++++++++------- 1 file changed, 110 insertions(+), 71 deletions(-) diff --git a/web/src/routes/admin/diagnostics/+page.svelte b/web/src/routes/admin/diagnostics/+page.svelte index f6fb0e34..12379cb9 100644 --- a/web/src/routes/admin/diagnostics/+page.svelte +++ b/web/src/routes/admin/diagnostics/+page.svelte @@ -36,13 +36,26 @@ } } + // Default view = the most recent N events, no time window. The + // start/end window is an Advanced affordance. + const DEFAULT_LIMIT = 500; + // Filter state. let accountId = $state(''); let clientId = $state(''); let kind = $state(''); let fromLocal = $state(''); let toLocal = $state(''); - let limit = $state(500); + let limit = $state(DEFAULT_LIMIT); + + // True when an explicit time window is set (drives the caption wording). + const hasWindow = $derived(Boolean(fromLocal || toLocal)); + + function resetWindow() { + fromLocal = ''; + toLocal = ''; + limit = DEFAULT_LIMIT; + } // datetime-local (browser-local, no tz) → RFC3339 UTC the API accepts. function toRfc(v: string): string | undefined { @@ -191,77 +204,97 @@ - -
- - - - - + +
+
+ + -
- - +
+ + +
+ + +
+ + Advanced filters{hasWindow ? ' · window active' : ''} + +
+ + + + +
+
@@ -276,7 +309,13 @@

{:else}
- {rows.length} events (oldest first) + + {#if hasWindow} + {rows.length} events in window (oldest first) + {:else} + Most recent {rows.length} events (oldest first) · set a time window under Advanced + {/if} +
    {#each rows as r (r.id)}