diff --git a/apps/web/app/(app)/chats/[chat]/page.tsx b/apps/web/app/(app)/chats/[chat]/page.tsx
index c7a3848b..c867f609 100644
--- a/apps/web/app/(app)/chats/[chat]/page.tsx
+++ b/apps/web/app/(app)/chats/[chat]/page.tsx
@@ -10,6 +10,7 @@ import { LiveRefresh } from "@/components/LiveRefresh";
import { AgentBadge } from "@/components/AgentBadge";
import { ChatThreadList } from "@/components/ChatThreadList";
import { ChatScroll } from "@/components/ChatScroll";
+import { ChatLiveFeed } from "@/components/ChatLiveFeed";
import { ChatSwitch } from "@/components/ChatSwitch";
import { ago, Empty, Flash, linkify, StatusBadge } from "@/components/common";
import { Hidden, QuestionCard } from "@/components/cards";
@@ -24,7 +25,7 @@ import { requireUser, words } from "@/lib/auth";
import { db } from "@/lib/db";
import { getT } from "@/lib/i18n";
import { cn } from "@/lib/utils";
-import { cleanText } from "@/lib/chat-text";
+import { cleanText, messageLink, STUCK_NOTICE } from "@/lib/chat-text";
import { chatOfferAction, linkChatAction, postChatAction, unlinkChatAction } from "../actions";
type Params = { error?: string; thread?: string; link?: string; q?: string; list?: string };
@@ -223,10 +224,31 @@ export default async function ChatPage({ params, searchParams }: { params: Promi
return { slug: c.slug, label: marks ? `${c.kind === "master" ? name : `${c.slug} · ${name}`} (${marks})` : c.kind === "master" ? name : `${c.slug} · ${name}` };
});
+ const feed = ordered.length === 0 ? (
+ {discussion ? t("Напишите, что хотите узнать или сделать, — аналитик ответит здесь же. Например: «Что сейчас в работе?» или «Хочу страницу с отзывами клиентов».") : master ? t("Пока тихо: здесь появятся вопросы агентов, сбои и обновления ваших проектов.") : thread === undefined ? t("Сообщений пока нет: они появятся, когда агенты возьмутся за {tasks}.", { tasks: w.task("accPl") }) : t("В этом треде пока пусто.")}
+ ) : (
+
+ {groups.map((g) =>
+ g.kind === "events" ? (
+ -
+
+
+ ) : (
+ -
+
+
+
+
+ ),
+ )}
+
+ );
+
return (
- {/* PEP-225: a project chat re-renders only for its own new messages; the master feed gathers every project. */}
-
+ {/* PEP-228: a project chat draws its new messages in place (ChatLiveFeed) and re-renders only for
+ what it can't draw; the master feed gathers every project and re-renders. */}
+
{t("Чаты")}
@@ -285,32 +307,33 @@ export default async function ChatPage({ params, searchParams }: { params: Promi
)}
- {ordered.length === 0 ? (
- {discussion ? t("Напишите, что хотите узнать или сделать, — аналитик ответит здесь же. Например: «Что сейчас в работе?» или «Хочу страницу с отзывами клиентов».") : master ? t("Пока тихо: здесь появятся вопросы агентов, сбои и обновления ваших проектов.") : thread === undefined ? t("Сообщений пока нет: они появятся, когда агенты возьмутся за {tasks}.", { tasks: w.task("accPl") }) : t("В этом треде пока пусто.")}
+ {master ? (
+ <>
+ {feed}
+
+
+ >
) : (
-
- {groups.map((g) =>
- g.kind === "events" ? (
- -
-
-
- ) : (
- -
-
-
-
-
- ),
- )}
-
+
+ {t("печатает…")}
+
+ ) : null
+ }
+ >
+ {feed}
+
)}
- {typing && (
-
- {t("печатает…")}
-
- )}
-
-
{writable && (