chat sessions in project view

This commit is contained in:
Storme-bit
2026-04-14 01:52:11 -07:00
parent cdd74b5902
commit c892f54a04
9 changed files with 223 additions and 15 deletions

View File

@@ -8,7 +8,7 @@ export function useChat({ activeSession, appendMessage, updateLastMessage, refre
const [lastModel, setLastModel] = useState(null);
const cancelRef = useRef(null);
const sendMessage = useCallback(async (text, model) => {
const sendMessage = useCallback(async (text, model, projectId = null) => {
if (!activeSession || !text.trim() || streaming) return;
setError(null);
@@ -56,6 +56,12 @@ export function useChat({ activeSession, appendMessage, updateLastMessage, refre
// Delayed refresh
setTimeout( () => refreshSessions(), 3000);
// Assign project after first message if one was set
if (projectId) {
updateSession(activeSession.external_id, { projectId })
.catch(err => console.warn('[useChat] Failed to assign project:', err.message));
}
},
onError: (err) => {

View File

@@ -82,6 +82,7 @@ export function useSession() {
return {
sessions,
setSessions,
activeSession,
messages,
loadingHistory,