-
Notifications
You must be signed in to change notification settings - Fork 234
feat(compass-assistant): show related resources below messages if it exists COMPASS-9838 #7323
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
f57b0f4
to
2a9422c
Compare
3. Access the current state of the UI | ||
</inabilities> | ||
Always call the 'search_content' tool when asked a technical question that would benefit from getting relevant info from the documentation. |
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.
The Jedi mind trick of getting this thing to use the sources and therefore reliably return some. https://mongodb.github.io/chatbot/server/context-engineering#elicit-internal-retrieval-augmented-generation-tool-calls
> | ||
{messageFields.isSender === false && ( | ||
<MessageActions | ||
<Message.Actions |
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.
drive-by: MessageActions is deprecated. Just like MessageLinks. These are now on Message like Message.Actions and Message.Links.
className={messageFeedFixesStyles} | ||
> | ||
<div> | ||
<div className={messagesWrapStyles}> |
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.
drive-by: I broke the spacing between messages in the recent PR where I fixed the scrolling in a way where it didn't in turn break text selection across messages.
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.
Pull Request Overview
This PR adds support for displaying related resources/documentation links below assistant messages in the compass-assistant chat interface when sources are available.
- Enables sending sources from the docs provider transport
- Updates the UI to render source links below assistant messages
- Adds test coverage for the new related resources functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/compass-assistant/test/assistant.eval.ts | Removes debug console.log statement |
packages/compass-assistant/src/prompts.ts | Adds instruction to always call search_content tool for technical questions |
packages/compass-assistant/src/docs-provider-transport.ts | Enables sending sources in the UI message stream |
packages/compass-assistant/src/assistant-chat.tsx | Updates UI to display source links below messages and fixes component imports |
packages/compass-assistant/src/assistant-chat.spec.tsx | Adds test coverage for related resources functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
const feedbackTextArea = screen.getByTestId( | ||
'lg-chat-message_actions-feedback_textarea' | ||
); | ||
const feedbackTextArea = within(assistantMessage).getByRole('textbox'); |
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 spent half an hour trying to figure out why it suddenly cannot find the textarea by textid even though it is there and the testid matches 🤷
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
d95c8a0
to
ab74a2d
Compare
renderWithChat(mockMessages); | ||
userEvent.click(screen.getByLabelText('Expand Related Resources')); | ||
|
||
// TODO(COMPASS-9860) can't find the links in test-electron on RHEL and Ubuntu. |
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.
🤷
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.
That Linux test might be worth checking in future but drawer stuff has been weird there so not too worried about it.
Uh oh!
There was an error while loading. Please reload this page.