Skip to content

Commit 23e3b3c

Browse files
committed
Add accuracy boost info modal triggered by clicking the accuracy boost symbol
- the 'accuracy boost symbol should have different css styling: gradient from left to right red -> #FDCF58, white icon, text - add missing translations [Fragment] - when clicking on 'accuracy boost' symbol, show modal with info text: "Accuracy boost is enabled for these instructions by placing them also at the top of the message. Remove symbol to disable.". do it via backed handler. - put it in a handler file, translate the text. - translate [Fragment] ├── apps │ └── editor │ └── src │ ├── i18n │ │ └── translations │ │ └── views │ │ ├── prompt │ │ │ └── handlers │ │ │ ├── handle-agentic-search.ts │ │ │ ├── handle-autofill.ts │ │ │ ├── handle-clear-completed-tasks.ts │ │ │ ├── handle-copy-prompt.ts │ │ │ ├── handle-delete-task.ts │ │ │ ├── handle-invoke-agentic-cli.ts │ │ │ ├── handle-make-api-call.ts │ │ │ ├── handle-patch-repair.ts │ │ │ ├── handle-save-completed-tasks.ts │ │ │ ├── handle-select-edit-format-instructions.ts │ │ │ ├── handle-show-accuracy-boost-info.ts │ │ │ ├── handle-template-quick-pick.ts │ │ │ ├── handle-undo.ts │ │ │ ├── handle-voice-input.ts │ │ │ ├── index.ts │ │ │ └── utils │ │ │ ├── index.ts │ │ │ └── symbols │ │ │ ├── git │ │ │ │ ├── index.ts │ │ │ │ └── replace-git-symbols.ts │ │ │ └── index.ts │ │ └── shared │ │ └── utils │ │ └── hash-sign-quick-pick.ts │ └── views │ ├── prompt │ │ ├── backend │ │ │ ├── message-handlers │ │ │ │ ├── handle-preview-saved-context-symbol.ts │ │ │ │ ├── handle-preview-skill-symbol.ts │ │ │ │ ├── handle-show-accuracy-boost-info.ts │ │ │ │ └── index.ts │ │ │ ├── prompt-view-provider.ts │ │ │ └── utils │ │ │ └── symbols │ │ │ └── replace-symbols.ts │ │ ├── frontend │ │ │ ├── Main │ │ │ │ ├── Main.tsx │ │ │ │ └── MainView │ │ │ │ └── MainView.tsx │ │ │ ├── Prompt.tsx │ │ │ ├── hooks │ │ │ │ └── use-prompt │ │ │ │ └── use-prompt.ts │ │ │ └── i18n │ │ │ └── translations │ │ │ └── prompt-field.ts │ │ └── types │ │ └── messages.ts │ ├── settings │ │ └── frontend │ │ ├── Settings.tsx │ │ └── forms │ │ └── EditTemplateForm │ │ └── EditTemplateForm.tsx │ └── shared │ └── utils │ └── hash-sign-quick-pick │ └── hash-sign-quick-pick.ts └── packages └── ui └── src └── components └── editor └── common └── prompts ├── PromptField │ ├── PromptField.tsx │ └── hooks │ └── use-handlers │ └── handle-input-click.ts ├── Template │ └── Template.tsx └── shared └── symbols ├── get-highlighted-text.tsx ├── prompt-symbols.module.scss └── use-symbol-deletion.ts
1 parent 1fc98c8 commit 23e3b3c

13 files changed

Lines changed: 86 additions & 26 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export const translations = {
2+
'views.prompt.handlers.handle-show-accuracy-boost-info.message': {
3+
en: 'Accuracy boost is enabled for these instructions by placing them also at the top of the prompt. Remove symbol to disable.',
4+
pl: 'Zwiększenie dokładności jest włączone dla tych instrukcji poprzez umieszczenie ich również na górze prompta. Usuń symbol, aby wyłączyć.',
5+
'zh-cn': '准确率提升已启用,这些指令也会放在提示词的顶部。移除符号即可禁用。',
6+
ja: 'これらの指示の精度向上が有効になっており、プロンプトの上部にも配置されます。無効にするには記号を削除してください。',
7+
'zh-tw': '準確率提升已啟用,這些指令也會放在提示詞的頂部。移除符號即可停用。',
8+
de: 'Die Genauigkeitssteigerung ist für diese Anweisungen aktiviert, indem sie auch ganz oben in den Prompt eingefügt werden. Symbol entfernen, um sie zu deaktivieren.',
9+
es: 'La mejora de precisión está habilitada para estas instrucciones colocándolas también en la parte superior del aviso. Elimina el símbolo para desactivar.',
10+
fr: "L'amélioration de la précision est activée pour ces instructions en les plaçant également en haut de l'invite. Retirez le symbole pour désactiver.",
11+
'pt-br': 'O aumento de precisão está ativado para essas instruções, colocando-as também na parte superior do prompt. Remova o símbolo para desativar.',
12+
ru: 'Повышение точности для этих инструкций включено за счет их размещения также в верхней части промпта. Удалите символ, чтобы отключить.',
13+
ko: '이러한 지침을 프롬프트 상단에도 배치하여 정확도 향상이 활성화되었습니다. 비활성화하려면 기호를 제거하세요.',
14+
it: "L'incremento di precisione è abilitato per queste istruzioni inserendole anche all'inizio del prompt. Rimuovi il simbolo per disabilitarlo.",
15+
tr: 'Bu talimatlar için doğruluk artışı, onları istemin en üstüne de yerleştirerek etkinleştirilir. Devre dışı bırakmak için sembolü kaldırın.',
16+
cs: 'Zvýšení přesnosti je pro tyto instrukce povoleno tím, že se umístí také na začátek výzvy. Odstraňte symbol pro deaktivaci.',
17+
hu: 'A pontosságnövelés be van kapcsolva ezekhez az utasításokhoz, mivel a prompt tetejére is felkerülnek. A kikapcsoláshoz távolítsa el a szimbólumot.',
18+
bg: 'Повишаването на точността е активирано за тези инструкции, като те се поставят и в горната част на промпта. Премахнете символа, за да деактивирате.'
19+
}
20+
} as const

‎apps/editor/src/i18n/translations/views/prompt/handlers/handle-template-quick-pick.ts‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎apps/editor/src/i18n/translations/views/prompt/handlers/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { translations as handle_voice_input } from './handle-voice-input'
55
import { translations as handle_copy_prompt } from './handle-copy-prompt'
66
import { translations as handle_undo } from './handle-undo'
77
import { translations as utils } from './utils'
8-
import { translations as handle_template_quick_pick } from './handle-template-quick-pick'
98
import { translations as handle_patch_repair } from './handle-patch-repair'
109
import { translations as handle_agentic_search } from './handle-agentic-search'
1110
import { translations as handle_autofill } from './handle-autofill'
1211
import { translations as handle_invoke_agentic_cli } from './handle-invoke-agentic-cli'
1312
import { translations as handle_save_completed_tasks } from './handle-save-completed-tasks'
1413
import { translations as handle_clear_completed_tasks } from './handle-clear-completed-tasks'
14+
import { translations as handle_show_accuracy_boost_info } from './handle-show-accuracy-boost-info'
1515
export const translations = {
1616
...handle_delete_task,
1717
...handle_make_api_call,
@@ -20,11 +20,11 @@ export const translations = {
2020
...handle_copy_prompt,
2121
...handle_undo,
2222
...utils,
23-
...handle_template_quick_pick,
2423
...handle_patch_repair,
2524
...handle_agentic_search,
2625
...handle_autofill,
2726
...handle_invoke_agentic_cli,
2827
...handle_save_completed_tasks,
29-
...handle_clear_completed_tasks
28+
...handle_clear_completed_tasks,
29+
...handle_show_accuracy_boost_info
3030
}

‎apps/editor/src/i18n/translations/views/shared/utils/hash-sign-quick-pick.ts‎

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -332,22 +332,25 @@ export const translations = {
332332
},
333333
'views.shared.utils.hash-sign-quick-pick.quick-pick.accuracy-boost.confirm-modal.message':
334334
{
335-
en: 'Heads up! Using Accuracy Boost will disable prompt caching by placing instructions also at the top of the constructed message. Quotas could be drained faster. Do you want to continue?',
336-
pl: 'Uwaga! Użycie Zwiększenia dokładności wyłączy prompt cache poprzez umieszczenie instrukcji również na górze skonstruowanej wiadomości. Limity mogą się szybciej wyczerpywać. Czy chcesz kontynuować?',
337-
'zh-cn': '注意!使用提升准确度将把指令也放在构建消息的顶部,从而禁用提示缓存。配额可能会消耗得更快。您想继续吗?',
338-
ja: '注意!「精度向上」を使用すると、構築されたメッセージの先頭にも指示が配置されるため、プロンプトのキャッシュが無効になります。クォータがより早く消費される可能性があります。続行しますか?',
339-
'zh-tw': '注意!使用提升準確度將把指令也放在構建訊息的頂部,從而禁用提示緩存。配額可能會消耗得更快。您想繼續嗎?',
340-
de: 'Achtung! Die Verwendung der Genauigkeitssteigerung deaktiviert das Prompt-Caching, da die Anweisungen auch am Anfang der erstellten Nachricht platziert werden. Kontingente könnten schneller aufgebraucht werden. Möchten Sie fortfahren?',
341-
es: '¡Atención! Usar el Aumento de precisión desactivará el almacenamiento en caché de los prompts colocando las instrucciones también en la parte superior del mensaje construido. Las cuotas podrían agotarse más rápido. ¿Desea continuar?',
342-
fr: "Attention ! L'utilisation de l'augmentation de la précision désactivera la mise en cache des prompts en plaçant également des instructions en haut du message construit. Les quotas pourraient s'épuiser plus rapidement. Voulez-vous continuer ?",
343-
'pt-br': 'Atenção! Usar o Aumento de precisão desativará o cache do prompt colocando as instruções também no topo da mensagem construída. As cotas podem se esgotar mais rapidamente. Deseja continuar?',
344-
ru: 'Внимание! Использование функции «Повышение точности» отключит кэширование промптов, поскольку инструкции также будут помещены в начало созданного сообщения. Квоты могут исчерпываться быстрее. Хотите продолжить?',
345-
ko: '주의! 정확도 향상을 사용하면 작성된 메시지 상단에도 지침이 배치되어 프롬프트 캐싱이 비활성화됩니다. 할당량이 더 빨리 소진될 수 있습니다. 계속하시겠습니까?',
346-
it: "Attenzione! L'utilizzo dell'Aumento di precisione disabiliterà la memorizzazione nella cache del prompt inserendo le istruzioni anche all'inizio del messaggio creato. Le quote potrebbero esaurirsi più velocemente. Vuoi continuare?",
347-
tr: 'Dikkat! Doğruluk artışını kullanmak, talimatları oluşturulan mesajın en üstüne de yerleştirerek istem önbelleğe almayı devre dışı bırakır. Kotalar daha hızlı tükenebilir. Devam etmek istiyor musunuz?',
348-
cs: 'Pozor! Použití Zvýšení přesnosti deaktivuje ukládání promptů do mezipaměti tím, že instrukce umístí také na začátek sestavené zprávy. Kvóty by se mohly vyčerpat rychleji. Chcete pokračovat?',
349-
hu: 'Figyelem! A Pontosságnövelés használata letiltja a prompt gyorsítótárazását azáltal, hogy az utasításokat az összeállított üzenet tetejére is elhelyezi. A kvóták gyorsabban kimerülhetnek. Szeretné folytatni?',
350-
bg: 'Внимание! Използването на Повишаване на точността ще деактивира кеширането на промптове, като постави инструкции също и в горната част на конструираното съобщение. Квотите могат да се изчерпят по-бързо. Искате ли да продължите?'
335+
en: 'Heads up! Using Accuracy Boost will disable prompt caching by placing instructions also at the top of the constructed message. Quotas could be drained faster or API costs higher. Do you want to continue?',
336+
pl: 'Uwaga! Użycie Zwiększenia dokładności wyłączy prompt cache poprzez umieszczenie instrukcji również na górze skonstruowanej wiadomości. Limity mogą się szybciej wyczerpywać lub koszty API być wyższe. Czy chcesz kontynuować?',
337+
'zh-cn':
338+
'注意!使用“准确度提升”将在构建的消息顶部也放置指令,从而禁用提示缓存。配额可能会消耗得更快,或者 API 成本更高。您要继续吗?',
339+
ja: '注意!「精度向上」を使用すると、構築されたメッセージの先頭にも指示が配置されるため、プロンプトキャッシングが無効になります。クオータの消費が早くなったり、API コストが高くなる可能性があります。続行しますか?',
340+
'zh-tw':
341+
'注意!使用「準確度提升」將在建構的訊息頂部也放置指令,從而停用提示快取。配額可能會消耗得更快,或者 API 成本更高。您要繼續嗎?',
342+
de: 'Achtung! Die Verwendung der Genauigkeitssteigerung deaktiviert das Prompt-Caching, indem Anweisungen auch am Anfang der erstellten Nachricht platziert werden. Quoten könnten schneller aufgebraucht werden oder API-Kosten höher sein. Möchten Sie fortfahren?',
343+
es: '¡Atención! El uso de "Aumento de precisión" desactivará el almacenamiento en caché del prompt al colocar las instrucciones también en la parte superior del mensaje construido. Las cuotas podrían agotarse más rápido o los costos de la API ser mayores. ¿Deseas continuar?',
344+
fr: "Attention ! L'utilisation de l'augmentation de la précision désactivera la mise en cache des prompts en plaçant également les instructions en haut du message construit. Les quotas pourraient être épuisés plus rapidement ou les coûts de l'API pourraient être plus élevés. Voulez-vous continuer ?",
345+
'pt-br':
346+
'Atenção! O uso do Aumento de Precisão desativará o cache do prompt, colocando as instruções também no topo da mensagem construída. As cotas podem ser esgotadas mais rapidamente ou os custos da API podem ser mais altos. Deseja continuar?',
347+
ru: 'Внимание! Использование функции «Повышение точности» отключит кэширование промптов, поскольку инструкции будут размещены также в начале создаваемого сообщения. Квоты могут исчерпываться быстрее, а затраты на API — возрасти. Вы хотите продолжить?',
348+
ko: '주의! 정확도 향상을 사용하면 구성된 메시지의 맨 위에도 지침이 배치되어 프롬프트 캐싱이 비활성화됩니다. 할당량이 더 빨리 소진되거나 API 비용이 높아질 수 있습니다. 계속하시겠습니까?',
349+
it: "Attenzione! L'uso di Aumento di precisione disabiliterà la memorizzazione nella cache del prompt posizionando le istruzioni anche all'inizio del messaggio creato. Le quote potrebbero esaurirsi più velocemente o i costi dell'API potrebbero essere più elevati. Vuoi continuare?",
350+
tr: 'Dikkat! Doğruluk Artışını kullanmak, talimatları oluşturulan mesajın en üstüne de yerleştirerek istemci önbelleğe almayı devre dışı bırakır. Kotalar daha hızlı tükenebilir veya API maliyetleri daha yüksek olabilir. Devam etmek istiyor musunuz?',
351+
cs: 'Pozor! Použití funkce Zvýšení přesnosti zakáže ukládání promptů do mezipaměti tím, že instrukce umístí i na začátek sestavené zprávy. Kvóty by se mohly vyčerpat rychleji nebo by mohly být vyšší náklady na API. Chcete pokračovat?',
352+
hu: 'Figyelem! A Pontosságnövelés használata letiltja a prompt gyorsítótárazását azáltal, hogy az utasításokat a megszerkesztett üzenet tetejére is elhelyezi. A kvóták gyorsabban kimerülhetnek, vagy az API költségei magasabbak lehetnek. Szeretné folytatni?',
353+
bg: 'Внимание! Използването на Повишаване на точността ще деактивира кеширането на промпта, като постави инструкциите и в горната част на конструираното съобщение. Квотите могат да бъдат изчерпани по-бързо или разходите за API да бъдат по-високи. Искате ли да продължите?'
351354
},
352355
'views.shared.utils.hash-sign-quick-pick.quick-pick.accuracy-boost.confirm-modal.confirm':
353356
{
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as vscode from 'vscode'
2+
import { t } from '@/i18n'
3+
4+
export const handle_show_accuracy_boost_info = async () => {
5+
await vscode.window.showInformationMessage(
6+
t('views.prompt.handlers.handle-show-accuracy-boost-info.message'),
7+
{ modal: true }
8+
)
9+
}

‎apps/editor/src/views/prompt/backend/message-handlers/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ export * from './handle-pick-example-flags'
6464
export * from './handle-get-completed-tasks'
6565
export * from './handle-save-completed-tasks'
6666
export * from './handle-clear-completed-tasks'
67+
export * from './handle-show-accuracy-boost-info'

‎apps/editor/src/views/prompt/backend/prompt-view-provider.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ import {
9999
handle_pick_example_flags,
100100
handle_get_completed_tasks,
101101
handle_save_completed_tasks,
102-
handle_clear_completed_tasks
102+
handle_clear_completed_tasks,
103+
handle_show_accuracy_boost_info
103104
} from './message-handlers'
104105
import { handle_agentic_search } from './message-handlers/handle-agentic-search'
105106
import { handle_preview_saved_context_symbol } from './message-handlers/handle-preview-saved-context-symbol'
@@ -906,6 +907,8 @@ export class PromptViewProvider implements vscode.WebviewViewProvider {
906907
})
907908
} else if (message.command === 'AGENTIC_SEARCH') {
908909
await handle_agentic_search(this)
910+
} else if (message.command === 'SHOW_ACCURACY_BOOST_INFO') {
911+
await handle_show_accuracy_boost_info()
909912
} else if (message.command === 'GET_CLI_CONFIGURATIONS') {
910913
this.send_cli_configurations_to_webview(webview_view.webview)
911914
} else if (message.command === 'CREATE_CLI_CONFIGURATION') {

‎apps/editor/src/views/prompt/frontend/Main/Main.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,11 @@ export const Main: React.FC<Props> = (props) => {
735735
context_name
736736
})
737737
}}
738+
on_accuracy_boost_click={() => {
739+
post_message(vscode, {
740+
command: 'SHOW_ACCURACY_BOOST_INFO'
741+
})
742+
}}
738743
on_install_browser_extension={handle_install_browser_extension}
739744
on_agentic_search={props.on_agentic_search}
740745
on_clear_context={handle_clear_context}

‎apps/editor/src/views/prompt/frontend/Main/MainView/MainView.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ type Props = {
146146
) => void
147147
on_skill_click?: (agent: string, repo: string, skill_name: string) => void
148148
on_saved_context_click?: (context_type: string, context_name: string) => void
149+
on_accuracy_boost_click?: () => void
149150
on_install_browser_extension: () => void
150151
on_agentic_search: () => void
151152
on_clear_context: () => void
@@ -508,6 +509,7 @@ export const MainView: React.FC<Props> = (props) => {
508509
on_commit_click={props.on_commit_click}
509510
on_skill_click={props.on_skill_click}
510511
on_saved_context_click={props.on_saved_context_click}
512+
on_accuracy_boost_click={props.on_accuracy_boost_click}
511513
on_preview_prompt={props.on_preview_prompt}
512514
is_recording={props.is_recording}
513515
on_recording_started={props.on_recording_started}

‎apps/editor/src/views/prompt/types/messages.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,10 @@ export interface AgenticSearchMessage extends BaseMessage {
611611
command: 'AGENTIC_SEARCH'
612612
}
613613

614+
export interface ShowAccuracyBoostInfoMessage extends BaseMessage {
615+
command: 'SHOW_ACCURACY_BOOST_INFO'
616+
}
617+
614618
export interface InstallBrowserExtensionMessage extends BaseMessage {
615619
command: 'INSTALL_BROWSER_EXTENSION'
616620
}
@@ -730,6 +734,7 @@ export type FrontendMessage =
730734
| PreviewSkillSymbolMessage
731735
| PreviewSavedContextSymbolMessage
732736
| AgenticSearchMessage
737+
| ShowAccuracyBoostInfoMessage
733738
| GetAgentConfigurationsMessage
734739
| ReorderAgentConfigurationsMessage
735740
| TogglePinnedAgentConfigurationMessage

0 commit comments

Comments
 (0)