From cf8f4ea3be323bede265e20cca8ad4e5726fee4d Mon Sep 17 00:00:00 2001 From: ValueOn AG Date: Mon, 16 Feb 2026 09:02:44 +0100 Subject: [PATCH 1/2] fix(teamsbot): session switcher in session view, fix navigation from dashboard details button Co-authored-by: Cursor --- .../views/teamsbot/TeamsbotSessionView.tsx | 44 ++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/src/pages/views/teamsbot/TeamsbotSessionView.tsx b/src/pages/views/teamsbot/TeamsbotSessionView.tsx index 80b70a5..1e3f562 100644 --- a/src/pages/views/teamsbot/TeamsbotSessionView.tsx +++ b/src/pages/views/teamsbot/TeamsbotSessionView.tsx @@ -15,6 +15,7 @@ export const TeamsbotSessionView: React.FC = () => { const sessionId = searchParams.get('sessionId') || ''; const [session, setSession] = useState(null); + const [allSessions, setAllSessions] = useState([]); const [transcripts, setTranscripts] = useState([]); const [botResponses, setBotResponses] = useState([]); const [loading, setLoading] = useState(true); @@ -32,19 +33,23 @@ export const TeamsbotSessionView: React.FC = () => { setLoading(true); setNoSessions(false); + // Always load the full session list for the switcher + const listResult = await teamsbotApi.listSessions(instanceId, true); + const sessions = listResult.sessions || []; + setAllSessions(sessions); + let targetSessionId = sessionId; - // No sessionId in URL -> find the most recent session + // No sessionId in URL -> find the most recent active or latest session if (!targetSessionId) { - const listResult = await teamsbotApi.listSessions(instanceId, true); - const sessions = listResult.sessions || []; if (sessions.length === 0) { setNoSessions(true); setLoading(false); return; } - // Pick the most recent (first in list, sorted by creation date desc) - targetSessionId = sessions[0].id; + // Prefer active sessions, then most recent + const activeSession = sessions.find(s => ['active', 'joining', 'pending'].includes(s.status)); + targetSessionId = activeSession ? activeSession.id : sessions[0].id; setSearchParams({ sessionId: targetSessionId }, { replace: true }); } @@ -178,8 +183,37 @@ export const TeamsbotSessionView: React.FC = () => { ); if (!session) return
Sitzung nicht gefunden
; + const _switchSession = (newSessionId: string) => { + setSearchParams({ sessionId: newSessionId }); + }; + return (
+ {/* Session Switcher (if multiple sessions exist) */} + {allSessions.length > 1 && ( +
+ {allSessions.map((s) => ( + + ))} +
+ )} + {/* Session Header */}
From 823abaf9a89cbc4a93e00c2f466eeadfb3d09a4c Mon Sep 17 00:00:00 2001 From: ValueOn AG Date: Mon, 16 Feb 2026 09:29:05 +0100 Subject: [PATCH 2/2] feat(teamsbot): session context textarea in dashboard, API type for sessionContext Co-authored-by: Cursor --- src/api/teamsbotApi.ts | 1 + .../views/teamsbot/TeamsbotDashboardView.tsx | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/api/teamsbotApi.ts b/src/api/teamsbotApi.ts index c7d9988..aca4d71 100644 --- a/src/api/teamsbotApi.ts +++ b/src/api/teamsbotApi.ts @@ -83,6 +83,7 @@ export interface StartSessionRequest { backgroundImageUrl?: string; connectionId?: string; joinMode?: TeamsbotJoinMode; + sessionContext?: string; } export interface ConfigUpdateRequest { diff --git a/src/pages/views/teamsbot/TeamsbotDashboardView.tsx b/src/pages/views/teamsbot/TeamsbotDashboardView.tsx index b607ed0..9be4695 100644 --- a/src/pages/views/teamsbot/TeamsbotDashboardView.tsx +++ b/src/pages/views/teamsbot/TeamsbotDashboardView.tsx @@ -22,6 +22,7 @@ export const TeamsbotDashboardView: React.FC = () => { const [meetingLink, setMeetingLink] = useState(''); const [botName, setBotName] = useState(''); const [joinMode, setJoinMode] = useState('anonymous'); + const [sessionContext, setSessionContext] = useState(''); const [isStarting, setIsStarting] = useState(false); const _loadSessions = useCallback(async () => { @@ -65,6 +66,7 @@ export const TeamsbotDashboardView: React.FC = () => { meetingLink: meetingLink.trim(), botName: botName.trim() || undefined, joinMode: joinMode, + sessionContext: sessionContext.trim() || undefined, }; await teamsbotApi.startSession(instanceId, request); @@ -170,6 +172,23 @@ export const TeamsbotDashboardView: React.FC = () => { />
+
+ +