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

Replace forceCount prop with hideIfDot - #12344

Merged
dbkr merged 1 commit into
developfrom
dbkr/hideifdot
Mar 15, 2024
Merged

Replace forceCount prop with hideIfDot#12344
dbkr merged 1 commit into
developfrom
dbkr/hideifdot

Conversation

@dbkr

@dbkr dbkr commented Mar 14, 2024

Copy link
Copy Markdown
Member

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.

This is mostly refactoring except for depending on the level of the notification rather then hasUnreadCount which is effectively the same thing currently, but will matter for Mark as Unread.

Split from https://github.com/matrix-org/matrix-react-sdk/pull/12254/files

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).

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.
@dbkr dbkr added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Mar 14, 2024
@dbkr
dbkr marked this pull request as ready for review March 14, 2024 19:50
@dbkr
dbkr requested a review from a team as a code owner March 14, 2024 19:50
@dbkr
dbkr requested review from richvdh, robintown and t3chguy March 14, 2024 19:50
@dbkr dbkr mentioned this pull request Mar 14, 2024
3 tasks

@robintown robintown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Non-blocking:

@robintown

Copy link
Copy Markdown
Member

Oops, I didn't submit my actual comment

* If true, show nothing if the notification would only cause a dot to be shown rather than
* a badge. That is: only display badges and not dots. Default: false.
*/
hideIfDot?: boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If it were me I would phrase this in the positive as showDot, as I find that a little more comprehensible

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So the the reason I didn't go with this is that it would be something like, 'showIfDot', ie. whether to show the component if it would only be a dot. Having it as 'hide' felt more apparent that it was talking about hiding the component itself, rather than some part of the component? It is still, admittedly, a slightly weird option.

@robintown
robintown removed the request for review from t3chguy March 14, 2024 20:10
@dbkr
dbkr added this pull request to the merge queue Mar 15, 2024
Merged via the queue into develop with commit 3c6fd58 Mar 15, 2024
@dbkr
dbkr deleted the dbkr/hideifdot branch March 15, 2024 11:27
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
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.
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