fix(frontend): deduplicate live workflow activity

This commit is contained in:
User
2026-07-15 11:55:14 +02:00
parent e7a8bc29b0
commit 279b79516c
8 changed files with 169 additions and 183 deletions
+1 -9
View File
@@ -5,25 +5,17 @@ import remarkGfm from "remark-gfm";
import type { ActivityEntry, ActivityKind } from "../api/types";
import { useSessionStore } from "../store/sessionStore";
import { Button } from "../components/ui/button";
import { isNearBottom } from "./activityScroll";
const VISIBLE_MODEL_ACTIVITY_KINDS: ReadonlySet<ActivityKind> = new Set([
"prompt",
"thinking",
"status",
"gate",
]);
export function isVisibleModelActivity(entry: ActivityEntry): boolean {
return VISIBLE_MODEL_ACTIVITY_KINDS.has(entry.kind);
}
export function isNearBottom(
el: Pick<HTMLElement, "scrollHeight" | "clientHeight" | "scrollTop">,
threshold = 48,
): boolean {
return el.scrollHeight - el.clientHeight - el.scrollTop <= threshold;
}
export function formatModelActivity(text: string): string {
return text
.replace(/\r\n?/g, "\n")