feat: unify client messaging into ChatSection + add general comment type

Removed per-task/deliverable CommentList/CommentForm from PhaseTimeline and
ClientKanban. Replaced with a single ChatSection at the bottom of the dashboard
that handles general, task, and deliverable messages in a unified chat UI.
Added "general" entity_type to the comment API (entity_id = client UUID).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Simone Cavalli
2026-05-16 12:49:14 +02:00
parent c467ef300b
commit 549cf0b592
7 changed files with 307 additions and 348 deletions
@@ -3,18 +3,15 @@
import { useState, type ReactNode } from "react";
import { ClientKanban } from "./ClientKanban";
import type { ClientView } from "@/lib/client-view";
import type { Comment } from "@/db/schema";
export function PhaseViewToggle({
timelineView,
phases,
token,
comments,
}: {
timelineView: ReactNode;
phases: ClientView["phases"];
token: string;
comments: Comment[];
}) {
const [view, setView] = useState<"timeline" | "kanban">("timeline");
@@ -26,9 +23,7 @@ export function PhaseViewToggle({
<button
onClick={() => setView("timeline")}
className={`px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${
view === "timeline"
? "bg-white text-[#1A463C] shadow-sm"
: "text-[#71717a] hover:text-[#1a1a1a]"
view === "timeline" ? "bg-white text-[#1A463C] shadow-sm" : "text-[#71717a] hover:text-[#1a1a1a]"
}`}
>
Timeline
@@ -36,9 +31,7 @@ export function PhaseViewToggle({
<button
onClick={() => setView("kanban")}
className={`px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${
view === "kanban"
? "bg-white text-[#1A463C] shadow-sm"
: "text-[#71717a] hover:text-[#1a1a1a]"
view === "kanban" ? "bg-white text-[#1A463C] shadow-sm" : "text-[#71717a] hover:text-[#1a1a1a]"
}`}
>
Kanban
@@ -46,11 +39,7 @@ export function PhaseViewToggle({
</div>
</div>
{view === "timeline" ? (
timelineView
) : (
<ClientKanban phases={phases} token={token} comments={comments} />
)}
{view === "timeline" ? timelineView : <ClientKanban phases={phases} token={token} />}
</div>
);
}