Skip to content

Commit 5842961

Browse files
authored
fix(compass-assistant): make the chat markdown heading styles consistent between Compass and DE COMPASS-9872 (#7359)
* make the chat markdown heading styles consistent between Compass and DE * fix the welcome message and learn more link sizing
1 parent e6e9d6c commit 5842961

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ describe('AssistantChat', function () {
116116

117117
it('displays the welcome text when there are no messages', function () {
118118
renderWithChat([]);
119-
expect(screen.getByText(/Welcome to your MongoDB Assistant./)).to.exist;
119+
expect(screen.getByText(/Welcome to the MongoDB Assistant!/)).to.exist;
120120
});
121121

122122
it('does not display the welcome text when there are messages', function () {
123123
renderWithChat(mockMessages);
124-
expect(screen.queryByText(/Welcome to your MongoDB Assistant./)).to.not
124+
expect(screen.queryByText(/Welcome to the MongoDB Assistant!/)).to.not
125125
.exist;
126126
});
127127

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

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
useDarkMode,
1818
LgChatChatDisclaimer,
1919
Link,
20+
Icon,
2021
} from '@mongodb-js/compass-components';
2122
import { ConfirmationMessage } from './confirmation-message';
2223
import { useTelemetry } from '@mongodb-js/compass-telemetry/provider';
@@ -79,6 +80,8 @@ const assistantChatFixesStyles = css({
7980
fontSize: '13px',
8081
lineHeight: '15px',
8182
marginTop: '4px',
83+
// DE has reset css that sets all font weights to 400
84+
fontWeight: 700,
8285
},
8386
/** h1 -> h3 styling */
8487
h1: {
@@ -130,13 +133,16 @@ const disclaimerTextStyles = css({
130133
paddingBottom: spacing[400],
131134
paddingLeft: spacing[400],
132135
paddingRight: spacing[400],
136+
a: {
137+
fontSize: 'inherit',
138+
},
133139
});
134140
/** TODO(COMPASS-9751): This should be handled by Leafygreen's disclaimers update */
135141
const inputBarStyleFixes = css({
136142
width: '100%',
137143
paddingLeft: spacing[400],
138144
paddingRight: spacing[400],
139-
paddingBottom: spacing[400],
145+
paddingBottom: spacing[100],
140146
});
141147

142148
function makeErrorMessage(message: string) {
@@ -154,6 +160,19 @@ const messagesWrapStyles = css({
154160
gap: spacing[400],
155161
});
156162

163+
const welcomeHeadingStyles = css({
164+
display: 'flex',
165+
alignItems: 'center',
166+
gap: '6px',
167+
span: {
168+
fontWeight: 600,
169+
lineHeight: '20px',
170+
},
171+
});
172+
const welcomeTextStyles = css({
173+
margin: `${spacing[100]}px 0 0 0`,
174+
});
175+
157176
export const AssistantChat: React.FunctionComponent<AssistantChatProps> = ({
158177
chat,
159178
hasNonGenuineConnections,
@@ -375,9 +394,20 @@ export const AssistantChat: React.FunctionComponent<AssistantChatProps> = ({
375394
)}
376395
{messages.length === 0 && (
377396
<div className={welcomeMessageStyles}>
378-
<h4>Welcome to your MongoDB Assistant.</h4>
379-
Ask any question about MongoDB to receive expert guidance and
380-
documentation right in your window.
397+
<h4 className={welcomeHeadingStyles}>
398+
<Icon
399+
glyph="Sparkle"
400+
size="large"
401+
style={{ color: palette.green.dark1 }}
402+
/>
403+
<span>MongoDB Assistant.</span>
404+
</h4>
405+
<p className={welcomeTextStyles}>
406+
Welcome to the MongoDB Assistant!
407+
<br />
408+
Ask any question about MongoDB to receive expert guidance and
409+
documentation.
410+
</p>
381411
</div>
382412
)}
383413
<div className={inputBarStyleFixes}>

0 commit comments

Comments
 (0)