-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implemented some Animo colors #54
Conversation
5ad9199
to
709bfdd
Compare
9f06430
to
3644dab
Compare
3cf309b
to
226c506
Compare
packages/toolbox-core/src/agent/config/adapters/ToolBoxConfigValidation.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one point mainly about how the theme is being used.
I will just comment it here again. We should never really do custom theme stuff within the code outside of the themes file.
Where we define the collars we should names like: backgroundOne
, backgroundTwo
, primaryOne
, primaryTwo
, secondaryOne
, secondaryTwo
, grayscaleOne
, grayscaleTwo
, info
, success
, etc.
Each color maps to something different in light and dark mode, with the exception of colors that MUST be the same in light and dark mode (e.g. grayscale).
If we map it like this we can avoid all the manual ternary expressions for the theme and make it a lot easier to create pages that are instantly compatible with light/dark mode.
const useStyles = createStyles((theme) => ({ | ||
primary: { | ||
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.animoWhite[0] : theme.colors.animoBlack[0], | ||
color: theme.colorScheme === 'dark' ? theme.colors.animoBlack[0] : theme.colors.animoWhite[0], | ||
|
||
'&:hover': { | ||
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.animoWhite[0] : theme.colors.animoBlack[0], | ||
}, | ||
}, | ||
|
||
secondary: { | ||
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.animoBlack[0] : theme.colors.animoWhite[0], | ||
color: theme.colorScheme === 'dark' ? theme.colors.animoWhite[0] : theme.colors.animoBlack[0], | ||
|
||
'&:hover': { | ||
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.animoBlack[1] : theme.colors.animoWhite[1], | ||
}, | ||
}, | ||
})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I am not a fan of this. We have a theme which we can change based on the light / dark mode.
If we use names like theme.colors.backgroundOne / Two / etc
we can just change the colours when the theme changes and not like this. We really must avoid this when possible as this will make code quite unreadable and annoying to fix later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing we can do I think is making named colors without the color name and switch those in the color pallet. I'll look into it tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that is what I mean. IMO specifying a color by name should only be done if it is the same color in different themes. And if we do that for all, why do we have themes?
export const StatusBadge = (props: BadgeProps) => { | ||
const { colorScheme } = useMantineTheme() | ||
|
||
return <Badge variant={colorScheme === 'dark' ? 'light' : 'outline'} color="blue" {...props} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. I think we should really, with one or max two exceptions, never check the colorscheme within code here. If we want to display a different icon then I understand but we should just switch colors between light and dark mode and preferably nothing else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this one will be a bit harder I think because we are changing the variant and this one isn't really switchable with the global color pallet. But we might be able to create a hook for it to change it between the 2. So maybe a hook that tells that we need more contrast with a specific colorscheme so just a yes or no return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t mean that we should change the variant based on the theme, I mean that we should NOT toggle anything other than the colors based on the light theme
Signed-off-by: Tom Lanser <[email protected]>
…us badge generic Signed-off-by: Tom Lanser <[email protected]>
1e3365a
to
02a5af6
Compare
Signed-off-by: Tom Lanser <[email protected]>
96e59e5
to
77320ff
Compare
Signed-off-by: Tom Lanser <[email protected]>
@janrtvld Could you do a quick check for this PR? You will likely have some better things to say about the design / colors then I do :). |
… avatar at the agent selection Signed-off-by: Tom Lanser <[email protected]>
…e the navbar Signed-off-by: Tom Lanser <[email protected]>
I made a lot of changes to the UI and also processed some of the feedback that @janrtvld gave. |
Signed-off-by: Tom Lanser <[email protected]>
00cdb8d
to
62eb493
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some very minor things. can be merged after resolution.
@@ -31,7 +31,8 @@ contextBridge.exposeInMainWorld('nodeFetch', async (endpoint, request) => { | |||
|
|||
const getConfigDirForPlatform = (platform, homeDir, appDataDir) => { | |||
switch (platform) { | |||
case 'linux' || 'darwin': | |||
case 'darwin': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You switched it back 👀 that's fine haha :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it wasn't working and javascript doesn't support the || operator in a switch or it wasn't working as expected. Darwin didn't work with this switch so idk It's stranngeeee. So when I switched it back it started working again on my macbook.
packages/toolbox-ui/src/components/connections/ConnectionsTable.tsx
Outdated
Show resolved
Hide resolved
packages/toolbox-ui/src/components/credentials/CredentialsTable.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Tom Lanser <[email protected]>
Can be merged @Tommylans if you want. |
closes #55