mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat: sync thinking state to session list view (#32)
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -25,6 +25,7 @@ type SessionSummaryMetadata = {
|
||||
type SessionSummary = {
|
||||
id: string
|
||||
active: boolean
|
||||
thinking: boolean
|
||||
activeAt: number
|
||||
updatedAt: number
|
||||
metadata: SessionSummaryMetadata | null
|
||||
@@ -53,6 +54,7 @@ function toSessionSummary(session: Session): SessionSummary {
|
||||
return {
|
||||
id: session.id,
|
||||
active: session.active,
|
||||
thinking: session.thinking,
|
||||
activeAt: session.activeAt,
|
||||
updatedAt: session.updatedAt,
|
||||
metadata,
|
||||
|
||||
@@ -193,6 +193,9 @@ function SessionItem(props: {
|
||||
})
|
||||
|
||||
const sessionName = getSessionTitle(s)
|
||||
const statusDotClass = s.active
|
||||
? (s.thinking ? 'bg-[#007AFF]' : 'bg-[var(--app-badge-success-text)]')
|
||||
: 'bg-[var(--app-hint)]'
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -206,7 +209,7 @@ function SessionItem(props: {
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<span className="flex h-4 w-4 items-center justify-center" aria-hidden="true">
|
||||
<span
|
||||
className={`h-2 w-2 rounded-full ${s.active ? 'bg-[var(--app-badge-success-text)]' : 'bg-[var(--app-hint)]'}`}
|
||||
className={`h-2 w-2 rounded-full ${statusDotClass}`}
|
||||
/>
|
||||
</span>
|
||||
<div className="truncate text-sm font-medium">
|
||||
|
||||
@@ -33,6 +33,7 @@ export type SessionSummaryMetadata = {
|
||||
export type SessionSummary = {
|
||||
id: string
|
||||
active: boolean
|
||||
thinking: boolean
|
||||
activeAt: number
|
||||
updatedAt: number
|
||||
metadata: SessionSummaryMetadata | null
|
||||
|
||||
Reference in New Issue
Block a user