Resume the dashboard chat from its own profile
It reopened whatever was touched last anywhere, so the card could land in a Scheduler troubleshooting thread with no picker to get back.
This commit is contained in:
@@ -2045,7 +2045,18 @@ vv_ai_profiles_script();
|
|||||||
// Do not clobber a conversation the operator has already started. The list arrives after
|
// Do not clobber a conversation the operator has already started. The list arrives after
|
||||||
// construction, so by the time it lands they may have typed and sent something.
|
// construction, so by the time it lands they may have typed and sent something.
|
||||||
if (messages.length || busy) return;
|
if (messages.length || busy) return;
|
||||||
const last = d.chats.slice().sort((a, b) => (b.updated || 0) - (a.updated || 0))[0];
|
|
||||||
|
// A placement whose profile never moves should not resume a thread from one that does.
|
||||||
|
// The store is shared on purpose — a conversation started on the dashboard is the one you
|
||||||
|
// carry on in the tab — but reopening restores the saved profile too, so the Monitor
|
||||||
|
// card would quietly turn into whatever the Scheduler was last troubleshooting. Filtered
|
||||||
|
// where the page says its profile is fixed; unfiltered on the AI tab, where moving
|
||||||
|
// between profiles is the point and the newest thread is genuinely the one you left.
|
||||||
|
const want = o.resumeProfile || '';
|
||||||
|
const pool = want ? d.chats.filter(c => (c.profile || 'chat') === want) : d.chats;
|
||||||
|
if (!pool.length) return;
|
||||||
|
|
||||||
|
const last = pool.slice().sort((a, b) => (b.updated || 0) - (a.updated || 0))[0];
|
||||||
if (last) loadChat(last.id);
|
if (last) loadChat(last.id);
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2851,6 +2851,11 @@ if (document.getElementById('vv-mon-ai-chat')) {
|
|||||||
const vvMonChat = VvAiChat({
|
const vvMonChat = VvAiChat({
|
||||||
prefix: 'vv-mon-ai',
|
prefix: 'vv-mon-ai',
|
||||||
profile: 'chat',
|
profile: 'chat',
|
||||||
|
// This card is General Chat and stays General Chat — there is no picker on it. Without this
|
||||||
|
// it resumed whatever was most recently touched anywhere, so opening the dashboard could land
|
||||||
|
// it in the middle of a Scheduler troubleshooting thread, retitled and rescoped, on a card
|
||||||
|
// with no obvious way back.
|
||||||
|
resumeProfile: 'chat',
|
||||||
empty: 'Ask anything. Questions about this installation are handed to the Varaverk '
|
empty: 'Ask anything. Questions about this installation are handed to the Varaverk '
|
||||||
+ 'assistant automatically.',
|
+ 'assistant automatically.',
|
||||||
onChats: id => { if (vvMonChatList) vvMonChatList.setActive(id); },
|
onChats: id => { if (vvMonChatList) vvMonChatList.setActive(id); },
|
||||||
|
|||||||
Reference in New Issue
Block a user