fix(webui): assign readable session handles

This commit is contained in:
chengyongru
2026-08-19 01:15:56 +08:00
committed by chengyongru
parent 251a1ccd40
commit 9e046815bc
20 changed files with 637 additions and 123 deletions
+11 -4
View File
@@ -7,7 +7,7 @@ import {
useRef,
useState,
} from "react";
import type { MouseEvent as ReactMouseEvent, ReactElement } from "react";
import type { CSSProperties, MouseEvent as ReactMouseEvent, ReactElement } from "react";
import {
Archive,
ArchiveRestore,
@@ -50,7 +50,6 @@ import {
} from "@/components/ui/tooltip";
import { MAX_WORKBENCH_PANES } from "@/components/workbench/workbench-model";
import { SIDEBAR_SELECTION_ITEM_CLASS } from "@/components/SidebarSelectionHighlight";
import { SessionHandleLabel } from "@/components/SessionHandleLabel";
import { deriveTitle, relativeTime, visibleSessionPreview } from "@/lib/format";
import {
COLLAPSED_CHATS_VISIBLE_COUNT,
@@ -131,11 +130,19 @@ function SidebarSessionHandle({ handle }: { handle: ChatSummary["handle"] }) {
if (!handle) return null;
return (
<span
data-sidebar-session-handle
className="flex max-w-20 shrink-0 items-center overflow-hidden whitespace-nowrap text-[11px] font-medium leading-5"
>
<SessionHandleLabel id={handle.id}>
<span
data-sidebar-session-handle-underline
className="inline border-b-2 text-foreground"
style={{
"--sidebar-session-handle-color": sessionHandleColor(handle.id),
borderBottomColor: "var(--sidebar-session-handle-color)",
} as CSSProperties}
>
@{handle.name}
</SessionHandleLabel>
</span>
</span>
);
}