Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Change 'type' prop on badges to 'forceDot' #12327

Merged
merged 8 commits into from
Mar 14, 2024
Merged

Change 'type' prop on badges to 'forceDot' #12327

merged 8 commits into from
Mar 14, 2024

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Mar 7, 2024

Which, hopefully, better represents what it actually does. Tidies up some of the logic. Also adds some tests.

Split out from #12254

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

Which, hopefully, better represents what it actually does. Tidies
up some of the logic.

Split out from #12254
@dbkr dbkr added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Mar 7, 2024
@dbkr dbkr changed the title Change 'type' prop on badges tio 'forceDot' Change 'type' prop on badges to 'forceDot' Mar 7, 2024
@dbkr dbkr requested a review from richvdh March 7, 2024 20:05
@dbkr dbkr marked this pull request as ready for review March 7, 2024 20:05
@dbkr dbkr requested a review from a team as a code owner March 7, 2024 20:05
@dbkr dbkr requested a review from florianduros March 7, 2024 20:05
@dbkr dbkr mentioned this pull request Mar 7, 2024
3 tasks
because it was also updating the logic for mark as unread badges and
rewriting the ternary to the previous logic would be quite complex.
@@ -28,7 +28,12 @@ interface Props {
count: number;
level: NotificationLevel;
knocked?: boolean;
type?: "badge" | "dot";
/**
* If true, where we would normally show a badge, we instead show a dot. Count will
Copy link
Member

Choose a reason for hiding this comment

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

Do we mean count the property here, or "Notification count" as a concept? Given the text about it affecting whether the dot is displayed, I think we mean count? In which case, backticks and lower case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Mmm... I would say more the notification count concept: I'm not clear what exactly it would mean to display or not display a prop. I've referenced the count in the class doc and updated this to hopefully be clearer in 940e9d3.

Comment on lines 26 to 28
/**
* If true, the badge will always be displayed as a dot.
*/
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs updating in much the same way as StatelessNotificationBadge's version (though with differences to account for the fact that count comes from a different place)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 37e972e

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@dbkr dbkr requested a review from richvdh March 11, 2024 11:51
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@dbkr dbkr added this pull request to the merge queue Mar 14, 2024
Merged via the queue into develop with commit bd6ebc9 Mar 14, 2024
22 checks passed
@dbkr dbkr deleted the dbkr/forcedot branch March 14, 2024 14:54
thoraj added a commit to verji/matrix-react-sdk that referenced this pull request Mar 15, 2024
* Update `@vector-im/compound-design-tokens` in package.json (matrix-org#12339)

* Change 'type' prop on badges to 'forceDot' (matrix-org#12327)

* Change 'type' prop on badges tio 'forceDot'

Which, hopefully, better represents what it actually does. Tidies
up some of the logic.

Split out from matrix-org#12254

* Missed a file

* More comments

* Oops, there is no count here.

* Back out the logic refactor of StatelessNotificationBadge

because it was also updating the logic for mark as unread badges and
rewriting the ternary to the previous logic would be quite complex.

* Fix doc comment

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Clarify doc on displaying the count

* Update doc for the forceDot param here too.

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* [Backport staging] Update `@vector-im/compound-design-tokens` in package.json (matrix-org#12340)

(cherry picked from commit e3ba643)

Co-authored-by: Florian Duros <florianduros@element.io>

* Fix the image view (matrix-org#12341)

* TAC: Fix hover state when expanded (matrix-org#12337)

* Fix TAC hover state

* Add playwright test

* Update playwright snapshot after last compound style changes

* v3.95.0-rc.0

* v3.95.0

* Reset matrix-js-sdk back to develop branch

* TAC: Order rooms by most recent after notification level (matrix-org#12329)

* Order room by thread timestamp

* Fix key errors in test

* Update jest snapshots

* Update snapshots

* Rename alpha/beta to numbers

* Add playwright test

* Replace forceCount prop with hideIfDot (matrix-org#12344)

This replaces the `forceCount` prop on room badge components with
`hideIfDot` which hopefully gives a better idea of what it does,
since forceCount did not really force a count. Also remove the
prop where it was just passing the default value anyway.

---------

Co-authored-by: Florian Duros <florianduros@element.io>
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: ElementRobot <releases@riot.im>
Co-authored-by: Robin <robin@robin.town>
andybalaam pushed a commit that referenced this pull request Mar 18, 2024
* Change 'type' prop on badges tio 'forceDot'

Which, hopefully, better represents what it actually does. Tidies
up some of the logic.

Split out from #12254

* Missed a file

* More comments

* Oops, there is no count here.

* Back out the logic refactor of StatelessNotificationBadge

because it was also updating the logic for mark as unread badges and
rewriting the ternary to the previous logic would be quite complex.

* Fix doc comment

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Clarify doc on displaying the count

* Update doc for the forceDot param here too.

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants