From 73210a869048d6468b55717660d0ca558d0c2aab Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期一, 24 十一月 2025 09:49:43 +0800
Subject: [PATCH] 优化
---
app/components/app/configuration/config-prompt/simple-prompt-input.tsx | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/app/components/app/configuration/config-prompt/simple-prompt-input.tsx b/app/components/app/configuration/config-prompt/simple-prompt-input.tsx
index 3268c1d..c0c1048 100644
--- a/app/components/app/configuration/config-prompt/simple-prompt-input.tsx
+++ b/app/components/app/configuration/config-prompt/simple-prompt-input.tsx
@@ -6,9 +6,10 @@
import produce from 'immer'
import { useContext } from 'use-context-selector'
import ConfirmAddVar from './confirm-add-var'
+import s from './style.module.css'
import PromptEditorHeightResizeWrap from './prompt-editor-height-resize-wrap'
import cn from '@/utils/classnames'
-import type { PromptVariable } from '@/models/debug'
+import { type PromptVariable } from '@/models/debug'
import Tooltip from '@/app/components/base/tooltip'
import type { CompletionParams } from '@/types/app'
import { AppType } from '@/types/app'
@@ -27,7 +28,6 @@
import { PROMPT_EDITOR_UPDATE_VALUE_BY_EVENT_EMITTER } from '@/app/components/base/prompt-editor/plugins/update-block'
import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
import { useFeaturesStore } from '@/app/components/base/features/hooks'
-import { noop } from 'lodash-es'
export type ISimplePromptInput = {
mode: AppType
@@ -48,6 +48,7 @@
readonly = false,
onChange,
noTitle,
+ gradientBorder,
editorHeight: initEditorHeight,
noResize,
}) => {
@@ -160,12 +161,12 @@
const [editorHeight, setEditorHeight] = useState(minHeight)
return (
- <div className={cn('relative rounded-xl bg-gradient-to-r from-components-input-border-active-prompt-1 to-components-input-border-active-prompt-2 p-0.5 shadow-xs')}>
- <div className='rounded-xl bg-background-section-burn'>
+ <div className={cn((!readonly || gradientBorder) ? `${s.gradientBorder}` : 'bg-gray-50', ' relative shadow-md')}>
+ <div className='rounded-xl bg-[#EEF4FF]'>
{!noTitle && (
- <div className="flex h-11 items-center justify-between pl-3 pr-2.5">
+ <div className="flex justify-between items-center h-11 pl-3 pr-6">
<div className="flex items-center space-x-1">
- <div className='h2 system-sm-semibold-uppercase text-text-secondary'>{mode !== AppType.completion ? t('appDebug.chatSubTitle') : t('appDebug.completionSubTitle')}</div>
+ <div className='h2'>{mode !== AppType.completion ? t('appDebug.chatSubTitle') : t('appDebug.completionSubTitle')}</div>
{!readonly && (
<Tooltip
popupContent={
@@ -176,23 +177,23 @@
/>
)}
</div>
- <div className='flex items-center'>
+ {/* <div className='flex items-center'>
{!readonly && !isMobile && (
<AutomaticBtn onClick={showAutomaticTrue} />
)}
- </div>
+ </div> */}
</div>
)}
<PromptEditorHeightResizeWrap
- className='min-h-[228px] rounded-t-xl bg-background-default px-4 pt-2 text-sm text-text-secondary'
+ className='px-4 pt-2 min-h-[228px] bg-white rounded-t-xl text-sm text-gray-700'
height={editorHeight}
minHeight={minHeight}
onHeightChange={setEditorHeight}
hideResize={noResize}
footer={(
- <div className='flex rounded-b-xl bg-background-default pb-2 pl-4'>
- <div className="h-[18px] rounded-md bg-components-badge-bg-gray-soft px-1 text-xs leading-[18px] text-text-tertiary">{promptTemplate.length}</div>
+ <div className='pl-4 pb-2 flex bg-white rounded-b-xl'>
+ <div className="h-[18px] leading-[18px] px-1 rounded-md bg-gray-100 text-xs text-gray-500">{promptTemplate.length}</div>
</div>
)}
>
@@ -234,15 +235,14 @@
user: '',
assistant: '',
},
- onEditRole: noop,
+ onEditRole: () => { },
}}
queryBlock={{
show: false,
selectable: !hasSetBlockStatus.query,
}}
onChange={(value) => {
- if (handleChange)
- handleChange(value, [])
+ handleChange?.(value, [])
}}
onBlur={() => {
handleChange(promptTemplate, getVars(promptTemplate))
--
Gitblit v1.8.0