From ba96562f04ac787c2b8453784bdd581b3bb4bcad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fiere?= Date: Tue, 18 Aug 2026 06:52:26 +0000 Subject: [PATCH] feat: add quick chat idle dot indicator (#2750) Co-authored-by: Carlos Florencio --- apps/web/app/page.tsx | 5 + .../app-sidebar/app-sidebar-nav-item.tsx | 36 +- .../app-sidebar/app-sidebar-new-task-item.tsx | 34 +- .../app-sidebar-primary-nav.test.tsx | 21 +- .../app-sidebar/app-sidebar-primary-nav.tsx | 10 +- .../kanban/kanban-header-mobile.tsx | 45 +- apps/web/components/kanban/kanban-header.tsx | 20 +- .../quick-chat/use-quick-chat-modal.test.ts | 4 +- .../quick-chat/use-quick-chat-modal.ts | 5 +- .../task/mobile/quick-chat-sheet-button.tsx | 40 ++ .../mobile/session-task-switcher-sheet.tsx | 16 +- .../components/task/sessions-dropdown.test.ts | 70 ++- .../web/components/task/sessions-dropdown.tsx | 25 +- .../chat/mobile-quick-chat-idle-dot.spec.ts | 83 ++++ apps/web/e2e/tests/chat/quick-chat-helpers.ts | 11 +- .../tests/chat/quick-chat-idle-dot.spec.ts | 61 +++ .../session/use-session-actions.test.ts | 24 + .../domains/session/use-session-actions.ts | 54 ++- apps/web/hooks/use-quick-chat-resync.test.ts | 324 ++++++++----- apps/web/hooks/use-quick-chat-resync.ts | 97 +++- apps/web/lib/session/session-deletion.test.ts | 19 + apps/web/lib/session/session-deletion.ts | 18 + apps/web/lib/state/default-state.ts | 18 +- apps/web/lib/state/hydration/hydrator.test.ts | 21 +- apps/web/lib/state/hydration/hydrator.ts | 14 +- .../slices/ui/quick-chat-actions.test.ts | 48 ++ .../lib/state/slices/ui/quick-chat-actions.ts | 220 +++++++++ .../state/slices/ui/quick-chat-sync.test.ts | 58 +++ .../lib/state/slices/ui/quick-chat-sync.ts | 431 ++++++++++++------ .../slices/ui/quick-chat-unseen-selectors.ts | 15 + .../state/slices/ui/quick-chat-unseen.test.ts | 143 ++++++ apps/web/lib/state/slices/ui/types.ts | 21 + apps/web/lib/state/slices/ui/ui-slice.ts | 180 +------- apps/web/lib/state/store.ts | 4 + .../handlers/agent-session-quick-chat.test.ts | 87 ++++ .../web/lib/ws/handlers/agent-session.test.ts | 57 +++ apps/web/lib/ws/handlers/agent-session.ts | 8 + apps/web/lib/ws/handlers/quick-chat-unseen.ts | 64 +++ apps/web/lib/ws/handlers/turns.test.ts | 91 +++- apps/web/lib/ws/handlers/turns.ts | 23 + apps/web/src/locales/en/sidebar.json | 1 + apps/web/src/locales/pseudo/sidebar.json | 1 + apps/web/src/locales/pt-pt/sidebar.json | 1 + apps/web/src/locales/zh-cn/sidebar.json | 1 + apps/web/src/locales/zh-hk/sidebar.json | 1 + apps/web/src/locales/zh-tw/sidebar.json | 1 + docs/plans/quick-chat-idle-dot/plan.md | 235 ++++++++++ .../task-01-unseen-idle-state.md | 90 ++++ .../task-02-ws-marking-hooks.md | 48 ++ .../task-03-entry-point-dots.md | 55 +++ .../task-04-idle-dot-e2e.md | 51 +++ docs/specs/INDEX.md | 1 + docs/specs/quick-chat-idle-dot/spec.md | 123 +++++ 53 files changed, 2566 insertions(+), 568 deletions(-) create mode 100644 apps/web/components/task/mobile/quick-chat-sheet-button.tsx create mode 100644 apps/web/e2e/tests/chat/mobile-quick-chat-idle-dot.spec.ts create mode 100644 apps/web/e2e/tests/chat/quick-chat-idle-dot.spec.ts create mode 100644 apps/web/lib/session/session-deletion.test.ts create mode 100644 apps/web/lib/session/session-deletion.ts create mode 100644 apps/web/lib/state/slices/ui/quick-chat-actions.ts create mode 100644 apps/web/lib/state/slices/ui/quick-chat-unseen-selectors.ts create mode 100644 apps/web/lib/state/slices/ui/quick-chat-unseen.test.ts create mode 100644 apps/web/lib/ws/handlers/agent-session-quick-chat.test.ts create mode 100644 apps/web/lib/ws/handlers/quick-chat-unseen.ts create mode 100644 docs/plans/quick-chat-idle-dot/plan.md create mode 100644 docs/plans/quick-chat-idle-dot/task-01-unseen-idle-state.md create mode 100644 docs/plans/quick-chat-idle-dot/task-02-ws-marking-hooks.md create mode 100644 docs/plans/quick-chat-idle-dot/task-03-entry-point-dots.md create mode 100644 docs/plans/quick-chat-idle-dot/task-04-idle-dot-e2e.md create mode 100644 docs/specs/quick-chat-idle-dot/spec.md diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index 82302abce1..f120495342 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -181,6 +181,11 @@ async function loadWorkspaceState({ activeKind: "conversation" as const, activeTerminalTabId: null, lastTerminalTabIdByWorkspace: {}, + unseenIdleByWorkspace: {}, + lastSettledAtBySession: {}, + sessionOwnership: {}, + syncRevisionByWorkspace: {}, + tombstonedSessions: {}, }, }, }; diff --git a/apps/web/components/app-sidebar/app-sidebar-nav-item.tsx b/apps/web/components/app-sidebar/app-sidebar-nav-item.tsx index c6f3c79914..24b09c10d2 100644 --- a/apps/web/components/app-sidebar/app-sidebar-nav-item.tsx +++ b/apps/web/components/app-sidebar/app-sidebar-nav-item.tsx @@ -14,6 +14,7 @@ type AppSidebarNavItemProps = { href?: string; badge?: number; badgeVariant?: "primary" | "muted"; + dot?: boolean; onClick?: () => void; collapsed: boolean; /** Override the auto-derived active-state from pathname. */ @@ -76,6 +77,24 @@ function isPathActive(pathname: string, href: string | undefined, exactMatch: bo return hrefPathname !== "/" && pathname.startsWith(`${hrefPathname}/`); } +function renderUnseenDot(dot: boolean) { + if (!dot) return null; + return ( +