refactor(webui): remove session list previews and timestamps (#6189)

* refactor(webui): remove session list previews and timestamps

* test(webui): limit legacy coverage to persisted sidebar files

* refactor(webui): simplify chat rows and fix gallery states

* refactor(webui): flatten chat row title wrapper
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-14 14:41:52 +08:00
1 parent 47f600afc6
commit cdb6210b45
12 files changed
+62 -97

No files matched your search

+9 -54
View File
@@ -51,8 +51,6 @@ import {
SIDEBAR_SELECTION_ITEM_CLASS,
SidebarSelectionHighlight,
} from "@/components/SidebarSelectionHighlight";
import { visibleSessionPreview } from "@/lib/format";
import { relativeTime } from "@/lib/format-time";
import {
COLLAPSED_CHATS_VISIBLE_COUNT,
displayTitle,
@@ -254,8 +252,6 @@ interface ChatListProps {
updatedChatIds?: string[];
recoveryChatIds?: string[];
density?: SidebarDensity;
showPreviews?: boolean;
showTimestamps?: boolean;
sort?: SidebarSortMode;
showArchived?: boolean;
defaultWorkspacePath?: string | null;
@@ -297,8 +293,6 @@ export const ChatList = memo(function ChatList({
updatedChatIds = [],
recoveryChatIds = [],
density = "comfortable",
showPreviews = false,
showTimestamps = false,
sort = "updated_desc",
showArchived = false,
defaultWorkspacePath,
@@ -767,7 +761,6 @@ export const ChatList = memo(function ChatList({
: undefined
}
actionMenuPortalContainer={actionMenuPortalContainer}
updatedAt={showTimestamps ? group.updatedAt : null}
/>
) : (
<ChatsGroupHeader label={group.label} />
@@ -935,11 +928,6 @@ export const ChatList = memo(function ChatList({
const isPinned = pinned.has(s.key);
const isArchived = archived.has(s.key);
const preview = visibleSessionPreview(s.preview);
const showPreview = showPreviews && preview && preview !== title;
const timestamp = showTimestamps
? relativeTime(s.updatedAt ?? s.createdAt)
: "";
const activityState = running.has(s.chatId)
? "running"
: recovery.has(s.chatId)
@@ -1013,41 +1001,15 @@ export const ChatList = memo(function ChatList({
partial={tabPartiallySelected}
/>
) : null}
<span className="min-w-0 flex-1 overflow-hidden">
{projectMode ? (
<span className="relative flex w-full min-w-0 items-center gap-2">
<SidebarSessionHandle handle={s.handle} />
<span className="min-w-0 flex-1 truncate font-normal leading-5">
{title}
</span>
{isPinned ? <PinnedChatIndicator /> : null}
{timestamp ? (
<span className="shrink-0 text-[11.5px] font-medium text-sidebar-muted-foreground">
{timestamp}
</span>
) : null}
</span>
) : (
<span className="relative flex w-full min-w-0 items-center gap-1.5">
<SidebarSessionHandle handle={s.handle} />
<span className="min-w-0 flex-1 truncate font-normal leading-5">
{title}
</span>
{isPinned ? <PinnedChatIndicator /> : null}
</span>
)}
{showPreview ? (
<span className="block w-full truncate text-[11.5px] leading-4 text-sidebar-muted-foreground">
{preview}
</span>
) : null}
{timestamp && !projectMode ? (
<span className="block w-full truncate text-[11px] leading-4 text-sidebar-muted-foreground">
{timestamp}
</span>
) : null}
<span className={cn(
"relative flex min-w-0 flex-1 items-center overflow-hidden",
projectMode ? "gap-2" : "gap-1.5",
)}>
<SidebarSessionHandle handle={s.handle} />
<span className="min-w-0 flex-1 truncate font-normal leading-5">
{title}
</span>
{isPinned ? <PinnedChatIndicator /> : null}
</span>
</button>
<SessionActivityIndicator state={activityState} />
@@ -1710,7 +1672,6 @@ function ProjectGroupHeader({
onRequestRename,
onNewChat,
actionMenuPortalContainer,
updatedAt,
}: {
active: boolean;
label: string;
@@ -1722,7 +1683,6 @@ function ProjectGroupHeader({
onRequestRename?: () => void;
onNewChat?: () => void;
actionMenuPortalContainer?: HTMLElement | null;
updatedAt?: string | null;
}) {
const { t } = useTranslation();
const projectButton = (
@@ -1776,11 +1736,6 @@ function ProjectGroupHeader({
{projectButton}
</HoverHint>
) : projectButton}
{updatedAt ? (
<span className="shrink-0 text-[11px] text-sidebar-muted-foreground">
{relativeTime(updatedAt)}
</span>
) : null}
{onRequestRename || onNewChat ? (
<DropdownMenu
modal={false}
-2
View File
@@ -302,8 +302,6 @@ export function Sidebar(props: SidebarProps) {
updatedChatIds={props.updatedChatIds}
recoveryChatIds={props.recoveryChatIds}
density={props.viewState?.density}
showPreviews={props.viewState?.show_previews}
showTimestamps={props.viewState?.show_timestamps}
sort={props.viewState?.sort}
showArchived={props.showArchived}
defaultWorkspacePath={props.defaultWorkspacePath}