style(webui): show title only in thread list rows

This commit is contained in:
m4
2026-08-10 22:44:55 +08:00
parent 39e126beab
commit 17271d6ebd
+1 -42
View File
@@ -35,8 +35,6 @@ import { formatTime, formatFullTime } from "@/lib/time";
import type { ThreadItem } from "@/app/hooks/useThreads";
import {
useThreads,
useBusyThreadIds,
useLocalRunningThreadIds,
deleteThread,
renameThread,
pinThread,
@@ -72,13 +70,6 @@ const STATUS_COLORS: Record<ThreadItem["status"], string> = {
error: "bg-red-600",
};
const STATUS_LABELS: Record<ThreadItem["status"], string> = {
idle: "Idle",
busy: "Busy",
interrupted: "Interrupted",
error: "Error",
};
function getThreadColor(status: ThreadItem["status"]): string {
return STATUS_COLORS[status] ?? "bg-gray-400";
}
@@ -177,10 +168,6 @@ export function ThreadList({
status: statusFilter === "all" ? undefined : statusFilter,
limit: 20,
});
// Running indicators: heartbeat for out-of-band runs, local store for
// runs this client started itself (zero-latency).
const heartbeatBusyIds = useBusyThreadIds();
const localRunningIds = useLocalRunningThreadIds();
// Dedupe by id, keeping the first occurrence — page 0 wins, so the freshest
// `updated_at` survives. Without this, a thread whose `updated_at` advances
@@ -442,8 +429,6 @@ export function ThreadList({
const renderThreadCard = (thread: ThreadItem) => {
const pinBusy = pinBusyIds.has(thread.id);
const exportBusy = exportBusyIds.has(thread.id);
const isRunning =
heartbeatBusyIds.has(thread.id) || localRunningIds.has(thread.id);
return (
<div
@@ -466,7 +451,7 @@ export function ThreadList({
>
<div className="min-w-0 flex-1">
{/* Title + Timestamp Row */}
<div className="mb-0.5 flex items-center justify-between gap-2">
<div className="flex items-center justify-between gap-2">
<h3 className="flex min-w-0 items-center gap-1.5 text-sm font-semibold">
{thread.pinned && (
<Pin
@@ -485,32 +470,6 @@ export function ThreadList({
</time>
</span>
</div>
{/* Description + Status Row */}
<div className="flex items-center justify-between">
<p className="flex-1 truncate text-[13px] text-muted-foreground">
{thread.description}
</p>
<div className="ml-2 flex-shrink-0">
{isRunning ? (
<span role="status" aria-label="Running" title="Running">
<Loader2
aria-hidden="true"
className="size-3 animate-spin text-[var(--brand)]"
/>
</span>
) : (
<span
role="img"
aria-label={`Status: ${STATUS_LABELS[thread.status]}`}
title={`Status: ${STATUS_LABELS[thread.status]}`}
className={cn(
"block h-2 w-2 rounded-full",
getThreadColor(thread.status)
)}
/>
)}
</div>
</div>
</div>
</button>
{/* Per-thread actions — siblings of the select button (not nested);