Skip to content

Commit db0acec

Browse files
committed
backend integration
Signed-off-by: Yi Cai <yicai@redhat.com>
1 parent 767a844 commit db0acec

2 files changed

Lines changed: 198 additions & 119 deletions

File tree

workspaces/lightspeed/plugins/lightspeed/src/components/LightSpeedChat.tsx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -335,24 +335,39 @@ const useStyles = makeStyles(theme => ({
335335
settingsFlat: {
336336
height: '100%',
337337
width: '100%',
338+
backgroundColor:
339+
'var(--pf-v6-c-table--BackgroundColor, var(--pf-t--global--background--color--primary--default))',
338340
'&.pf-chatbot__settings-form-container': {
339-
background: 'transparent',
341+
background:
342+
'var(--pf-v6-c-table--BackgroundColor, var(--pf-t--global--background--color--primary--default))',
340343
padding: 0,
341344
margin: 0,
345+
minHeight: '100%',
346+
display: 'flex',
347+
flexDirection: 'column',
342348
width: '100%',
343349
maxWidth: 'none',
344350
},
345351
'& .pf-chatbot__settings-form': {
346352
margin: 0,
347353
padding: 0,
354+
background:
355+
'var(--pf-v6-c-table--BackgroundColor, var(--pf-t--global--background--color--primary--default))',
356+
minHeight: '100%',
357+
display: 'flex',
358+
flexDirection: 'column',
348359
width: '100%',
349360
maxWidth: 'none',
350361
},
351362
'& .pf-chatbot__settings-form-row': {
352-
background: 'transparent',
363+
background:
364+
'var(--pf-v6-c-table--BackgroundColor, var(--pf-t--global--background--color--primary--default))',
353365
border: 0,
354366
margin: 0,
355367
padding: 0,
368+
minHeight: '100%',
369+
display: 'flex',
370+
flexDirection: 'column',
356371
width: '100%',
357372
maxWidth: 'none',
358373
},
@@ -378,6 +393,8 @@ const useStyles = makeStyles(theme => ({
378393
flex: 1,
379394
minWidth: 0,
380395
borderLeft: `1px solid ${theme.palette.divider}`,
396+
backgroundColor:
397+
'var(--pf-v6-c-table--BackgroundColor, var(--pf-t--global--background--color--primary--default))',
381398
display: 'flex',
382399
flexDirection: 'column',
383400
minHeight: 0,
@@ -436,7 +453,6 @@ export const LightspeedChat = ({
436453
const [isRenameModalOpen, setIsRenameModalOpen] = useState<boolean>(false);
437454
const [isSortSelectOpen, setIsSortSelectOpen] = useState<boolean>(false);
438455
const [isMcpSettingsOpen, setIsMcpSettingsOpen] = useState<boolean>(false);
439-
const [chatHeaderBgColor, setChatHeaderBgColor] = useState<string>();
440456
const contentScrollRef = useRef<HTMLDivElement>(null);
441457
const bottomSentinelRef = useRef<HTMLDivElement>(null);
442458
const { isReady, lastOpenedId, setLastOpenedId, clearLastOpenedId } =
@@ -486,16 +502,6 @@ export const LightspeedChat = ({
486502
}
487503
}, [isMobile, isFullscreenMode]);
488504

489-
useEffect(() => {
490-
if (typeof window === 'undefined') return;
491-
const headerElement = document.querySelector('.pf-chatbot__header');
492-
if (!headerElement) return;
493-
const computedBg = window.getComputedStyle(headerElement).backgroundColor;
494-
if (computedBg) {
495-
setChatHeaderBgColor(computedBg);
496-
}
497-
}, [displayMode, isMcpSettingsOpen]);
498-
499505
const {
500506
isPinningChatsEnabled,
501507
pinnedChats,
@@ -1113,10 +1119,7 @@ export const LightspeedChat = ({
11131119
<div className={classes.mcpFullscreenLayout}>
11141120
<div className={classes.mcpChatPane}>{chatMainContent}</div>
11151121
<div className={classes.mcpSettingsPane}>
1116-
<McpServersSettings
1117-
onClose={() => setIsMcpSettingsOpen(false)}
1118-
backgroundColor={chatHeaderBgColor}
1119-
/>
1122+
<McpServersSettings onClose={() => setIsMcpSettingsOpen(false)} />
11201123
</div>
11211124
</div>
11221125
);
@@ -1129,10 +1132,7 @@ export const LightspeedChat = ({
11291132
id: 'mcp-servers-settings',
11301133
label: '',
11311134
field: (
1132-
<McpServersSettings
1133-
onClose={() => setIsMcpSettingsOpen(false)}
1134-
backgroundColor={chatHeaderBgColor}
1135-
/>
1135+
<McpServersSettings onClose={() => setIsMcpSettingsOpen(false)} />
11361136
),
11371137
},
11381138
]}

0 commit comments

Comments
 (0)