Resolve ui stuff

This commit is contained in:
Hugh Kaznowski
2026-09-05 18:00:56 +01:00
parent 00c21c8032
commit 070e835fa4
11 changed files with 350 additions and 261 deletions
+18 -5
View File
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState, type ReactNode } from 'react'
import { NavMenu } from './components/NavMenu'
import { FilterBar } from './components/FilterBar'
import { LogTimeline, computePresetRange, type TimeRange, type TimeRangePresetId } from './components/LogTimeline'
import { LogTimeline, computeBucketMs, computePresetRange, type TimeRange, type TimeRangePresetId } from './components/LogTimeline'
import { LogPreview } from './components/LogPreview'
import { Params } from './components/Params'
import { Metrics } from './components/Metrics'
@@ -122,7 +122,13 @@ function StandaloneLog() {
}
try {
const [nextBuckets, nextLogs] = await Promise.all([
fetchTimeline({ startMs: effectiveRange?.startMs, endMs: effectiveRange?.endMs, filter: filter || undefined }),
fetchTimeline({
startMs: effectiveRange?.startMs,
endMs: effectiveRange?.endMs,
// Only meaningful for a fixed window — 'all' has no span to derive a resolution from, so it keeps the server's default bucketing.
bucketMs: effectiveRange ? computeBucketMs(effectiveRange.endMs - effectiveRange.startMs) : undefined,
filter: filter || undefined,
}),
fetchLogs({ startMs: effectiveRange?.startMs, endMs: effectiveRange?.endMs, limit: 1000, filter: filter || undefined }),
])
if (!cancelled) {
@@ -235,7 +241,13 @@ function FullApp() {
try {
const [nextStats, nextBuckets, nextLogs] = await Promise.all([
fetchStats(),
fetchTimeline({ startMs: effectiveRange?.startMs, endMs: effectiveRange?.endMs, filter: filter || undefined }),
fetchTimeline({
startMs: effectiveRange?.startMs,
endMs: effectiveRange?.endMs,
// Only meaningful for a fixed window — 'all' has no span to derive a resolution from, so it keeps the server's default bucketing.
bucketMs: effectiveRange ? computeBucketMs(effectiveRange.endMs - effectiveRange.startMs) : undefined,
filter: filter || undefined,
}),
fetchLogs({ startMs: effectiveRange?.startMs, endMs: effectiveRange?.endMs, limit: 1000, filter: filter || undefined }),
])
if (!cancelled) {
@@ -265,7 +277,7 @@ function FullApp() {
<DocsNavProvider>
<div className="flex h-screen w-screen overflow-hidden">
<NavMenu stats={stats} />
<div className="flex min-w-0 flex-1 flex-col">
<div className="flex min-w-0 flex-1 flex-col overflow-y-auto">
<FilterBar
value={filter}
onChange={setFilter}
@@ -277,7 +289,8 @@ function FullApp() {
</>
}
/>
<div className="flex min-h-0 flex-1 flex-col" hidden={logViewerCollapsed}>
{/* min-h-[...] keeps this from being squeezed to 0 by the sections below it in the shared scroll container — flex-1 alone lets a flex item shrink past its content, which let this section's absolutely-unclipped content spill over Params et al instead of the column just scrolling. */}
<div className="flex min-h-[22rem] flex-1 flex-col" hidden={logViewerCollapsed}>
<LogTimeline
buckets={buckets}
range={range}