Skip to content

BREAKING_CHANGE: update DotIndicator sizes#727

Open
aquelemiguel wants to merge 9 commits into
mainfrom
dls-757
Open

BREAKING_CHANGE: update DotIndicator sizes#727
aquelemiguel wants to merge 9 commits into
mainfrom
dls-757

Conversation

@aquelemiguel
Copy link
Copy Markdown
Contributor

@aquelemiguel aquelemiguel commented May 29, 2026

Closes DLS-757.

Considerations

  • As confirmed with Laurine, the new default is md (from sm) with a pixel size of 12px (from 8px).
  • On ui-react, refactored Avatar to use DotIndicator, syncing the logic between both libs.
  • The dot indicator should only show for avatars with sizes sm (lg dot) and md (xl dot). For larger avatar sizes lg and xl, even if the showNotification prop is present, the badge will not show. See demo below:
image

Demo

Tested on iOS 26.5 (iPhone 17 simulator).

image

@aquelemiguel aquelemiguel self-assigned this May 29, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ldls Ready Ready Preview, Comment Jun 1, 2026 12:33pm
ldls-react-native Ready Ready Preview, Comment Jun 1, 2026 12:33pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the DotIndicator size API across React and React Native and refactors Avatar notification dots to use DotIndicator, including suppressing notification dots for larger avatar sizes.

Changes:

  • Replaces the DotIndicator size scale from xs/sm/md/lg to sm/md/lg/xl and changes the default to md.
  • Refactors Avatar notification rendering to use DotIndicator and only render on sm/md avatars.
  • Updates stories, MDX docs, sandbox usage, and adds version plans for both packages.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.nx/version-plans/version-plan-1780069206903-rnative.md Adds rnative release/migration notes for the breaking size change.
.nx/version-plans/version-plan-1780069206903-react.md Adds React release/migration notes for the breaking size change.
apps/app-sandbox-rnative/src/app/blocks/DotIndicators.tsx Updates sandbox examples to the new DotIndicator size scale.
libs/ui-rnative/src/lib/Components/Avatar/Avatar.mdx Documents Avatar notification suppression for larger sizes.
libs/ui-rnative/src/lib/Components/Avatar/Avatar.tsx Uses DotIndicator for Avatar notifications and gates rendering by size.
libs/ui-rnative/src/lib/Components/DotIndicator/DotIndicator.mdx Updates rnative DotIndicator size documentation.
libs/ui-rnative/src/lib/Components/DotIndicator/DotIndicator.stories.tsx Updates rnative DotIndicator story controls/examples.
libs/ui-rnative/src/lib/Components/DotIndicator/DotIndicator.test.tsx Updates rnative DotIndicator size render tests.
libs/ui-rnative/src/lib/Components/DotIndicator/DotIndicator.tsx Implements the new rnative DotIndicator size mapping/default.
libs/ui-rnative/src/lib/Components/DotIndicator/types.ts Updates rnative DotIndicator public size type/default docs.
libs/ui-react/src/lib/Components/Avatar/Avatar.mdx Documents Avatar notification suppression for larger sizes.
libs/ui-react/src/lib/Components/Avatar/Avatar.tsx Uses DotIndicator for Avatar notifications and gates rendering by size.
libs/ui-react/src/lib/Components/DotIndicator/DotIndicator.mdx Updates React DotIndicator size documentation.
libs/ui-react/src/lib/Components/DotIndicator/DotIndicator.stories.tsx Updates React DotIndicator story controls/examples.
libs/ui-react/src/lib/Components/DotIndicator/DotIndicator.test.tsx Updates React DotIndicator size render tests.
libs/ui-react/src/lib/Components/DotIndicator/DotIndicator.tsx Implements the new React DotIndicator size mapping/default.
libs/ui-react/src/lib/Components/DotIndicator/types.ts Updates React DotIndicator public size type/default docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .nx/version-plans/version-plan-1780069206903-rnative.md
Comment thread .nx/version-plans/version-plan-1780069206903-react.md
Comment thread .nx/version-plans/version-plan-1780069206903-rnative.md Outdated
Comment thread .nx/version-plans/version-plan-1780069206903-react.md Outdated
Comment thread libs/ui-rnative/src/lib/Components/Avatar/Avatar.tsx
Comment thread libs/ui-react/src/lib/Components/Avatar/Avatar.tsx
Comment on lines +75 to +78
// dot indicator is not visible on larger sizes, regardless of the `showNotification` prop
const showNotification =
showNotificationProp && (size === 'sm' || size === 'md');

Copy link
Copy Markdown
Collaborator

@aammami-ledger aammami-ledger Jun 1, 2026

Choose a reason for hiding this comment

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

I'm not sure about this rule. I understand that we don't want consumers to add badges when the avatar size is large, but I don't think enforcing that is the Avatar component's responsibility. In my opinion, it's up to consumers to use the component correctly and follow the intended usage in Figma.

so maybe we should let the consumers add the dot themselves as we do on other components ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

based on discussion on the daily, created a ticket:
https://ledgerhq.atlassian.net/browse/DLS-770

Comment thread .nx/version-plans/version-plan-1780069206903-react.md Outdated
Comment thread .nx/version-plans/version-plan-1780069206903-rnative.md Outdated
Copy link
Copy Markdown
Collaborator

@zel-kass zel-kass left a comment

Choose a reason for hiding this comment

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

Very clean work as always ! Pre-approving.
I just have one concern on Avatar, I was wondering about the fallback icon. Right now, in dark mode, it is barely visible because we have set a black icon :

Image

On Figma, a white Icon is used for both but it is only because it sits on a black background, that is something that we don't have, so I see two options to improve that.

  1. We conditionaly display a white Icon depending on the theme to have something like this in dark mode :
Image
  1. We align with Figma and put a dark background :
Image

Although this is a linear gradient, so we might need to sync with Laurine. This is just an open question btw, maybe I missed something, and it doesn't have anything to do with the code in this PR. 🫰🏽

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 1, 2026

@aquelemiguel
Copy link
Copy Markdown
Contributor Author

@zel-kass nice catch, thank you 🕵️
as it is unrelated to the current ticket, i've created https://ledgerhq.atlassian.net/browse/DLS-771

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants