diff --git a/frontend/src/lib/components/copilot/chat/AIChat.svelte b/frontend/src/lib/components/copilot/chat/AIChat.svelte index 9e41034fbe..ff31146391 100644 --- a/frontend/src/lib/components/copilot/chat/AIChat.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChat.svelte @@ -98,7 +98,9 @@ () => aiChatManager.contextManager.getSelectedContext(), (sc) => aiChatManager.contextManager.setSelectedContext(sc) } - availableContext={aiChatManager.contextManager.getAvailableContext()} + availableContext={aiChatManager.mode === AIMode.APP + ? aiChatManager.getAppAvailableContext() + : aiChatManager.contextManager.getAvailableContext()} messages={aiChatManager.currentReply ? [ ...aiChatManager.displayMessages, diff --git a/frontend/src/lib/components/copilot/chat/AIChatInput.svelte b/frontend/src/lib/components/copilot/chat/AIChatInput.svelte index cf609a5848..457e315d94 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatInput.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChatInput.svelte @@ -1,6 +1,7 @@
@@ -185,6 +401,98 @@ {disabled} {onKeyDown} /> + {:else if aiChatManager.mode === AIMode.APP} + {#if showContext} +
+ + +
@
+
+ + { + addContextToSelection(element) + close() + }} + /> + +
+ {#each selectedContext as element (element.type + '-' + element.title)} + { + selectedContext = selectedContext?.filter( + (c) => c.type !== element.type || c.title !== element.title + ) + }} + /> + {/each} +
+ {/if} +
+ +
+ {#if showAppContextTooltip} + +
+ { + handleAppContextSelection(element) + }} + showAllAvailable={true} + stringSearch={appContextTooltipWord.slice(1)} + onViewChange={(newNumber) => { + appTooltipCurrentViewNumber = newNumber + }} + setShowing={(showing) => { + showAppContextTooltip = showing + }} + /> +
+
+ {/if} {:else}