- {attachments.map((attachment, index) => (
+ {attachments.map((attachment) => (
{
- if (attachment.id) {
- dispatch(removeAttachment(attachment.id));
- } else if (attachment.taskId) {
- dispatch(removeAttachment(attachment.taskId));
- }
+ dispatch(removeAttachment(attachment.id));
}}
aria-label={t('conversation.attachments.remove')}
>
diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx
index 80ad08b7..77908f8b 100644
--- a/frontend/src/components/Sidebar.tsx
+++ b/frontend/src/components/Sidebar.tsx
@@ -33,7 +33,7 @@ export default function Sidebar({
return (
diff --git a/frontend/src/components/SourcesPopup.tsx b/frontend/src/components/SourcesPopup.tsx
index 0422edf2..b3685921 100644
--- a/frontend/src/components/SourcesPopup.tsx
+++ b/frontend/src/components/SourcesPopup.tsx
@@ -1,4 +1,5 @@
import React, { useRef, useEffect, useState, useLayoutEffect } from 'react';
+import { createPortal } from 'react-dom';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import { Doc } from '../models/misc';
@@ -107,7 +108,7 @@ export default function SourcesPopup({
onClose();
};
- return (
+ const popupContent = (
) : (
- {t('noSourcesAvailable')}
+ {t('conversation.sources.noSourcesAvailable')}
)}
@@ -245,4 +246,6 @@ export default function SourcesPopup({
);
+
+ return createPortal(popupContent, document.body);
}
diff --git a/frontend/src/components/ToolsPopup.tsx b/frontend/src/components/ToolsPopup.tsx
index 6e9756c8..11f01cab 100644
--- a/frontend/src/components/ToolsPopup.tsx
+++ b/frontend/src/components/ToolsPopup.tsx
@@ -1,4 +1,5 @@
import React, { useEffect, useRef, useState, useLayoutEffect } from 'react';
+import { createPortal } from 'react-dom';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { selectToken } from '../preferences/preferenceSlice';
@@ -133,10 +134,10 @@ export default function ToolsPopup({
tool.displayName.toLowerCase().includes(searchTerm.toLowerCase()),
);
- return (
+ const popupContent = (
);
+
+ return createPortal(popupContent, document.body);
}
diff --git a/frontend/src/components/UploadToast.tsx b/frontend/src/components/UploadToast.tsx
index 3d1dd03f..e6122e0e 100644
--- a/frontend/src/components/UploadToast.tsx
+++ b/frontend/src/components/UploadToast.tsx
@@ -44,7 +44,10 @@ export default function UploadToast() {
};
return (
-
+
e.stopPropagation()}
+ >
{uploadTasks
.filter((task) => !task.dismissed)
.map((task) => {
diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx
index 312b92c9..aa11bbde 100644
--- a/frontend/src/conversation/Conversation.tsx
+++ b/frontend/src/conversation/Conversation.tsx
@@ -224,7 +224,7 @@ export default function Conversation() {
-
+
{sources.sources.map((source, index) => {
const isExternalSource = source.link && source.link !== 'local';
return (
diff --git a/frontend/src/conversation/SharedConversation.tsx b/frontend/src/conversation/SharedConversation.tsx
index 9f99db30..cd68df64 100644
--- a/frontend/src/conversation/SharedConversation.tsx
+++ b/frontend/src/conversation/SharedConversation.tsx
@@ -161,14 +161,16 @@ export const SharedConversation = () => {
/>
{apiKey ? (
-
{
- handleQuestionSubmission(text);
- }}
- loading={status === 'loading'}
- showSourceButton={false}
- showToolButton={false}
- />
+
+ {
+ handleQuestionSubmission(text);
+ }}
+ loading={status === 'loading'}
+ showSourceButton={false}
+ showToolButton={false}
+ />
+
) : (