feat(FN-1361): add chat view with SSE streaming and session management

- Add ChatView component with sidebar navigation and message thread layout
- Add useChat hook with SSE streaming state management for real-time updates
- Add chat API functions for sessions and messages (create, list, send, stream)
- Add mobile-responsive CSS styles for chat interface
- Add tests for useChat hook and ChatView component
- Integrate chat into task view and navigation (Header, MobileNavBar)
This commit is contained in:
gsxdsm
2026-04-10 01:42:07 -07:00
parent f00cf6e4a1
commit aa8afb82ed
10 changed files with 2430 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ import type { ProjectInfo } from "../api";
import { getScopedItem, setScopedItem } from "../utils/projectStorage";
export type ViewMode = "overview" | "project";
export type TaskView = "board" | "list" | "agents" | "missions";
export type TaskView = "board" | "list" | "agents" | "missions" | "chat";
interface UseViewStateOptions {
projectsLoading: boolean;
@@ -48,7 +48,7 @@ export function useViewState(options: UseViewStateOptions): UseViewStateResult {
const [taskView, setTaskView] = useState<TaskView>(() => {
const saved = getScopedItem("kb-dashboard-task-view");
if (saved === "board" || saved === "list" || saved === "agents" || saved === "missions") return saved;
if (saved === "board" || saved === "list" || saved === "agents" || saved === "missions" || saved === "chat") return saved;
return "board";
});
@@ -58,7 +58,7 @@ export function useViewState(options: UseViewStateOptions): UseViewStateResult {
useEffect(() => {
const saved = getScopedItem("kb-dashboard-task-view", currentProject?.id);
if (saved === "board" || saved === "list" || saved === "agents" || saved === "missions") {
if (saved === "board" || saved === "list" || saved === "agents" || saved === "missions" || saved === "chat") {
setTaskView(saved);
return;
}