Skip to content

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Sep 15, 2025

Screenshot 2025-09-15 at 14 17 21

@lerouxb lerouxb requested a review from gagik September 15, 2025 13:17
@lerouxb lerouxb added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Sep 15, 2025
@github-actions github-actions bot added the feat label Sep 15, 2025
@lerouxb lerouxb force-pushed the display-chat-sources branch from f57b0f4 to 2a9422c Compare September 15, 2025 13:18
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.
Copy link
Contributor Author

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
Copy link
Contributor Author

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}>
Copy link
Contributor Author

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.

@lerouxb lerouxb marked this pull request as ready for review September 16, 2025 11:15
@lerouxb lerouxb requested a review from a team as a code owner September 16, 2025 11:15
Copy link
Contributor

@Copilot Copilot AI left a 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');
Copy link
Contributor Author

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 🤷

@lerouxb lerouxb changed the title feat(compass-assistant): show related resources below messages if it exists feat(compass-assistant): show related resources below messages if it exists COMPASS-9838 Sep 16, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lerouxb lerouxb force-pushed the display-chat-sources branch from d95c8a0 to ab74a2d Compare September 16, 2025 13:55
renderWithChat(mockMessages);
userEvent.click(screen.getByLabelText('Expand Related Resources'));

// TODO(COMPASS-9860) can't find the links in test-electron on RHEL and Ubuntu.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

Copy link
Contributor

@gagik gagik left a 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.

@lerouxb lerouxb merged commit c01fb29 into main Sep 16, 2025
54 of 55 checks passed
@lerouxb lerouxb deleted the display-chat-sources branch September 16, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat feature flagged PRs labeled with this label will not be included in the release notes of the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants