-
Notifications
You must be signed in to change notification settings - Fork 35
(feat): Add context selector to prompt input #62
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
added contextCommands to store model updated prompt input text view with dynamic span
added bold wrapping for escapedPrompt to prompt rendering updated data models
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 wasn't able to finish my review before this got merged, I only noticed small typos in the PR
* */ | ||
cancelButtonWhenLoading?: boolean; | ||
/** | ||
* Quick Action commands to show when user hits / to the input initially | ||
*/ | ||
quickActionCommands?: QuickActionCommandGroup[]; | ||
/** | ||
* Context commands to show when user hits @ to the input any point | ||
*/ | ||
contextCommands?: QuickActionCommandGroup[]; |
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.
nit: maybe it is time to think of a more generic name for these given they are now shared, something like CommandGroup
mynahUI.updateStore('tab-1', { | ||
contextCommands: [ | ||
{ | ||
groupName: 'Metion code', |
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.
nit: typo Mention
--- | ||
|
||
## ChatPrompt | ||
This is the object model which will be send along with the `onChatPrompt` event. |
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.
nit: typo, sent
@@ -101,7 +101,7 @@ export const QuickActionCommands:QuickActionCommandGroup[] = [ | |||
}, | |||
], | |||
}, | |||
]; | |||
] as QuickActionCommandGroup[]; |
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.
nit: why is this as QuickActionCommandGroup[]
needed, doesn't line 12 already ensure the type?
Problem
Exactly like the quick action commands selector, a context selector should be implemented into the prompt input field. But unlike the quick action commands, it can be picked multiple times and should be written inside the prompt text. It should also send the selected context items in an additional attribute in the
prompt
object.The available context items should be provided through the data model like the QuickAction commands but in a new attribute field.
We want to allow users to specify a target for the context like
workspace
or in the futurefile
orfolder
.Solution
contextCommands
and accepts an array ofQuickActionCommandGroup
@
character insertion and enables the overlay picker for the provided context items if there is any.@
) and removes the whole word/mention.contextCommands
addition.License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.