feat: complete catalog sensitivity enhancements
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
type DescriptionGenerationRun,
|
||||
unlockDescriptionGenerationRun,
|
||||
} from "../../api/catalog-databases";
|
||||
import { useTailFollowing } from "../activityScroll";
|
||||
import { FleetLedgerDrawer } from "./FleetLedgerShell";
|
||||
|
||||
interface Props {
|
||||
@@ -106,6 +107,17 @@ export function DescriptionGenerationDrawer({
|
||||
() => (historyQuery.data ?? []).filter((item) => !databaseId || item.databaseId === databaseId),
|
||||
[databaseId, historyQuery.data],
|
||||
);
|
||||
const latestEventSequence = events.at(-1)?.sequence ?? 0;
|
||||
const {
|
||||
followingTail: followingEventTail,
|
||||
handleScroll: handleEventLogScroll,
|
||||
jumpToTail: jumpToLatestEvent,
|
||||
viewportRef: eventLogRef,
|
||||
} = useTailFollowing<HTMLDivElement>({
|
||||
active: open && Boolean(run),
|
||||
resetKey: runId,
|
||||
tail: latestEventSequence,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!open || initialRun || !visibleHistory[0]) return;
|
||||
@@ -427,11 +439,22 @@ export function DescriptionGenerationDrawer({
|
||||
<section className="thot-catalog-drawer__events mt-3" aria-label="Description generation log">
|
||||
<div className="mb-2 flex items-center justify-between">
|
||||
<h3 className="thot-label">Events</h3>
|
||||
<span className="text-xs tabular-nums text-muted-foreground">{events.length}</span>
|
||||
<div className="flex items-center gap-2">
|
||||
{!followingEventTail && events.length > 0 ? (
|
||||
<Button type="button" variant="outline" size="xs" onClick={jumpToLatestEvent}>
|
||||
Jump to latest
|
||||
</Button>
|
||||
) : null}
|
||||
<span className="text-xs tabular-nums text-muted-foreground">{events.length}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
ref={eventLogRef}
|
||||
role="log"
|
||||
aria-label="Description generation events"
|
||||
aria-relevant="additions"
|
||||
tabIndex={0}
|
||||
onScroll={handleEventLogScroll}
|
||||
className="thot-catalog-drawer__event-log overflow-y-auto rounded-md bg-zinc-950 p-3 font-mono text-xs leading-5 text-zinc-200"
|
||||
>
|
||||
{events.length === 0 ? <p className="text-zinc-500">Waiting for events…</p> : events.map((event) => (
|
||||
|
||||
Reference in New Issue
Block a user