fix: quick-access button title matching for plugin rooms (Assistent, Live KI, System)
This commit is contained in:
@@ -461,16 +461,22 @@ export function MessageSidebar() {
|
|||||||
const handleQuickAccess = (qa: QuickAccessDef) => {
|
const handleQuickAccess = (qa: QuickAccessDef) => {
|
||||||
setCurrentView(qa.view);
|
setCurrentView(qa.view);
|
||||||
if (qa.view === 'conversations' && qa.filterPinned) {
|
if (qa.view === 'conversations' && qa.filterPinned) {
|
||||||
// Find pinned conversation matching the filter
|
// Find pinned conversation matching the filter by title
|
||||||
const filter = qa.filterPinned;
|
const filter = qa.filterPinned;
|
||||||
|
const titleMap: Record<string, string[]> = {
|
||||||
|
assistant: ['Assistent', 'assistent', 'assistant'],
|
||||||
|
liveai: ['Live KI', 'live ki', 'liveai', 'proactive'],
|
||||||
|
system: ['System', 'system'],
|
||||||
|
};
|
||||||
|
const matchTitles = titleMap[filter] || [filter];
|
||||||
const match = pinnedConversations.find((c) =>
|
const match = pinnedConversations.find((c) =>
|
||||||
c.metadata?.room_type === filter ||
|
matchTitles.some((t) => c.title?.toLowerCase() === t.toLowerCase()),
|
||||||
(filter && c.title?.toLowerCase().includes(filter)),
|
|
||||||
);
|
);
|
||||||
if (match) {
|
if (match) {
|
||||||
handleSelectConversation(match.id);
|
handleSelectConversation(match.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Fallback: if no pinned match, just show conversations list
|
||||||
}
|
}
|
||||||
if (qa.view === 'conversations' && !qa.filterPinned) {
|
if (qa.view === 'conversations' && !qa.filterPinned) {
|
||||||
// 'all' — just show the list, select first if none active
|
// 'all' — just show the list, select first if none active
|
||||||
|
|||||||
Reference in New Issue
Block a user