Skip to content

Commit 11a9c92

Browse files
authored
Fix/agentflow Fixed theming for dark mode in agentflow (#6234)
* To highlight input fiels in dark mode * Fix background color of edit node dialog * Fix background color for input messages field * Fix Message container * Fix border container color * Make token be referenced by name * Revert changes to server file * Fix gemini comments
1 parent be37e73 commit 11a9c92

14 files changed

Lines changed: 54 additions & 31 deletions

packages/agentflow/src/atoms/ArrayInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function ArrayInput({
132132
mt: 2,
133133
mb: 1,
134134
border: 1,
135-
borderColor: theme.palette.grey[300],
135+
borderColor: theme.palette.divider,
136136
borderRadius: 2,
137137
position: 'relative'
138138
}}

packages/agentflow/src/atoms/ConditionBuilder.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export function ConditionBuilder({
106106
mt: 2,
107107
mb: 1,
108108
border: 1,
109-
borderColor: theme.palette.grey[300],
109+
borderColor: theme.palette.divider,
110110
borderRadius: 2,
111111
position: 'relative'
112112
}}
@@ -158,7 +158,7 @@ export function ConditionBuilder({
158158
mt: 2,
159159
mb: 1,
160160
border: 1,
161-
borderColor: theme.palette.grey[300],
161+
borderColor: theme.palette.divider,
162162
borderRadius: 2,
163163
backgroundColor: theme.palette.action.hover
164164
}}

packages/agentflow/src/atoms/CredentialTypeSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type SyntheticEvent, useState } from 'react'
22

33
import { Box, InputAdornment, List, ListItemButton, OutlinedInput, Typography } from '@mui/material'
4-
import { alpha, useTheme } from '@mui/material/styles'
4+
import { useTheme } from '@mui/material/styles'
55
import { IconKey, IconSearch, IconX } from '@tabler/icons-react'
66

77
import type { ComponentCredentialSchema } from '@/core/types'
@@ -66,7 +66,7 @@ export function CredentialTypeSelector({ schemas, apiBaseUrl, onSelect }: Creden
6666
onClick={() => onSelect(schema)}
6767
sx={{
6868
border: 1,
69-
borderColor: alpha(theme.palette.grey[900], 0.25),
69+
borderColor: theme.palette.divider,
7070
borderRadius: 2,
7171
display: 'flex',
7272
alignItems: 'center',

packages/agentflow/src/atoms/Dropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Box, FormControl, Popper, TextField, Typography } from '@mui/material'
22
import Autocomplete, { autocompleteClasses } from '@mui/material/Autocomplete'
3-
import { alpha, styled, useTheme } from '@mui/material/styles'
3+
import { styled, useTheme } from '@mui/material/styles'
44

55
const StyledPopper = styled(Popper)({
66
boxShadow: '0px 8px 10px -5px rgb(0 0 0 / 20%), 0px 16px 24px 2px rgb(0 0 0 / 14%), 0px 6px 30px 5px rgb(0 0 0 / 12%)',
@@ -79,7 +79,7 @@ export function Dropdown({
7979
'& .MuiInputBase-root': {
8080
height: '100%',
8181
'& fieldset': {
82-
borderColor: alpha(theme.palette.grey[900], 0.25)
82+
borderColor: theme.palette.divider
8383
}
8484
}
8585
}}

packages/agentflow/src/atoms/MessagesInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ export function MessagesInput({ inputParam, data, disabled = false, variableItem
127127
key={effectiveKeys[index]}
128128
sx={{
129129
p: 2,
130+
mx: 2,
130131
mt: 2,
131132
mb: 1,
132133
border: 1,
133-
borderColor: theme.palette.grey[900] + 25,
134+
borderColor: theme.palette.divider,
134135
borderRadius: 2,
135136
position: 'relative'
136137
}}

packages/agentflow/src/atoms/RichTextEditor.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,19 @@ const StyledEditorContent = styled(EditorContent, {
7878
overflowX: rows ? 'auto' : 'hidden',
7979
lineHeight: rows ? `${tokens.typography.rowHeightRem}em` : `${tokens.typography.singleLineLineHeightEm}em`,
8080
fontWeight: 500,
81-
color: disabled ? theme.palette.action.disabled : theme.palette.grey[900],
82-
border: `1px solid ${theme.palette.grey[900]}25`,
81+
color: disabled ? theme.palette.action.disabled : theme.palette.text.primary,
82+
border: `1px solid ${tokens.colors.border.input[mode]}`,
8383
borderRadius: '10px',
84-
backgroundColor:
85-
(theme.palette as { textBackground?: { main: string } }).textBackground?.main ?? theme.palette.background.paper,
84+
backgroundColor: tokens.colors.background.input[mode],
8685
boxSizing: 'border-box',
8786
whiteSpace: rows ? 'pre-wrap' : 'nowrap',
8887

8988
'&:hover': {
90-
borderColor: disabled ? `${theme.palette.grey[900]}25` : theme.palette.text.primary,
89+
borderColor: disabled ? tokens.colors.border.input[mode] : theme.palette.text.primary,
9190
cursor: disabled ? 'default' : 'text'
9291
},
9392
'&:focus': {
94-
borderColor: disabled ? `${theme.palette.grey[900]}25` : theme.palette.primary.main,
93+
borderColor: disabled ? tokens.colors.border.input[mode] : theme.palette.primary.main,
9594
outline: 'none'
9695
},
9796

packages/agentflow/src/atoms/ScenariosInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function ScenariosInput({ inputParam, data, disabled = false, onDataChang
9898
mt: 2,
9999
mb: 1,
100100
border: 1,
101-
borderColor: theme.palette.grey[300],
101+
borderColor: theme.palette.divider,
102102
borderRadius: 2,
103103
position: 'relative'
104104
}}
@@ -149,7 +149,7 @@ export function ScenariosInput({ inputParam, data, disabled = false, onDataChang
149149
mt: 2,
150150
mb: 1,
151151
border: 1,
152-
borderColor: theme.palette.grey[300],
152+
borderColor: theme.palette.divider,
153153
borderRadius: 2,
154154
backgroundColor: theme.palette.action.hover
155155
}}

packages/agentflow/src/atoms/StateKeyValueInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function StateKeyValueInput({ value, onChange, disabled = false, suggesti
6666
mt: 1,
6767
mb: 1,
6868
border: 1,
69-
borderColor: theme.palette.grey[300],
69+
borderColor: theme.palette.divider,
7070
borderRadius: 2,
7171
position: 'relative'
7272
}}

packages/agentflow/src/atoms/StructuredOutputBuilder.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useCallback, useMemo, useState } from 'react'
22

33
import { Box, Button, Chip, IconButton, MenuItem, Select, TextField, Typography } from '@mui/material'
4-
import { alpha, useTheme } from '@mui/material/styles'
4+
import { useTheme } from '@mui/material/styles'
55
import { IconArrowsMaximize, IconPlus, IconTrash } from '@tabler/icons-react'
66

77
import { ExpandTextDialog } from '@/atoms'
@@ -103,7 +103,7 @@ export function StructuredOutputBuilder({ inputParam, data, disabled = false, on
103103
mt: 2,
104104
mb: 1,
105105
border: 1,
106-
borderColor: alpha(theme.palette.grey[900], 0.25),
106+
borderColor: theme.palette.divider,
107107
borderRadius: 2,
108108
position: 'relative'
109109
}}

packages/agentflow/src/atoms/VariableInput.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,19 @@ const StyledEditorContent = styled(EditorContent, {
6262
overflowX: rows ? 'auto' : 'hidden',
6363
lineHeight: rows ? `${tokens.typography.rowHeightRem}em` : `${tokens.typography.singleLineLineHeightEm}em`,
6464
fontWeight: 500,
65-
color: disabled ? theme.palette.action.disabled : theme.palette.grey[900],
66-
border: `1px solid ${theme.palette.grey[900]}25`,
65+
color: disabled ? theme.palette.action.disabled : theme.palette.text.primary,
66+
border: `1px solid ${tokens.colors.border.input[mode]}`,
6767
borderRadius: '10px',
68-
backgroundColor:
69-
(theme.palette as { textBackground?: { main: string } }).textBackground?.main ?? theme.palette.background.paper,
68+
backgroundColor: tokens.colors.background.input[mode],
7069
boxSizing: 'border-box',
7170
whiteSpace: rows ? 'pre-wrap' : 'nowrap',
7271

7372
'&:hover': {
74-
borderColor: disabled ? `${theme.palette.grey[900]}25` : theme.palette.text.primary,
73+
borderColor: disabled ? tokens.colors.border.input[mode] : theme.palette.text.primary,
7574
cursor: disabled ? 'default' : 'text'
7675
},
7776
'&:focus': {
78-
borderColor: disabled ? `${theme.palette.grey[900]}25` : theme.palette.primary.main,
77+
borderColor: disabled ? tokens.colors.border.input[mode] : theme.palette.primary.main,
7978
outline: 'none'
8079
},
8180

0 commit comments

Comments
 (0)