Skip to content

Commit 28f84fc

Browse files
francescoopiccoliFrancesco Piccoli
andauthored
fix: remove @ mention in placeholder q chat text if agentic mode not available (#1311)
* fix: remove @ mention in placeholder q chat text if agentic mode not available * style: rename DEFAULT_TAB_DATA to getDefaultTabConfig --------- Co-authored-by: Francesco Piccoli <[email protected]>
1 parent 35f3078 commit 28f84fc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

chat-client/src/client/chat.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ import { TabFactory } from './tabs/tabFactory'
9191
import { ChatClientAdapter } from '../contracts/chatClientAdapter'
9292
import { toMynahContextCommand, toMynahIcon } from './utils'
9393

94-
const DEFAULT_TAB_DATA = {
95-
tabTitle: 'Chat',
96-
promptInputInfo:
97-
'Amazon Q Developer uses generative AI. You may need to verify responses. See the [AWS Responsible AI Policy](https://aws.amazon.com/machine-learning/responsible-ai/policy/).',
98-
promptInputPlaceholder: 'Ask a question. Use @ to add context, / for quick actions',
94+
const getDefaultTabConfig = (agenticMode?: Boolean) => {
95+
return {
96+
tabTitle: 'Chat',
97+
promptInputInfo:
98+
'Amazon Q Developer uses generative AI. You may need to verify responses. See the [AWS Responsible AI Policy](https://aws.amazon.com/machine-learning/responsible-ai/policy/).',
99+
promptInputPlaceholder: `Ask a question. Use${agenticMode ? ' @ to add context,' : ''} / for quick actions`,
100+
}
99101
}
100102

101103
type ChatClientConfig = Pick<MynahUIDataModel, 'quickActionCommands'> & {
@@ -374,7 +376,7 @@ export const createChat = (
374376
}
375377

376378
const messager = new Messager(chatApi)
377-
const tabFactory = new TabFactory(DEFAULT_TAB_DATA, [
379+
const tabFactory = new TabFactory(getDefaultTabConfig(config?.agenticMode), [
378380
...(config?.quickActionCommands ? config.quickActionCommands : []),
379381
])
380382

0 commit comments

Comments
 (0)