web: remove Agent jump-to-latest button
This commit is contained in:
@@ -238,31 +238,6 @@
|
|||||||
font-size:9px;
|
font-size:9px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agent-room__jump {
|
|
||||||
position:absolute;
|
|
||||||
z-index:2;
|
|
||||||
left:50%;
|
|
||||||
bottom:14px;
|
|
||||||
transform:translateX(-50%);
|
|
||||||
display:flex;
|
|
||||||
align-items:center;
|
|
||||||
gap:7px;
|
|
||||||
white-space:nowrap;
|
|
||||||
padding:9px 14px;
|
|
||||||
border:1px solid hsl(266 76% 72%/.43);
|
|
||||||
border-radius:99px;
|
|
||||||
background:hsl(256 46% 20%/.96);
|
|
||||||
color:hsl(263 60% 93%);
|
|
||||||
box-shadow:0 5px 24px hsl(240 70% 2%/.5);
|
|
||||||
font-size:11px;
|
|
||||||
cursor:pointer;
|
|
||||||
backdrop-filter:blur(14px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.agent-room__jump:hover {
|
|
||||||
background:hsl(261 48% 27%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.agent-room__composer-area {
|
.agent-room__composer-area {
|
||||||
flex:none;
|
flex:none;
|
||||||
border-top:1px solid hsl(253 40% 40%/.14);
|
border-top:1px solid hsl(253 40% 40%/.14);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";
|
||||||
import { ArrowDown, Clock3, LoaderCircle, Menu, Paperclip, X, RefreshCw, SendHorizontal, WifiOff } from "lucide-preact";
|
import { Clock3, LoaderCircle, Menu, Paperclip, X, RefreshCw, SendHorizontal, WifiOff } from "lucide-preact";
|
||||||
import type { Message } from "@/lib/api";
|
import type { Message } from "@/lib/api";
|
||||||
import type { AgentRoomHookResult } from "@/hooks/use-agent-room";
|
import type { AgentRoomHookResult } from "@/hooks/use-agent-room";
|
||||||
import { agentTranscriptMessages } from "@/lib/agent-room-presentation";
|
import { agentTranscriptMessages } from "@/lib/agent-room-presentation";
|
||||||
@@ -98,7 +98,6 @@ export function AgentConversation({ room, onOpenSidebar, isVisible = true }: Pro
|
|||||||
const entryAnimationsRef = useRef(new Set<Animation>());
|
const entryAnimationsRef = useRef(new Set<Animation>());
|
||||||
const typingHeightRef = useRef(0);
|
const typingHeightRef = useRef(0);
|
||||||
const historyReadyRef = useRef(!room.isLoading);
|
const historyReadyRef = useRef(!room.isLoading);
|
||||||
const [atBottom, setAtBottom] = useState(true);
|
|
||||||
const scrollerRef = useRef<HTMLDivElement>(null);
|
const scrollerRef = useRef<HTMLDivElement>(null);
|
||||||
const timelineRef = useRef<HTMLDivElement>(null);
|
const timelineRef = useRef<HTMLDivElement>(null);
|
||||||
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||||
@@ -151,7 +150,6 @@ export function AgentConversation({ room, onOpenSidebar, isVisible = true }: Pro
|
|||||||
const jumpToLatest = () => {
|
const jumpToLatest = () => {
|
||||||
pinnedRef.current = true;
|
pinnedRef.current = true;
|
||||||
anchorRef.current = null;
|
anchorRef.current = null;
|
||||||
setAtBottom(true);
|
|
||||||
if (scrollerRef.current) {
|
if (scrollerRef.current) {
|
||||||
scrollerRef.current.scrollTop = scrollerRef.current.scrollHeight;
|
scrollerRef.current.scrollTop = scrollerRef.current.scrollHeight;
|
||||||
restoredScrollTopRef.current = scrollerRef.current.scrollTop;
|
restoredScrollTopRef.current = scrollerRef.current.scrollTop;
|
||||||
@@ -305,7 +303,6 @@ export function AgentConversation({ room, onOpenSidebar, isVisible = true }: Pro
|
|||||||
&& Math.abs(scrollerRef.current.scrollTop - restoredScrollTopRef.current) < 1) return;
|
&& Math.abs(scrollerRef.current.scrollTop - restoredScrollTopRef.current) < 1) return;
|
||||||
const bottom = distanceFromBottom() <= 48;
|
const bottom = distanceFromBottom() <= 48;
|
||||||
pinnedRef.current = bottom;
|
pinnedRef.current = bottom;
|
||||||
setAtBottom(current => current === bottom ? current : bottom);
|
|
||||||
rememberAnchor();
|
rememberAnchor();
|
||||||
if (bottom) scheduleRead();
|
if (bottom) scheduleRead();
|
||||||
}}
|
}}
|
||||||
@@ -317,7 +314,6 @@ export function AgentConversation({ room, onOpenSidebar, isVisible = true }: Pro
|
|||||||
{!running && waiting && activity?.wait ? <div className="agent-room__waiting" role="status"><Clock3 size={13} /><span>Checking back at {timeFormat.format(new Date(activity.wait.due))}</span></div> : null}
|
{!running && waiting && activity?.wait ? <div className="agent-room__waiting" role="status"><Clock3 size={13} /><span>Checking back at {timeFormat.format(new Date(activity.wait.due))}</span></div> : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{!atBottom ? <button className="agent-room__jump" onClick={jumpToLatest}><ArrowDown size={15} /><span>{room.unreadCount ? `${room.unreadCount} new message${room.unreadCount === 1 ? "" : "s"}` : "Jump to latest"}</span></button> : null}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="agent-room__composer-area"
|
<div className="agent-room__composer-area"
|
||||||
|
|||||||
Reference in New Issue
Block a user