Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ All notable changes to this project will be documented in this file.

<!-- template-start -->

## 8.34.2 ((1/2/2026, 09:41 AM PST))

This is an artificial version bump with no new change.

## 8.34.1 ((12/23/2025, 11:31 AM PST))

This is an artificial version bump with no new change.
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coinbase/cds-common",
"version": "8.34.1",
"version": "8.34.2",
"description": "Coinbase Design System - Common",
"repository": {
"type": "git",
Expand Down
4 changes: 4 additions & 0 deletions packages/mcp-server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ All notable changes to this project will be documented in this file.

<!-- template-start -->

## 8.34.2 ((1/2/2026, 09:41 AM PST))

This is an artificial version bump with no new change.

## 8.34.1 ((12/23/2025, 11:31 AM PST))

This is an artificial version bump with no new change.
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coinbase/cds-mcp-server",
"version": "8.34.1",
"version": "8.34.2",
"description": "Coinbase Design System - MCP Server",
"repository": {
"type": "git",
Expand Down
4 changes: 4 additions & 0 deletions packages/mobile/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ All notable changes to this project will be documented in this file.

<!-- template-start -->

## 8.34.2 ((1/2/2026, 09:41 AM PST))

This is an artificial version bump with no new change.

## 8.34.1 ((12/23/2025, 11:31 AM PST))

This is an artificial version bump with no new change.
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coinbase/cds-mobile",
"version": "8.34.1",
"version": "8.34.2",
"description": "Coinbase Design System - Mobile",
"repository": {
"type": "git",
Expand Down
6 changes: 6 additions & 0 deletions packages/web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.

<!-- template-start -->

## 8.34.2 (1/2/2026 PST)

#### 🐞 Fixes

- Handle disableAnimateOnMount prop for web ProgressCircle. [[#280](https://github.com/coinbase/cds/pull/280)]

## 8.34.1 (12/23/2025 PST)

#### 🐞 Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coinbase/cds-web",
"version": "8.34.1",
"version": "8.34.2",
"description": "Coinbase Design System - Web",
"repository": {
"type": "git",
Expand Down
14 changes: 12 additions & 2 deletions packages/web/src/visualizations/DefaultProgressCircleContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@ import type { ProgressCircleContentProps } from './ProgressCircle';
import { ProgressTextLabel } from './ProgressTextLabel';

export const DefaultProgressCircleContent = memo(
({ progress, disabled, color = 'fgMuted' }: ProgressCircleContentProps) => {
({
progress,
disableAnimateOnMount,
disabled,
color = 'fgMuted',
}: ProgressCircleContentProps) => {
return (
<ProgressTextLabel color={color} disabled={disabled} value={Math.round(progress * 100)} />
<ProgressTextLabel
color={color}
disableAnimateOnMount={disableAnimateOnMount}
disabled={disabled}
value={Math.round(progress * 100)}
/>
);
},
);
20 changes: 16 additions & 4 deletions packages/web/src/visualizations/ProgressCircle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ export type ProgressCircleProps = ProgressCircleBaseProps & {
};
};

export type ProgressCircleContentProps = Pick<ProgressCircleBaseProps, 'progress' | 'disabled'> & {
export type ProgressCircleContentProps = Pick<
ProgressCircleBaseProps,
'progress' | 'disableAnimateOnMount' | 'disabled'
> & {
/**
* Custom text color.
* @default fgMuted
Expand All @@ -109,7 +112,7 @@ export type ProgressCircleContentProps = Pick<ProgressCircleBaseProps, 'progress

type ProgressInnerCircleProps = Pick<
ProgressCircleBaseProps,
'progress' | 'onAnimationEnd' | 'onAnimationStart'
'progress' | 'onAnimationEnd' | 'onAnimationStart' | 'disableAnimateOnMount'
> &
Required<Pick<ProgressCircleBaseProps, 'size' | 'weight' | 'color'>> & {
visuallyDisabled?: boolean;
Expand All @@ -128,6 +131,7 @@ const ProgressCircleInner = memo(
className,
onAnimationEnd,
onAnimationStart,
disableAnimateOnMount,
}: ProgressInnerCircleProps) => {
const strokeWidth = useProgressSize(weight);
const circleRef = useRef<SVGCircleElement>(null);
Expand All @@ -145,7 +149,9 @@ const ProgressCircleInner = memo(
strokeDashoffset: progressOffset,
},
transition: animateProgressBaseSpec,
initial: { strokeDashoffset: circumference },
initial: {
strokeDashoffset: disableAnimateOnMount ? progressOffset : circumference,
},
});

return (
Expand Down Expand Up @@ -176,6 +182,7 @@ export const ProgressCircle = memo(
progress,
color = 'bgPrimary',
disabled = false,
disableAnimateOnMount = false,
testID,
hideContent,
hideText,
Expand Down Expand Up @@ -240,6 +247,7 @@ export const ProgressCircle = memo(
<ProgressCircleInner
className={classNames?.progress}
color={color}
disableAnimateOnMount={disableAnimateOnMount}
onAnimationEnd={onAnimationEnd}
onAnimationStart={onAnimationStart}
progress={progress}
Expand All @@ -266,7 +274,11 @@ export const ProgressCircle = memo(
width="100%"
>
{contentNode ?? (
<DefaultProgressCircleContent disabled={disabled} progress={progress} />
<DefaultProgressCircleContent
disableAnimateOnMount={disableAnimateOnMount}
disabled={disabled}
progress={progress}
/>
)}
</Box>
</Box>
Expand Down
19 changes: 16 additions & 3 deletions packages/web/src/visualizations/ProgressTextLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { Text } from '../typography/Text';
import { Counter } from './Counter';
import type { ProgressBaseProps } from './ProgressBar';

export type ProgressTextLabelProps = Pick<ProgressBaseProps, 'disabled'> & {
export type ProgressTextLabelProps = Pick<
ProgressBaseProps,
'disableAnimateOnMount' | 'disabled'
> & {
value: number;
renderLabel?: (num: number, disabled?: boolean) => React.ReactNode;
color?: ThemeVars.Color;
Expand All @@ -25,8 +28,18 @@ export type ProgressTextLabelProps = Pick<ProgressBaseProps, 'disabled'> & {
};

export const ProgressTextLabel = memo(
({ value, renderLabel, disabled, color, style, className }: ProgressTextLabelProps) => {
const { getPreviousValue, addPreviousValue } = usePreviousValues<number>([0]);
({
value,
renderLabel,
disableAnimateOnMount,
disabled,
color,
style,
className,
}: ProgressTextLabelProps) => {
const { getPreviousValue, addPreviousValue } = usePreviousValues<number>([
disableAnimateOnMount ? value : 0,
]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look great, thanks for catching this and for contributing

Can you run yarn bump-version and yarn release and then push the changes made by the scripts? You can ignore the jira question, and see here if you have any questions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Hunter, I ran the scripts and updated the PR 👍


addPreviousValue(value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,14 @@ export const Thin = () => {
</ProgressContainerWithButtons>
);
};

export const DisableAnimateOnMount = () => {
return (
<ProgressContainerWithButtons>
{({ calculateProgress }) => (
<ProgressCircle disableAnimateOnMount progress={calculateProgress(0.8)} size={100} />
)}
</ProgressContainerWithButtons>
);
};
DisableAnimateOnMount.parameters = { percy: { enableJavaScript: true } };
20 changes: 20 additions & 0 deletions packages/web/src/visualizations/__tests__/ProgressCircle.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,24 @@ describe('ProgressCircle tests', () => {
expect(screen.queryByText(`${customText} ${progress * 100}%`)).toBeNull();
expect(screen.queryByTestId('custom-content-node')).toBeNull();
});

it('skips mount animation when disableAnimateOnMount is true', () => {
const size = 100;
const progress = 0.5;
render(
<DefaultThemeProvider>
<ProgressCircle disableAnimateOnMount progress={progress} size={size} />
</DefaultThemeProvider>,
);

const circumference = getCircumference(getRadius(size, 4));
const expectedOffset = (1 - progress) * circumference;
const innerCircle = screen.getByTestId('cds-progress-circle-inner');

// Should start at target offset, not at circumference (empty)
expect(innerCircle).toHaveAttribute('stroke-dashoffset', expectedOffset.toString());

// Should show target percentage immediately, not animate from 0
expect(screen.getAllByText('50%').length).toBeGreaterThan(0);
});
});