Skip to content

Commit b8648e1

Browse files
committed
Add Prompt Field section to General settings and relocate related configuration toggles
- rename 'edit formats' to 'edit format instructions' - place 'send with shift+enter' and 'push to talk' in a sub-group 'prompt field'. Locate it above checkpoints.
1 parent 99fadeb commit b8648e1

3 files changed

Lines changed: 69 additions & 39 deletions

File tree

‎apps/editor/src/views/settings/frontend/Home/Home.tsx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { default_system_instructions } from '@shared/constants/default-system-in
2929

3030
export type NavItem =
3131
| 'general'
32+
| 'prompt-field'
3233
| 'checkpoints'
3334
| 'edit-format'
3435
| 'chatbots'
@@ -44,14 +45,19 @@ const NAV_ITEMS_CONFIG: NavConfigItem[] = [
4445
id: 'general',
4546
label: 'sidebar.general'
4647
},
48+
{
49+
id: 'prompt-field',
50+
label: 'general.prompt-field.title',
51+
is_nested: true
52+
},
4753
{
4854
id: 'checkpoints',
4955
label: 'general.checkpoints.title',
5056
is_nested: true
5157
},
5258
{
5359
id: 'edit-format',
54-
label: 'general.edit-formats.title',
60+
label: 'general.edit-format-instructions.title',
5561
is_nested: true
5662
},
5763
{
@@ -159,6 +165,7 @@ export const Home: React.FC<Props> = (props) => {
159165
const scroll_container_ref = useRef<HTMLDivElement>(null)
160166
const section_refs = useRef<Record<NavItem, HTMLDivElement | null>>({
161167
general: null,
168+
'prompt-field': null,
162169
checkpoints: null,
163170
'edit-format': null,
164171
chatbots: null,

‎apps/editor/src/views/settings/frontend/Home/sections/GeneralSection.tsx‎

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -269,26 +269,6 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
269269
/>
270270
}
271271
/>
272-
<UiItem
273-
title={t('general.send-with-shift-enter.title')}
274-
description={t('general.send-with-shift-enter.description')}
275-
slot_right={
276-
<UiToggler
277-
is_on={props.send_with_shift_enter}
278-
on_toggle={props.on_send_with_shift_enter_change}
279-
/>
280-
}
281-
/>
282-
<UiItem
283-
title={t('general.voice-input.push-to-talk.title')}
284-
description={t('general.voice-input.push-to-talk.description')}
285-
slot_right={
286-
<UiToggler
287-
is_on={props.voice_input_push_to_talk}
288-
on_toggle={props.on_voice_input_push_to_talk_change}
289-
/>
290-
}
291-
/>
292272
<UiItem
293273
title={t('general.include-prompts-in-commit-messages.title')}
294274
description={t('general.include-prompts-in-commit-messages.description')}
@@ -335,6 +315,31 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
335315
/>
336316
</UiGroup>
337317

318+
<div ref={(el) => props.set_section_ref('prompt-field', el)}>
319+
<UiGroup title={t('general.prompt-field.title')}>
320+
<UiItem
321+
title={t('general.send-with-shift-enter.title')}
322+
description={t('general.send-with-shift-enter.description')}
323+
slot_right={
324+
<UiToggler
325+
is_on={props.send_with_shift_enter}
326+
on_toggle={props.on_send_with_shift_enter_change}
327+
/>
328+
}
329+
/>
330+
<UiItem
331+
title={t('general.voice-input.push-to-talk.title')}
332+
description={t('general.voice-input.push-to-talk.description')}
333+
slot_right={
334+
<UiToggler
335+
is_on={props.voice_input_push_to_talk}
336+
on_toggle={props.on_voice_input_push_to_talk_change}
337+
/>
338+
}
339+
/>
340+
</UiGroup>
341+
</div>
342+
338343
<div ref={(el) => props.set_section_ref('checkpoints', el)}>
339344
<UiGroup title={t('general.checkpoints.title')}>
340345
<UiItem
@@ -370,7 +375,7 @@ export const GeneralSection = forwardRef<HTMLDivElement, Props>(
370375
</div>
371376

372377
<div ref={(el) => props.set_section_ref('edit-format', el)}>
373-
<UiGroup title={t('general.edit-formats.title')}>
378+
<UiGroup title={t('general.edit-format-instructions.title')}>
374379
<UiItem
375380
title={t('general.edit-format.whole.title')}
376381
description={t('general.edit-format.whole.description')}

‎apps/editor/src/views/settings/frontend/i18n/translations/general.ts‎

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,24 @@ export const general = {
405405
hu: 'Minden Kijelölés Törlése',
406406
bg: 'Размаркиране на всички'
407407
},
408+
'general.prompt-field.title': {
409+
en: 'Prompt Field',
410+
pl: 'Pole promptu',
411+
'zh-cn': '提示字段',
412+
ja: 'プロンプトフィールド',
413+
'zh-tw': '提示欄位',
414+
de: 'Prompt-Feld',
415+
es: 'Campo de prompt',
416+
fr: 'Champ de prompt',
417+
'pt-br': 'Campo de Prompt',
418+
ru: 'Поле промпта',
419+
ko: '프롬프트 필드',
420+
it: 'Campo prompt',
421+
tr: 'İstem Alanı',
422+
cs: 'Pole promptu',
423+
hu: 'Prompt mező',
424+
bg: 'Поле за промпт'
425+
},
408426
'general.checkpoints.title': {
409427
en: 'Checkpoints',
410428
pl: 'Punkty kontrolne',
@@ -497,23 +515,23 @@ export const general = {
497515
hu: 'Élettartam órákban. A régebbiek automatikusan törlődnek.',
498516
bg: 'Продължителност в часове. Старите се изтриват.'
499517
},
500-
'general.edit-formats.title': {
501-
en: 'Edit Formats',
502-
pl: 'Formaty edycji',
503-
'zh-cn': '编辑格式',
504-
ja: '編集フォーマット',
505-
'zh-tw': '編輯格式',
506-
de: 'Bearbeitungsformate',
507-
es: 'Formatos de edición',
508-
fr: "Formats d'édition",
509-
'pt-br': 'Formatos de Edição',
510-
ru: 'Форматы редактирования',
511-
ko: '편집 형식',
512-
it: 'Formati di modifica',
513-
tr: 'Düzenleme Biçimleri',
514-
cs: 'Formáty úprav',
515-
hu: 'Szerkesztési Formátumok',
516-
bg: 'Формати на редактиране'
518+
'general.edit-format-instructions.title': {
519+
en: 'Edit Format Instructions',
520+
pl: 'Instrukcje formatu edycji',
521+
'zh-cn': '编辑格式说明',
522+
ja: '編集フォーマットの指示',
523+
'zh-tw': '編輯格式說明',
524+
de: 'Bearbeitungsformat-Anweisungen',
525+
es: 'Instrucciones de formato de edición',
526+
fr: "Instructions de format d'édition",
527+
'pt-br': 'Instruções de Formato de Edição',
528+
ru: 'Инструкции для форматов редактирования',
529+
ko: '편집 형식 지침',
530+
it: 'Istruzioni formato di modifica',
531+
tr: 'Düzenleme Biçimi Talimatları',
532+
cs: 'Instrukce formátů úprav',
533+
hu: 'Szerkesztési Formátum Utasítások',
534+
bg: 'Инструкции за формати на редактиране'
517535
},
518536
'general.edit-format.whole.title': {
519537
en: 'Whole',

0 commit comments

Comments
 (0)