Skip to content

Commit 9ee6504

Browse files
committed
lint
1 parent 9b00c45 commit 9ee6504

File tree

2 files changed

+13
-221
lines changed

2 files changed

+13
-221
lines changed

web/package-lock.json

Lines changed: 7 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/src/app/chat/components/input/ChatInputBar.tsx

Lines changed: 6 additions & 202 deletions
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,11 @@ export const ChatInputBar = React.memo(function ChatInputBar({
503503
suppressContentEditableWarning={true}
504504
/>
505505

506-
<<<<<<< HEAD
507506
{(selectedDocuments.length > 0 ||
508507
currentMessageFiles.length > 0 ||
509508
filterManager.timeRange ||
510509
filterManager.selectedDocumentSets.length > 0 ||
511-
filterManager.selectedTags.length > 0 ||
512-
filterManager.selectedSources.length > 0) && (
510+
filterManager.selectedTags.length > 0) && (
513511
<div className="flex bg-input-background gap-x-.5 px-2">
514512
<div className="flex gap-x-1 px-2 overflow-visible overflow-x-scroll items-end miniscroll">
515513
{filterManager.selectedTags &&
@@ -524,184 +522,6 @@ export const ChatInputBar = React.memo(function ChatInputBar({
524522
(t) => t.tag_key !== tag.tag_key
525523
)
526524
);
527-
=======
528-
{(selectedDocuments.length > 0 ||
529-
selectedFiles.length > 0 ||
530-
selectedFolders.length > 0 ||
531-
currentMessageFiles.length > 0 ||
532-
filterManager.timeRange ||
533-
filterManager.selectedDocumentSets.length > 0 ||
534-
filterManager.selectedTags.length > 0) && (
535-
<div className="flex bg-input-background gap-x-.5 px-2">
536-
<div className="flex gap-x-1 px-2 overflow-visible overflow-x-scroll items-end miniscroll">
537-
{filterManager.selectedTags &&
538-
filterManager.selectedTags.map((tag, index) => (
539-
<SourceChip
540-
key={index}
541-
icon={<TagIcon size={12} />}
542-
title={`#${tag.tag_key}_${tag.tag_value}`}
543-
onRemove={() => {
544-
filterManager.setSelectedTags(
545-
filterManager.selectedTags.filter(
546-
(t) => t.tag_key !== tag.tag_key
547-
)
548-
);
549-
}}
550-
/>
551-
))}
552-
553-
{/* Unified file rendering section for both selected and current message files */}
554-
{allFiles.map((file, index) =>
555-
file.chatFileType === ChatFileType.IMAGE ? (
556-
<SourceChip
557-
key={`${file.source}-${file.id}-${index}`}
558-
icon={
559-
file.isUploading ? (
560-
<FiLoader className="animate-spin" />
561-
) : (
562-
<img
563-
className="h-full py-.5 object-cover rounded-lg bg-background cursor-pointer"
564-
src={buildImgUrl(file.id)}
565-
alt={file.name || "File image"}
566-
/>
567-
)
568-
}
569-
title={file.name}
570-
onRemove={() => {
571-
if (file.source === "selected") {
572-
removeSelectedFile(file.originalFile);
573-
} else {
574-
setCurrentMessageFiles(
575-
currentMessageFiles.filter(
576-
(fileInFilter) => fileInFilter.id !== file.id
577-
)
578-
);
579-
}
580-
}}
581-
/>
582-
) : (
583-
<SourceChip
584-
key={`${file.source}-${file.id}-${index}`}
585-
icon={
586-
<FileIcon
587-
className={
588-
file.source === "current" ? "text-red-500" : ""
589-
}
590-
size={16}
591-
/>
592-
}
593-
title={file.name}
594-
onRemove={() => {
595-
if (file.source === "selected") {
596-
removeSelectedFile(file.originalFile);
597-
} else {
598-
setCurrentMessageFiles(
599-
currentMessageFiles.filter(
600-
(fileInFilter) => fileInFilter.id !== file.id
601-
)
602-
);
603-
}
604-
}}
605-
/>
606-
)
607-
)}
608-
{selectedFolders.map((folder) => (
609-
<SourceChip
610-
key={folder.id}
611-
icon={<FolderIcon size={16} />}
612-
title={folder.name}
613-
onRemove={() => removeSelectedFolder(folder)}
614-
/>
615-
))}
616-
{filterManager.timeRange && (
617-
<SourceChip
618-
truncateTitle={false}
619-
key="time-range"
620-
icon={<CalendarIcon size={12} />}
621-
title={`${getFormattedDateRangeString(
622-
filterManager.timeRange.from,
623-
filterManager.timeRange.to
624-
)}`}
625-
onRemove={() => {
626-
filterManager.setTimeRange(null);
627-
}}
628-
/>
629-
)}
630-
{filterManager.selectedDocumentSets.length > 0 &&
631-
filterManager.selectedDocumentSets.map((docSet, index) => (
632-
<SourceChip
633-
key={`doc-set-${index}`}
634-
icon={<DocumentIcon2 size={16} />}
635-
title={docSet}
636-
onRemove={() => {
637-
filterManager.setSelectedDocumentSets(
638-
filterManager.selectedDocumentSets.filter(
639-
(ds) => ds !== docSet
640-
)
641-
);
642-
}}
643-
/>
644-
))}
645-
{selectedDocuments.length > 0 && (
646-
<SourceChip
647-
key="selected-documents"
648-
onClick={() => {
649-
toggleDocumentSidebar();
650-
}}
651-
icon={<FileIcon size={16} />}
652-
title={`${selectedDocuments.length} selected`}
653-
onRemove={removeDocs}
654-
/>
655-
)}
656-
</div>
657-
</div>
658-
)}
659-
660-
<div className="flex pr-4 pb-2 justify-between bg-input-background items-center w-full ">
661-
<div className="space-x-1 flex px-4 ">
662-
<ChatInputOption
663-
flexPriority="stiff"
664-
Icon={FileUploadIcon}
665-
onClick={() => {
666-
toggleDocSelection();
667-
}}
668-
tooltipContent={"Upload files and attach user files"}
669-
/>
670-
671-
{selectedAssistant.tools.length > 0 && (
672-
<ActionToggle
673-
selectedAssistant={selectedAssistant}
674-
availableSources={memoizedAvailableSources}
675-
filterManager={filterManager}
676-
/>
677-
)}
678-
679-
{retrievalEnabled &&
680-
settings?.settings.deep_research_enabled && (
681-
<DeepResearchToggle
682-
deepResearchEnabled={deepResearchEnabled}
683-
toggleDeepResearch={toggleDeepResearch}
684-
/>
685-
)}
686-
687-
{forcedToolIds.length > 0 && (
688-
<div className="pl-1 flex items-center gap-2 text-blue-500">
689-
{forcedToolIds.map((toolId) => {
690-
const tool = selectedAssistant.tools.find(
691-
(tool) => tool.id === toolId
692-
);
693-
if (!tool) {
694-
return null;
695-
}
696-
return (
697-
<SelectedTool
698-
key={toolId}
699-
tool={tool}
700-
onClick={() => {
701-
setForcedToolIds((prev) =>
702-
prev.filter((id) => id !== toolId)
703-
);
704-
>>>>>>> e5547fb2c (enable all by default and persist user choice)
705525
}}
706526
/>
707527
))}
@@ -737,26 +557,6 @@ export const ChatInputBar = React.memo(function ChatInputBar({
737557
/>
738558
)
739559
)}
740-
{filterManager.selectedSources.length > 0 &&
741-
filterManager.selectedSources.map((source, index) => (
742-
<SourceChip
743-
key={`source-${index}`}
744-
icon={
745-
<SourceIcon
746-
sourceType={source.internalName}
747-
iconSize={16}
748-
/>
749-
}
750-
title={source.displayName}
751-
onRemove={() => {
752-
filterManager.setSelectedSources(
753-
filterManager.selectedSources.filter(
754-
(s) => s.internalName !== source.internalName
755-
)
756-
);
757-
}}
758-
/>
759-
))}
760560
{selectedDocuments.length > 0 && (
761561
<SourceChip
762562
key="selected-documents"
@@ -792,7 +592,11 @@ export const ChatInputBar = React.memo(function ChatInputBar({
792592
/>
793593

794594
{selectedAssistant.tools.length > 0 && (
795-
<ActionToggle selectedAssistant={selectedAssistant} />
595+
<ActionToggle
596+
selectedAssistant={selectedAssistant}
597+
availableSources={memoizedAvailableSources}
598+
filterManager={filterManager}
599+
/>
796600
)}
797601

798602
{retrievalEnabled &&

0 commit comments

Comments
 (0)