Skip to content

Commit f08432a

Browse files
authored
remove tabs on homepage charts (#2482)
1 parent 2c60c7e commit f08432a

File tree

13 files changed

+320
-302
lines changed

13 files changed

+320
-302
lines changed

assets/src/components/ai/chatbot/ChatMessageContent.tsx

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import styled, { useTheme } from 'styled-components'
2222

2323
import { GqlError } from 'components/utils/Alert'
2424
import { ARBITRARY_VALUE_NAME } from 'components/utils/IconExpander'
25-
import { CaptionP } from 'components/utils/typography/Text'
25+
import { Body2P, CaptionP } from 'components/utils/typography/Text'
2626
import {
2727
AiRole,
2828
ChatType,
@@ -379,28 +379,51 @@ function ToolMessageContent({
379379
</Flex>
380380
}
381381
>
382-
<ToolMessageContentSC>
383-
{format === MessageFormat.Json && (
384-
<Code
385-
language="json"
386-
showHeader={false}
387-
css={{ height: '100%', background: 'none' }}
388-
>
389-
{prettifyJson(content)}
390-
</Code>
391-
)}
392-
{format === MessageFormat.Markdown && (
393-
<Card
394-
css={{
395-
padding: spacing.medium,
396-
background: 'none',
397-
height: '100%',
398-
}}
399-
>
400-
<Markdown text={content} />
401-
</Card>
382+
<Flex
383+
direction="column"
384+
marginTop={spacing.small}
385+
gap="small"
386+
>
387+
{attributes?.tool?.arguments && (
388+
<div>
389+
<Body2P $color="text-light">Arguments:</Body2P>
390+
<ToolMessageContentSC>
391+
<Code
392+
language="json"
393+
showHeader={false}
394+
css={{ height: '100%', background: 'none' }}
395+
>
396+
{JSON.stringify(attributes?.tool?.arguments, null, 2)}
397+
</Code>
398+
</ToolMessageContentSC>
399+
</div>
402400
)}
403-
</ToolMessageContentSC>
401+
<div>
402+
<Body2P $color="text-light">Response:</Body2P>
403+
<ToolMessageContentSC>
404+
{format === MessageFormat.Json && (
405+
<Code
406+
language="json"
407+
showHeader={false}
408+
css={{ height: '100%', background: 'none' }}
409+
>
410+
{prettifyJson(content)}
411+
</Code>
412+
)}
413+
{format === MessageFormat.Markdown && (
414+
<Card
415+
css={{
416+
padding: spacing.medium,
417+
background: 'none',
418+
height: '100%',
419+
}}
420+
>
421+
<Markdown text={content} />
422+
</Card>
423+
)}
424+
</ToolMessageContentSC>
425+
</div>
426+
</Flex>
404427
</AccordionItem>
405428
</Accordion>
406429
{pendingConfirmation && (
@@ -439,7 +462,7 @@ const ToolMessageWrapperSC = styled.div(({ theme }) => ({
439462
}))
440463
const ToolMessageContentSC = styled.div(({ theme }) => ({
441464
maxHeight: 324,
442-
marginTop: theme.spacing.small,
465+
marginTop: theme.spacing.xxsmall,
443466
maxWidth: '100%',
444467
overflow: 'auto',
445468
background: theme.colors['fill-two'],

assets/src/components/ai/chatbot/ChatbotHeader.tsx

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -125,36 +125,38 @@ export function ChatbotHeader({
125125
/>
126126
</>
127127
)}
128-
{!cloudConnectionsLoading && !hideClusterSelector && (
128+
{!cloudConnectionsLoading && (
129129
<>
130-
<div css={{ width: 220 }}>
131-
<ClusterSelector
132-
allowDeselect
133-
onClusterChange={(cluster) => {
134-
if (cluster?.id !== currentThread?.session?.cluster?.id)
135-
updateThread({
136-
variables: {
137-
id: currentThread.id,
138-
attributes: {
139-
summary: currentThread.summary,
140-
session: { clusterId: cluster?.id ?? null },
130+
{!hideClusterSelector && (
131+
<div css={{ width: 220 }}>
132+
<ClusterSelector
133+
allowDeselect
134+
onClusterChange={(cluster) => {
135+
if (cluster?.id !== currentThread?.session?.cluster?.id)
136+
updateThread({
137+
variables: {
138+
id: currentThread.id,
139+
attributes: {
140+
summary: currentThread.summary,
141+
session: { clusterId: cluster?.id ?? null },
142+
},
141143
},
142-
},
143-
})
144-
}}
145-
clusterId={currentThread?.session?.cluster?.id}
146-
loading={updateThreadLoading}
147-
placeholder="Select cluster"
148-
startIcon={null}
149-
deselectLabel="Deselect"
150-
inputProps={{
151-
style: {
152-
minHeight: fullscreen ? 40 : 32,
153-
height: fullscreen ? 40 : 32,
154-
},
155-
}}
156-
/>
157-
</div>
144+
})
145+
}}
146+
clusterId={currentThread?.session?.cluster?.id}
147+
loading={updateThreadLoading}
148+
placeholder="Select cluster"
149+
startIcon={null}
150+
deselectLabel="Deselect"
151+
inputProps={{
152+
style: {
153+
minHeight: fullscreen ? 40 : 32,
154+
height: fullscreen ? 40 : 32,
155+
},
156+
}}
157+
/>
158+
</div>
159+
)}
158160
{connectionId && (
159161
<AgentSessionButton
160162
connectionId={connectionId}

0 commit comments

Comments
 (0)