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 (
+
+ );
+}
+
+function sidebarBadgeClass(variant: NonNullable) {
+ return cn(
+ "rounded-full px-1.5 py-0.5 text-xs",
+ variant === "primary" ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground",
+ );
+}
+
export function AppSidebarNavItem({
icon: Icon,
label,
@@ -89,6 +108,7 @@ export function AppSidebarNavItem({
disabled = false,
testId,
className,
+ dot = false,
}: AppSidebarNavItemProps) {
const pathname = usePathname();
const active = isActive ?? isPathActive(pathname, href, exactMatch);
@@ -104,21 +124,15 @@ export function AppSidebarNavItem({
const inner = (
<>
-
+
+
+ {renderUnseenDot(dot)}
+
{!collapsed && (
<>
{label}
{typeof badge === "number" && badge > 0 && (
-
- {badge}
-
+ {badge}
)}
>
)}
diff --git a/apps/web/components/app-sidebar/app-sidebar-new-task-item.tsx b/apps/web/components/app-sidebar/app-sidebar-new-task-item.tsx
index 99834afaed..c050d96906 100644
--- a/apps/web/components/app-sidebar/app-sidebar-new-task-item.tsx
+++ b/apps/web/components/app-sidebar/app-sidebar-new-task-item.tsx
@@ -16,6 +16,7 @@ import { IMPROVE_KANDEV_WORKSPACE_NAME } from "@/components/improve-kandev-dialo
import { linkToTask } from "@/lib/links";
import type { Task } from "@/lib/types/http";
import { subscribeNewTaskCreationRequests } from "@/lib/desktop/new-task-request";
+import { selectQuickChatHasUnseenIdle } from "@/lib/state/slices/ui/quick-chat-unseen-selectors";
import { AppSidebarWorkspaceActions } from "./app-sidebar-workspace-actions";
// The Office "New issue" dialog only renders on `/office` routes, but this item
@@ -42,17 +43,20 @@ type RowActionButtonProps = {
icon: TablerIcon;
label: string;
testId: string;
+ dot?: boolean;
onClick: () => void;
};
-function RowActionButton({ icon: Icon, label, testId, onClick }: RowActionButtonProps) {
+function RowActionButton({
+ icon: Icon,
+ label,
+ testId,
+ onClick,
+ dot = false,
+}: RowActionButtonProps) {
const [tooltipOpen, setTooltipOpen] = useState(false);
const hoveredRef = useRef(false);
-
const handleTooltipOpenChange = (nextOpen: boolean) => {
- // Focus is restored to this action after Quick Terminal closes. Keep the
- // tooltip pointer-driven so that accessibility focus does not leave a
- // stale popover behind the dialog.
if (nextOpen && !hoveredRef.current) return;
setTooltipOpen(nextOpen);
};
@@ -79,7 +83,16 @@ function RowActionButton({ icon: Icon, label, testId, onClick }: RowActionButton
data-testid={testId}
className="flex h-6 w-6 items-center justify-center rounded text-muted-foreground/70 hover:bg-muted hover:text-foreground cursor-pointer"
>
-
+
+
+ {dot && (
+
+ )}
+
{label}
@@ -166,6 +179,12 @@ export function AppSidebarNewTaskItem({ collapsed }: AppSidebarNewTaskItemProps)
const setActiveSession = useAppStore((s) => s.setActiveSession);
const inOffice = useInOffice();
const handleOpenQuickChat = useQuickChatLauncher(workspaceId);
+ const quickChatHasUnseenIdle = useAppStore((state) =>
+ selectQuickChatHasUnseenIdle(state, workspaceId),
+ );
+ const quickChatLabel = t(
+ quickChatHasUnseenIdle ? "sidebar:quickChatUnseen" : "sidebar:quickChat",
+ );
const handleOpenQuickTerminal = useQuickTerminalLauncher(workspaceId);
const [open, setOpen] = useState(false);
const isImproveWorkspace = activeWorkspace?.name === IMPROVE_KANDEV_WORKSPACE_NAME;
@@ -220,9 +239,10 @@ export function AppSidebarNewTaskItem({ collapsed }: AppSidebarNewTaskItemProps)
/>
({
const state = {
workspaces: { activeId: "ws-1" as string | null },
office: { inboxCountByWorkspaceId: {} as Record },
+ quickChat: { unseenIdleByWorkspace: {} as Record> },
};
+const QUICK_CHAT_LABEL = "Quick Chat";
+const QUICK_CHAT_UNSEEN_LABEL = "Quick Chat, new response";
let mode: "office" | "kanban" | "unknown" = "kanban";
let pathname = "/";
@@ -50,6 +53,7 @@ describe("AppSidebarPrimaryNav", () => {
beforeEach(() => {
state.workspaces.activeId = "ws-1";
state.office.inboxCountByWorkspaceId = {};
+ state.quickChat.unseenIdleByWorkspace = {};
mode = "kanban";
pathname = "/";
mocks.openQuickChat.mockClear();
@@ -60,14 +64,22 @@ describe("AppSidebarPrimaryNav", () => {
it("keeps Quick Chat reachable when the sidebar rail is collapsed", () => {
renderNav(true);
- screen.getByRole("button", { name: "Quick Chat" }).click();
+ expect(screen.queryByTestId("quick-chat-unseen-dot")).toBeNull();
+ screen.getByRole("button", { name: QUICK_CHAT_LABEL }).click();
expect(mocks.openQuickChat).toHaveBeenCalledOnce();
});
+ it("renders an unseen marker on the collapsed Quick Chat rail entry", () => {
+ state.quickChat.unseenIdleByWorkspace = { "ws-1": { "session-1": true } };
+ renderNav(true);
+ const quickChat = screen.getByRole("button", { name: QUICK_CHAT_UNSEEN_LABEL });
+
+ expect(quickChat.querySelector('[data-testid="quick-chat-unseen-dot"]')).not.toBeNull();
+ });
+
it("omits the standalone Quick Chat row while expanded", () => {
renderNav(false);
-
- expect(screen.queryByRole("button", { name: "Quick Chat" })).toBeNull();
+ expect(screen.queryByRole("button", { name: QUICK_CHAT_LABEL })).toBeNull();
});
it("no longer carries a Runs row — automations are their own section", () => {
@@ -82,8 +94,7 @@ describe("AppSidebarPrimaryNav", () => {
it("omits Quick Chat when the rail is collapsed but there is no workspace", () => {
state.workspaces.activeId = null;
renderNav(true);
-
- expect(screen.queryByRole("button", { name: "Quick Chat" })).toBeNull();
+ expect(screen.queryByRole("button", { name: QUICK_CHAT_LABEL })).toBeNull();
});
it("links Home to an explicit overview while keeping it active at the root route", () => {
diff --git a/apps/web/components/app-sidebar/app-sidebar-primary-nav.tsx b/apps/web/components/app-sidebar/app-sidebar-primary-nav.tsx
index 555df20b50..63cd56ed4f 100644
--- a/apps/web/components/app-sidebar/app-sidebar-primary-nav.tsx
+++ b/apps/web/components/app-sidebar/app-sidebar-primary-nav.tsx
@@ -4,6 +4,7 @@ import { IconHome, IconInbox, IconMessageCircle } from "@tabler/icons-react";
import { useTranslation } from "react-i18next";
import { useAppStore } from "@/components/state-provider";
import { selectOfficeInboxCount } from "@/lib/state/slices/office/selectors";
+import { selectQuickChatHasUnseenIdle } from "@/lib/state/slices/ui/quick-chat-unseen-selectors";
import { useOfficeModeState } from "@/hooks/use-in-office";
import { useQuickChatLauncher } from "@/hooks/use-quick-chat-launcher";
import { homeDestinationHref } from "@/lib/navigation/core-destinations";
@@ -21,6 +22,12 @@ export function AppSidebarPrimaryNav({ collapsed }: AppSidebarPrimaryNavProps) {
const mode = useOfficeModeState();
const inOffice = mode === "office";
const handleOpenQuickChat = useQuickChatLauncher(workspaceId);
+ const quickChatHasUnseenIdle = useAppStore((state) =>
+ selectQuickChatHasUnseenIdle(state, workspaceId),
+ );
+ const quickChatLabel = t(
+ quickChatHasUnseenIdle ? "sidebar:quickChatUnseen" : "sidebar:quickChat",
+ );
const homeHref = mode === "unknown" ? undefined : homeDestinationHref({ workspaceId, inOffice });
return (
@@ -47,9 +54,10 @@ export function AppSidebarPrimaryNav({ collapsed }: AppSidebarPrimaryNavProps) {
{workspaceId && collapsed && (
)}
diff --git a/apps/web/components/kanban/kanban-header-mobile.tsx b/apps/web/components/kanban/kanban-header-mobile.tsx
index b1592b9eb4..082b1541e0 100644
--- a/apps/web/components/kanban/kanban-header-mobile.tsx
+++ b/apps/web/components/kanban/kanban-header-mobile.tsx
@@ -15,6 +15,7 @@ import { useConnectionIssueCopy } from "@/components/app-status-bar/connection-s
import { useQuickChatLauncher } from "@/hooks/use-quick-chat-launcher";
import { useQuickTerminalLauncher } from "@/hooks/use-quick-terminal-launcher";
import { workspaceHomeHref } from "@/lib/navigation/workspace-home";
+import { selectQuickChatHasUnseenIdle } from "@/lib/state/slices/ui/quick-chat-unseen-selectors";
import { cn } from "@/lib/utils";
type KanbanHeaderMobileProps = {
@@ -42,6 +43,39 @@ function MobileBrandLink({ workspaceId }: Pick void;
+}) {
+ const { t } = useTranslation();
+ const dot = useAppStore((state) => selectQuickChatHasUnseenIdle(state, workspaceId));
+ const quickChatLabel = t(dot ? "sidebar:quickChatUnseen" : "sidebar:quickChat");
+ return (
+
+ );
+}
+
function MobileHeaderActions({
workspaceId,
workspaceLabel,
@@ -88,16 +122,7 @@ function MobileHeaderActions({
)}
{workspaceId && (
-
+
)}
{onSearchChange && (
>
);
diff --git a/apps/web/components/quick-chat/use-quick-chat-modal.test.ts b/apps/web/components/quick-chat/use-quick-chat-modal.test.ts
index fc0fa52a6a..ace3431d2a 100644
--- a/apps/web/components/quick-chat/use-quick-chat-modal.test.ts
+++ b/apps/web/components/quick-chat/use-quick-chat-modal.test.ts
@@ -63,6 +63,7 @@ function makeAppState() {
},
closeQuickChat: vi.fn(),
closeQuickChatSession: vi.fn(),
+ removeQuickChatSession: vi.fn(),
setActiveQuickChatSession: vi.fn(),
createQuickTerminal: vi.fn(),
updateQuickTerminal: vi.fn(),
@@ -85,6 +86,7 @@ function makeStore(overrides: Partial = {}): MockStore {
activeTerminalTabId: null,
closeQuickChat: vi.fn(),
closeQuickChatSession: vi.fn(),
+ removeQuickChatSession: vi.fn(),
setActiveQuickChatSession: vi.fn(),
createQuickTerminal: vi.fn(),
updateQuickTerminal: vi.fn(),
@@ -274,7 +276,7 @@ describe("useQuickChatModal — persisted config lifecycle", () => {
await act(async () => result.current.handleConfirmClose());
- expect(mockAppState.closeQuickChatSession).toHaveBeenCalledWith(configSessionId);
+ expect(mockAppState.removeQuickChatSession).toHaveBeenCalledWith(configSessionId);
expect(mockDeleteTask).toHaveBeenCalledWith("config-task");
});
diff --git a/apps/web/components/quick-chat/use-quick-chat-modal.ts b/apps/web/components/quick-chat/use-quick-chat-modal.ts
index c1a2121687..2f0b5b474c 100644
--- a/apps/web/components/quick-chat/use-quick-chat-modal.ts
+++ b/apps/web/components/quick-chat/use-quick-chat-modal.ts
@@ -35,6 +35,7 @@ function useQuickChatStore(workspaceId: string) {
terminalTabs: s.quickChat.terminalTabs,
closeQuickChat: s.closeQuickChat,
closeQuickChatSession: s.closeQuickChatSession,
+ removeQuickChatSession: s.removeQuickChatSession,
setActiveQuickChatSession: s.setActiveQuickChatSession,
createQuickTerminal: s.createQuickTerminal,
updateQuickTerminal: s.updateQuickTerminal,
@@ -261,12 +262,12 @@ function useQuickChatSessionClose(store: QuickChatStore, resetPendingStarts: ()
setSessionToClose(null);
const taskId = resolveTaskId(store, sessionId);
if (!taskId) {
- store.closeQuickChatSession(sessionId);
+ store.removeQuickChatSession(sessionId);
return;
}
try {
await deleteQuickChatTask(taskId);
- store.closeQuickChatSession(sessionId);
+ store.removeQuickChatSession(sessionId);
} catch (error) {
console.error("Failed to delete quick chat task:", error);
toast({
diff --git a/apps/web/components/task/mobile/quick-chat-sheet-button.tsx b/apps/web/components/task/mobile/quick-chat-sheet-button.tsx
new file mode 100644
index 0000000000..ec9b083962
--- /dev/null
+++ b/apps/web/components/task/mobile/quick-chat-sheet-button.tsx
@@ -0,0 +1,40 @@
+import { IconMessageCircle } from "@tabler/icons-react";
+import { useTranslation } from "react-i18next";
+import { Button } from "@kandev/ui/button";
+import { useAppStore } from "@/components/state-provider";
+import { selectQuickChatHasUnseenIdle } from "@/lib/state/slices/ui/quick-chat-unseen-selectors";
+
+/** Quick Chat action in the mobile task-switcher sheet, with the unseen-idle dot. */
+export function QuickChatSheetButton({
+ workspaceId,
+ onClick,
+}: {
+ workspaceId: string;
+ onClick: () => void;
+}) {
+ const { t } = useTranslation();
+ const hasUnseenIdle = useAppStore((state) => selectQuickChatHasUnseenIdle(state, workspaceId));
+ const quickChatLabel = t(hasUnseenIdle ? "sidebar:quickChatUnseen" : "sidebar:quickChat");
+ return (
+
+ );
+}
diff --git a/apps/web/components/task/mobile/session-task-switcher-sheet.tsx b/apps/web/components/task/mobile/session-task-switcher-sheet.tsx
index c9f58e594e..0392a177f1 100644
--- a/apps/web/components/task/mobile/session-task-switcher-sheet.tsx
+++ b/apps/web/components/task/mobile/session-task-switcher-sheet.tsx
@@ -2,10 +2,11 @@
import { useCallback, useEffect, useMemo, useState, memo } from "react";
import { useTranslation } from "react-i18next";
-import { IconCheck, IconMessageCircle, IconNetwork, IconPlus } from "@tabler/icons-react";
+import { IconCheck, IconNetwork, IconPlus } from "@tabler/icons-react";
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@kandev/ui/sheet";
import { Drawer, DrawerContent, DrawerHeader, DrawerTitle } from "@kandev/ui/drawer";
import { Button } from "@kandev/ui/button";
+import { QuickChatSheetButton } from "./quick-chat-sheet-button";
import { TaskSwitcher } from "../task-switcher";
import type { TaskSwitcherItem, TaskSwitcherProps } from "../task-switcher";
import { SidebarFilterBar } from "../sidebar-filter/sidebar-filter-bar";
@@ -229,18 +230,7 @@ function TaskSwitcherSurfaceHeader({
{t("task:tasks")}
)}
- {workspaceId && (
-
- )}
+ {workspaceId &&
}