Fix Invoke Progress Bar (#3626)

@blessedcoolant it looks like with the new theme buttons not being
transparent the progress bar was completely hidden, I moved to be on
top, however it was not transparent so it hid the invoke text, after
trying for a while couldn't get it to be transparent, so I just made the
height 15%,
This commit is contained in:
blessedcoolant 2023-07-02 19:12:23 +12:00 committed by GitHub
commit 42f537f655
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 5 deletions

View File

@ -45,6 +45,7 @@ export default function NodeInvokeButton(props: InvokeButton) {
<Box style={{ position: 'relative' }}> <Box style={{ position: 'relative' }}>
{!isReady && ( {!isReady && (
<Box <Box
borderRadius="base"
style={{ style={{
position: 'absolute', position: 'absolute',
bottom: '0', bottom: '0',
@ -52,7 +53,6 @@ export default function NodeInvokeButton(props: InvokeButton) {
right: '0', right: '0',
height: '100%', height: '100%',
overflow: 'clip', overflow: 'clip',
borderRadius: 4,
}} }}
> >
<ProgressBar /> <ProgressBar />
@ -71,6 +71,12 @@ export default function NodeInvokeButton(props: InvokeButton) {
tooltipProps={{ placement: 'bottom' }} tooltipProps={{ placement: 'bottom' }}
colorScheme="accent" colorScheme="accent"
id="invoke-button" id="invoke-button"
_disabled={{
background: 'none',
_hover: {
background: 'none',
},
}}
{...rest} {...rest}
/> />
) : ( ) : (
@ -84,6 +90,12 @@ export default function NodeInvokeButton(props: InvokeButton) {
colorScheme="accent" colorScheme="accent"
id="invoke-button" id="invoke-button"
fontWeight={700} fontWeight={700}
_disabled={{
background: 'none',
_hover: {
background: 'none',
},
}}
{...rest} {...rest}
> >
Invoke Invoke

View File

@ -48,6 +48,7 @@ export default function InvokeButton(props: InvokeButton) {
<Box style={{ position: 'relative' }}> <Box style={{ position: 'relative' }}>
{!isReady && ( {!isReady && (
<Box <Box
borderRadius="base"
style={{ style={{
position: 'absolute', position: 'absolute',
bottom: '0', bottom: '0',
@ -55,8 +56,8 @@ export default function InvokeButton(props: InvokeButton) {
right: '0', right: '0',
height: '100%', height: '100%',
overflow: 'clip', overflow: 'clip',
borderRadius: 4,
}} }}
{...rest}
> >
<ProgressBar /> <ProgressBar />
</Box> </Box>
@ -74,6 +75,12 @@ export default function InvokeButton(props: InvokeButton) {
tooltipProps={{ placement: 'top' }} tooltipProps={{ placement: 'top' }}
colorScheme="accent" colorScheme="accent"
id="invoke-button" id="invoke-button"
_disabled={{
background: 'none',
_hover: {
background: 'none',
},
}}
{...rest} {...rest}
/> />
) : ( ) : (
@ -87,6 +94,12 @@ export default function InvokeButton(props: InvokeButton) {
colorScheme="accent" colorScheme="accent"
id="invoke-button" id="invoke-button"
fontWeight={700} fontWeight={700}
_disabled={{
background: 'none',
_hover: {
background: 'none',
},
}}
{...rest} {...rest}
> >
Invoke Invoke

View File

@ -35,6 +35,7 @@ const ProgressBar = () => {
aria-label={t('accessibility.invokeProgressBar')} aria-label={t('accessibility.invokeProgressBar')}
isIndeterminate={isProcessing && !currentStatusHasSteps} isIndeterminate={isProcessing && !currentStatusHasSteps}
height="full" height="full"
colorScheme="accent"
/> />
); );
}; };

View File

@ -3,24 +3,26 @@ import {
createMultiStyleConfigHelpers, createMultiStyleConfigHelpers,
defineStyle, defineStyle,
} from '@chakra-ui/styled-system'; } from '@chakra-ui/styled-system';
import { mode } from '@chakra-ui/theme-tools';
const { defineMultiStyleConfig, definePartsStyle } = const { defineMultiStyleConfig, definePartsStyle } =
createMultiStyleConfigHelpers(parts.keys); createMultiStyleConfigHelpers(parts.keys);
const invokeAIFilledTrack = defineStyle((_props) => ({ const invokeAIFilledTrack = defineStyle((_props) => ({
bg: 'accent.600', bg: 'accent.500',
// TODO: the animation is nice but looks weird bc it is substantially longer than each step // TODO: the animation is nice but looks weird bc it is substantially longer than each step
// so we get to 100% long before it finishes // so we get to 100% long before it finishes
// transition: 'width 0.2s ease-in-out', // transition: 'width 0.2s ease-in-out',
_indeterminate: { _indeterminate: {
bgGradient: bgGradient:
'linear(to-r, transparent 0%, accent.600 50%, transparent 100%);', 'linear(to-r, transparent 0%, accent.500 50%, transparent 100%);',
}, },
})); }));
const invokeAITrack = defineStyle((_props) => { const invokeAITrack = defineStyle((_props) => {
const { colorScheme: c } = _props;
return { return {
bg: 'none', bg: mode(`${c}.200`, `${c}.700`)(_props),
}; };
}); });