Skip to content

Commit 13b67e2

Browse files
committed
Merge branch 'main' of github.com:mongodb-js/compass into CLOUDP-333851/mock-data-gen-disclaimer
2 parents bb79c07 + 7b4ed4b commit 13b67e2

39 files changed

+1657
-279
lines changed

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **Mongodb Compass**.
2-
This document was automatically generated on Mon Aug 18 2025.
2+
This document was automatically generated on Thu Aug 21 2025.
33

44
## List of dependencies
55

docs/tracking-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
> the tracking plan for the specific Compass version you can use the following
77
> URL: `https://github.com/mongodb-js/compass/blob/<compass version>/docs/tracking-plan.md`
88
9-
Generated on Mon, Aug 18, 2025
9+
Generated on Thu, Aug 21, 2025
1010

1111
## Table of Contents
1212

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compass-aggregations/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
"mongodb-ns": "^2.4.2",
8989
"mongodb-query-parser": "^4.3.0",
9090
"mongodb-schema": "^12.6.2",
91-
"prop-types": "^15.7.2",
9291
"re-resizable": "^6.9.0",
9392
"react": "^17.0.2",
9493
"react-redux": "^8.1.3",

packages/compass-aggregations/src/components/modify-source-banner/modify-source-banner.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32
import { Badge, BadgeVariant, css } from '@mongodb-js/compass-components';
43

54
const modifySourceBannerStyles = css({
@@ -26,8 +25,4 @@ const ModifySourceBanner = (props: { editViewName: string }) => {
2625
);
2726
};
2827

29-
ModifySourceBanner.propTypes = {
30-
editViewName: PropTypes.string.isRequired,
31-
};
32-
3328
export default ModifySourceBanner;

packages/compass-aggregations/src/components/pipeline/pipeline.tsx

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { PureComponent } from 'react';
2-
import PropTypes from 'prop-types';
32
import {
43
Banner,
54
WorkspaceContainer,
@@ -83,33 +82,6 @@ class Pipeline extends PureComponent<
8382
> {
8483
static displayName = 'PipelineComponent';
8584

86-
static propTypes = {
87-
saveCurrentPipeline: PropTypes.func.isRequired,
88-
clonePipeline: PropTypes.func.isRequired,
89-
isCommenting: PropTypes.bool.isRequired,
90-
name: PropTypes.string,
91-
dismissViewError: PropTypes.func.isRequired,
92-
updateViewError: PropTypes.string,
93-
settings: PropTypes.object.isRequired,
94-
toggleSettingsIsExpanded: PropTypes.func.isRequired,
95-
toggleSettingsIsCommentMode: PropTypes.func.isRequired,
96-
setSettingsSampleSize: PropTypes.func.isRequired,
97-
setSettingsLimit: PropTypes.func.isRequired,
98-
limit: PropTypes.number.isRequired,
99-
largeLimit: PropTypes.number.isRequired,
100-
maxTimeMS: PropTypes.number,
101-
applySettings: PropTypes.func.isRequired,
102-
savingPipelineNameChanged: PropTypes.func.isRequired,
103-
savingPipelineApply: PropTypes.func.isRequired,
104-
savingPipelineCancel: PropTypes.func.isRequired,
105-
savingPipeline: PropTypes.object.isRequired,
106-
workspace: PropTypes.string.isRequired,
107-
showExportButton: PropTypes.bool.isRequired,
108-
showRunButton: PropTypes.bool.isRequired,
109-
showExplainButton: PropTypes.bool.isRequired,
110-
enableSearchActivationProgramP1: PropTypes.bool.isRequired,
111-
};
112-
11385
static defaultProps = {
11486
maxTimeMS: DEFAULT_MAX_TIME_MS,
11587
limit: DEFAULT_SAMPLE_SIZE,

packages/compass-aggregations/src/components/saving-pipeline-modal/saving-pipeline-modal.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { ChangeEvent } from 'react';
22
import React, { PureComponent } from 'react';
3-
import PropTypes from 'prop-types';
43
import { FormModal, TextInput } from '@mongodb-js/compass-components';
54
import type { TrackFunction } from '@mongodb-js/compass-telemetry';
65
import { withTelemetry } from '@mongodb-js/compass-telemetry/provider';
@@ -23,17 +22,6 @@ export interface SavingPipelineModalProps {
2322
class SavingPipelineModal extends PureComponent<SavingPipelineModalProps> {
2423
static displayName = 'SavingPipelineModalComponent';
2524

26-
static propTypes = {
27-
isOpen: PropTypes.bool.isRequired,
28-
isSaveAs: PropTypes.bool.isRequired,
29-
name: PropTypes.string.isRequired,
30-
savingPipelineCancel: PropTypes.func.isRequired,
31-
savingPipelineApply: PropTypes.func.isRequired,
32-
savingPipelineNameChanged: PropTypes.func.isRequired,
33-
saveCurrentPipeline: PropTypes.func.isRequired,
34-
clonePipeline: PropTypes.func.isRequired,
35-
};
36-
3725
componentDidUpdate(prevProps: SavingPipelineModalProps) {
3826
if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen) {
3927
this.props.track('Screen', { name: 'save_pipeline_modal' }, undefined);

packages/compass-assistant/src/assistant-chat.spec.tsx

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import React from 'react';
22
import { render, screen, userEvent } from '@mongodb-js/testing-library-compass';
33
import { AssistantChat } from './assistant-chat';
44
import { expect } from 'chai';
5-
import type { UIMessage } from './@ai-sdk/react/use-chat';
65
import { createMockChat } from '../test/utils';
6+
import type { AssistantMessage } from './compass-assistant-provider';
77

88
describe('AssistantChat', function () {
9-
const mockMessages: UIMessage[] = [
9+
const mockMessages: AssistantMessage[] = [
1010
{
1111
id: 'user',
1212
role: 'user',
@@ -24,7 +24,7 @@ describe('AssistantChat', function () {
2424
},
2525
];
2626

27-
function renderWithChat(messages: UIMessage[]) {
27+
function renderWithChat(messages: AssistantMessage[]) {
2828
const chat = createMockChat({ messages });
2929
return {
3030
result: render(<AssistantChat chat={chat} />),
@@ -181,7 +181,7 @@ describe('AssistantChat', function () {
181181
});
182182

183183
it('handles messages with multiple text parts', function () {
184-
const messagesWithMultipleParts: UIMessage[] = [
184+
const messagesWithMultipleParts: AssistantMessage[] = [
185185
{
186186
id: '1',
187187
role: 'assistant',
@@ -198,7 +198,7 @@ describe('AssistantChat', function () {
198198
});
199199

200200
it('handles messages with mixed part types (filters to text only)', function () {
201-
const messagesWithMixedParts: UIMessage[] = [
201+
const messagesWithMixedParts: AssistantMessage[] = [
202202
{
203203
id: '1',
204204
role: 'assistant',
@@ -217,4 +217,33 @@ describe('AssistantChat', function () {
217217
.exist;
218218
expect(screen.queryByText('This should be filtered out.')).to.not.exist;
219219
});
220+
221+
it('displays displayText instead of message parts when displayText is set', function () {
222+
const messagesWithDisplayText: AssistantMessage[] = [
223+
{
224+
id: '1',
225+
role: 'assistant',
226+
parts: [
227+
{ type: 'text', text: 'This message part should be ignored.' },
228+
{ type: 'text', text: 'Another part that should not display.' },
229+
],
230+
metadata: {
231+
displayText: 'This is the custom display text that should show.',
232+
},
233+
},
234+
];
235+
236+
renderWithChat(messagesWithDisplayText);
237+
238+
// Should display the displayText
239+
expect(
240+
screen.getByText('This is the custom display text that should show.')
241+
).to.exist;
242+
243+
// Should NOT display the message parts
244+
expect(screen.queryByText('This message part should be ignored.')).to.not
245+
.exist;
246+
expect(screen.queryByText('Another part that should not display.')).to.not
247+
.exist;
248+
});
220249
});

packages/compass-assistant/src/assistant-chat.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { useCallback, useState } from 'react';
2-
import type { UIMessage } from './@ai-sdk/react/use-chat';
2+
import type { AssistantMessage } from './compass-assistant-provider';
33
import type { Chat } from './@ai-sdk/react/chat-react';
44
import { useChat } from './@ai-sdk/react/use-chat';
55

66
interface AssistantChatProps {
7-
chat: Chat<UIMessage>;
7+
chat: Chat<AssistantMessage>;
88
}
99

1010
/**
@@ -69,10 +69,12 @@ export const AssistantChat: React.FunctionComponent<AssistantChatProps> = ({
6969
whiteSpace: 'pre-wrap',
7070
}}
7171
>
72-
{message.parts
73-
?.filter((part) => part.type === 'text')
74-
.map((part) => part.text)
75-
.join('') || ''}
72+
{message.metadata?.displayText ||
73+
message.parts
74+
?.filter((part) => part.type === 'text')
75+
.map((part) => part.text)
76+
.join('') ||
77+
''}
7678
</div>
7779
))}
7880
</div>

packages/compass-assistant/src/compass-assistant-provider.spec.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {
88
import {
99
AssistantProvider,
1010
CompassAssistantProvider,
11+
type AssistantMessage,
1112
} from './compass-assistant-provider';
1213
import { expect } from 'chai';
1314
import sinon from 'sinon';
14-
import type { UIMessage } from './@ai-sdk/react/use-chat';
1515
import { Chat } from './@ai-sdk/react/chat-react';
1616

1717
import {
@@ -24,7 +24,7 @@ import { createMockChat } from '../test/utils';
2424

2525
// Test component that renders AssistantProvider with children
2626
const TestComponent: React.FunctionComponent<{
27-
chat: Chat<UIMessage>;
27+
chat: Chat<AssistantMessage>;
2828
autoOpen?: boolean;
2929
}> = ({ chat, autoOpen }) => {
3030
return (
@@ -78,7 +78,7 @@ describe('AssistantProvider', function () {
7878
});
7979

8080
async function renderOpenAssistantDrawer(
81-
mockChat: Chat<UIMessage>
81+
mockChat: Chat<AssistantMessage>
8282
): Promise<ReturnType<typeof render>> {
8383
const result = render(<TestComponent chat={mockChat} autoOpen={true} />, {
8484
preferences: { enableAIAssistant: true },
@@ -92,7 +92,7 @@ describe('AssistantProvider', function () {
9292
}
9393

9494
it('displays messages in the chat feed', async function () {
95-
const mockMessages: UIMessage[] = [
95+
const mockMessages: AssistantMessage[] = [
9696
{
9797
id: '1',
9898
role: 'user',
@@ -120,7 +120,7 @@ describe('AssistantProvider', function () {
120120
});
121121

122122
it('handles message sending with custom chat when drawer is open', async function () {
123-
const mockChat = new Chat<UIMessage>({
123+
const mockChat = new Chat<AssistantMessage>({
124124
messages: [
125125
{
126126
id: 'assistant',
@@ -149,7 +149,7 @@ describe('AssistantProvider', function () {
149149
});
150150

151151
it('new messages are added to the chat feed when the send button is clicked', async function () {
152-
const mockChat = new Chat<UIMessage>({
152+
const mockChat = new Chat<AssistantMessage>({
153153
messages: [
154154
{
155155
id: 'assistant',

0 commit comments

Comments
 (0)