feat: match Code Interpreter file upload to the File Search dropzone

Swap Code Interpreter's thin btn-neutral bar for the same dashed dropzone
(DropzoneContent + dropzoneClassName) File Search already uses, so the two
capabilities' upload UIs are consistent.
This commit is contained in:
Marco Beretta 2026-07-01 23:00:22 +02:00
parent 7d18dd6dc4
commit cec2b92459
No known key found for this signature in database
GPG key ID: D918033D8E74CC11

View file

@ -1,10 +1,10 @@
import { memo, useMemo, useRef, useState } from 'react';
import { useFormContext } from 'react-hook-form';
import { AttachmentIcon } from '@librechat/client';
import { EToolResources, EModelEndpoint, AgentCapabilities } from 'librechat-data-provider';
import type { ExtendedFile, AgentForm } from '~/common';
import { useFileHandlingNoChatContext } from '~/hooks/Files/useFileHandling';
import { useAgentFileConfig, useLocalize, useLazyEffect } from '~/hooks';
import DropzoneContent, { dropzoneClassName } from '../UploadDropzone';
import FileRow from '~/components/Chat/Input/Files/FileRow';
import { isEphemeralAgent } from '~/common';
@ -87,23 +87,23 @@ function Files({
<button
type="button"
disabled={uploadDisabled}
className="btn btn-neutral border-token-border-light relative h-9 w-full rounded-lg text-sm font-medium"
className={dropzoneClassName}
onClick={handleButtonClick}
>
<div className="flex w-full items-center justify-center gap-1">
<input
multiple={true}
type="file"
style={{ display: 'none' }}
tabIndex={-1}
ref={fileInputRef}
disabled={uploadDisabled}
onChange={handleFileUpload}
/>
<AttachmentIcon className="text-token-text-primary h-4 w-4" />
{localize('com_ui_upload_code_environment')}
</div>
<DropzoneContent
label={localize('com_ui_upload_code_environment')}
hint={localize('com_ui_upload_files_hint')}
/>
</button>
<input
multiple={true}
type="file"
style={{ display: 'none' }}
tabIndex={-1}
ref={fileInputRef}
disabled={uploadDisabled}
onChange={handleFileUpload}
/>
</div>
</div>
</div>