style: improved layout and functionality for the prompt editing field.

This commit is contained in:
kangfenmao 2024-10-17 16:52:18 +08:00
parent d98020e12c
commit 2c28e3bb76
2 changed files with 20 additions and 16 deletions

View File

@ -109,21 +109,25 @@ const AgentEditPage: FC = () => {
<Form.Item name="name" label={t('agents.add.name')} rules={[{ required: true }]}>
<Input placeholder={t('agents.add.name.placeholder')} spellCheck={false} allowClear />
</Form.Item>
<div style={{ position: 'relative' }}>
<Form.Item
name="prompt"
label={t('agents.add.prompt')}
rules={[{ required: true }]}
style={{ position: 'relative' }}>
<TextArea placeholder={t('agents.add.prompt.placeholder')} spellCheck={false} rows={10} />
</Form.Item>
<Button
icon={loading ? <LoadingOutlined /> : <ThunderboltOutlined />}
onClick={handleButtonClick}
style={{ position: 'absolute', top: 8, right: 8 }}
disabled={loading}
/>
</div>
<Form.Item
name="prompt"
label={
<>
{t('agents.add.prompt')}{' '}
<Button
size="small"
style={{ marginLeft: 5 }}
type="text"
icon={loading ? <LoadingOutlined /> : <ThunderboltOutlined />}
onClick={handleButtonClick}
disabled={loading}
/>
</>
}
rules={[{ required: true }]}
style={{ position: 'relative' }}>
<TextArea placeholder={t('agents.add.prompt.placeholder')} spellCheck={false} rows={10} />
</Form.Item>
<Form.Item wrapperCol={{ span: 16 }}>
<Button type="primary" htmlType="submit">
{t('common.save')}

View File

@ -161,7 +161,7 @@ const Assistants: FC<Props> = ({
suffix={<CommandKey>+K</CommandKey>}
value={search}
onChange={(e) => setSearch(e.target.value)}
style={{ borderRadius: 4, borderWidth: 0.5 }}
style={{ borderRadius: 16, borderWidth: 0.5 }}
onKeyDown={onSearch}
ref={searchRef}
onFocus={() => dispatch(setSearching(true))}