diff --git a/packages/chat-client/src/App.jsx b/packages/chat-client/src/App.jsx
index 3824fdd..982dbd2 100644
--- a/packages/chat-client/src/App.jsx
+++ b/packages/chat-client/src/App.jsx
@@ -7,6 +7,7 @@ import Sidebar from './components/Sidebar';
import AllChatsView from './components/AllChatsView';
import AllProjectsView from './components/AllProjectsView';
import SettingsView from './components/SettingsView';
+import ProjectView from './components/ProjectView';
/**** useHooks **** */
import { useSession } from './hooks/useSession';
@@ -19,6 +20,7 @@ export default function App() {
const [rightOpen, setRightOpen] = useState(false);
const { models, selectedModel, setSelectedModel } = useModels();
const [view, setView] = useState('chat')
+ const [activeProject, setActiveProject] = useState(null);
const {projects, refreshProjects} = useProjects();
const {
@@ -42,7 +44,7 @@ export default function App() {
} = useChat({ activeSession, appendMessage, updateLastMessage, refreshSessions });
function handleSendMessage(text) {
- sendMessage(text, selectedModel);
+ sendMessage(text, selectedModel, activeSession?.project_id ?? null);
}
function handleSessionsChange(deletedSession){
@@ -52,6 +54,20 @@ export default function App() {
refreshSessions();
}
+ async function handleNewProjectChat() {
+ const newSession = {
+ external_id: uuidv4(),
+ metadata: null,
+ isNew: true,
+ project_id: activeProject?.id ?? null,
+ };
+ // Optimistically set active session then navigate
+ setSessions(prev => [newSession, ...prev]);
+ selectSession(newSession);
+ setView('chat');
+ // After first message saves, project assignment will be written via updateSession
+ }
+
return (
@@ -96,6 +113,15 @@ export default function App() {
)}
{view === 'settings' && }
+
+ {view === 'project' && activeProject && (
+
+ )}
{
@@ -15,7 +16,7 @@ export default function ProjectModal({ project, mode, onSave, onDelete, onClose
function handleSubmit() {
const trimmed = name.trim();
if (!trimmed) return;
- onSave({ name: trimmed, description: description.trim() || null, colour, icon: null });
+ onSave({ name: trimmed, description: description.trim() || null, colour, icon: null, projectOnly });
onClose();
}
@@ -122,6 +123,33 @@ export default function ProjectModal({ project, mode, onSave, onDelete, onClose
+ {/* Project-Only toggle */}
+
+
+
+ Limit context to this project only
+
+
+
+