Skip to content

Commit bc2a499

Browse files
committed
feat: show rewriting sessions on homepage with status badge
1 parent 240cc7c commit bc2a499

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/web/src/pages/HomePage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Link, useNavigate } from 'react-router-dom'
44
interface SessionItem {
55
id: string
66
type: string
7-
status: 'pending' | 'completed'
7+
status: 'pending' | 'rewriting' | 'completed'
88
createdAt: number
99
subject?: string
1010
to?: string
@@ -87,7 +87,7 @@ export default function HomePage() {
8787
fetch('/api/sessions')
8888
.then(r => r.json())
8989
.then((data: SessionItem[]) => {
90-
const nextPending = data.filter(s => s.status === 'pending')
90+
const nextPending = data.filter(s => s.status === 'pending' || s.status === 'rewriting')
9191
const nextIds = nextPending.map(s => s.id).join(',')
9292
// Only update state if pending list actually changed
9393
if (initial || nextIds !== pendingIdsRef.current) {
@@ -197,6 +197,9 @@ export default function HomePage() {
197197
</div>
198198
</div>
199199
<div className="flex items-center gap-3 shrink-0 ml-4">
200+
{s.status === 'rewriting' && (
201+
<span className="text-xs px-2 py-0.5 rounded font-medium bg-amber-50 dark:bg-amber-950 text-amber-600 dark:text-amber-400">Rewriting</span>
202+
)}
200203
{riskBadge(risk)}
201204
<span className="text-xs text-zinc-400 dark:text-slate-500">{formatTime(s.createdAt)}</span>
202205
</div>

0 commit comments

Comments
 (0)