Skip to content

Commit 5f56350

Browse files
committed
chore: enable test
1 parent 17a5a2f commit 5f56350

File tree

2 files changed

+47
-5
lines changed

2 files changed

+47
-5
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ describe('AssistantChat', function () {
9999
expect(sendButton.disabled).to.be.false;
100100
});
101101

102-
// Not currently supported by the LeafyGreen Input Bar
103-
it.skip('send button is disabled for whitespace-only input', async function () {
102+
it('send button is disabled for whitespace-only input', async function () {
104103
renderWithChat([]);
105104

106105
const inputField = screen.getByPlaceholderText(

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

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
spacing,
1212
css,
1313
Banner,
14+
cx,
1415
} from '@mongodb-js/compass-components';
1516

1617
const { ChatWindow } = LgChatChatWindow;
@@ -23,14 +24,56 @@ interface AssistantChatProps {
2324
chat: Chat<AssistantMessage>;
2425
}
2526

27+
const assistantChatStyles = css({
28+
// Compass has a global bullet point override but we clear this for the chat.
29+
ul: {
30+
listStyleType: 'disc',
31+
},
32+
ol: {
33+
listStyleType: 'decimal',
34+
},
35+
});
36+
2637
// TODO(COMPASS-9751): These are temporary patches to make the Assistant chat take the entire
2738
// width and height of the drawer since Leafygreen doesn't support this yet.
2839
const assistantChatFixesStyles = css({
2940
// Negative margin to patch the padding of the drawer.
30-
margin: -spacing[400],
31-
'> div, > div > div, > div > div > div, > div > div > div > div': {
41+
marginTop: -spacing[400],
42+
'> div, > div > div, > div > div > div, > div > div > div': {
3243
height: '100%',
3344
},
45+
// This is currently set to 'pre-wrap' which causes list items to be on a different line than the list markers.
46+
'li, ol': {
47+
whiteSpace: 'normal',
48+
},
49+
/** TODO(COMPASS-9751): We're adjusting styling of all the headers to a lower level than the default for chat, this should be updated in Leafygreen as well and removed from our end. */
50+
'h1, h2, h3, h4, h5, h6': {
51+
margin: 'unset',
52+
color: '#001E2B',
53+
fontFamily:
54+
"'Euclid Circular A','Helvetica Neue',Helvetica,Arial, sans-serif",
55+
},
56+
/** h4, h5, h6 -> body 1 styling */
57+
'h4, h5, h6': {
58+
fontSize: '13px',
59+
},
60+
/** h1 -> h3 styling */
61+
h1: {
62+
fontSize: '24px',
63+
lineHeight: '32px',
64+
fontWeight: 'medium',
65+
},
66+
/** h2 -> subtitle styling */
67+
h2: {
68+
color: '#001E2B',
69+
fontWeight: 'semibold',
70+
fontSize: '18px',
71+
},
72+
/** h3 -> body 2 styling */
73+
h3: {
74+
fontSize: '16px',
75+
fontWeight: 'semibold',
76+
},
3477
});
3578
const messageFeedFixesStyles = css({ height: '100%' });
3679
const chatWindowFixesStyles = css({
@@ -79,7 +122,7 @@ export const AssistantChat: React.FunctionComponent<AssistantChatProps> = ({
79122
return (
80123
<div
81124
data-testid="assistant-chat"
82-
className={assistantChatFixesStyles}
125+
className={cx(assistantChatFixesStyles, assistantChatStyles)}
83126
style={{ height: '100%', width: '100%' }}
84127
>
85128
<LeafyGreenChatProvider variant={Variant.Compact}>

0 commit comments

Comments
 (0)