-
Notifications
You must be signed in to change notification settings - Fork 73
feat: added support for injecting additional context commands #1045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
client/vscode/src/chatActivation.ts
Outdated
amazonQChat.createChat(acquireVsCodeApi(), | ||
{disclaimerAcknowledged: false}, | ||
undefined, | ||
undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have example to show @sage
injected here please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add
chat-client/src/client/mynahUi.ts
Outdated
@@ -200,10 +201,11 @@ export const createMynahUi = ( | |||
}, | |||
onTabAdd: (tabId: string) => { | |||
const defaultTabBarData = tabFactory.getDefaultTabData() | |||
const contextCommands = [...(contextCommandGroups || []), ...(featureConfig?.get('contextCommands') || [])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we doing here some thing different in comparison to what was done above? Can we share the logic? Why is 'contextCommands' key used here, but not in the logic above?
chat-client/src/client/chat.ts
Outdated
|
||
const additionalContextCommands: any[] = [] | ||
featureConfig.forEach((featureContext: FeatureContext, _feature: string) => { | ||
additionalContextCommands.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think it's safe to use all the items from featureConfig as additional context commands. Can we just pull that 'highlightCommand' here, which is used for @Sage?
…down for context commands
chat-client/src/client/chat.ts
Outdated
commands: [ | ||
{ | ||
description: featureConfig.get('highlightCommands')?.variation ?? '', | ||
command: featureConfig.get('highlightCommands')?.value.stringValue ?? '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not create empty commands - check if 'highlightCommands' before defining all this section
chat-client/src/client/mynahUi.ts
Outdated
groupName: 'Additional Commands', | ||
commands: [ | ||
{ | ||
command: highlightedCommands.value.stringValue ?? '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. highlightedCommands
can be undefined here. Can you please test your code with and without FeatureConfig, it should work in both cases.
Problem
Currently we don't have a way to support additional context commands from the client side.
Solution
Adding support for this
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.