fix: remove reaction sortin in alphabetical order (#391)
This commit is contained in:
@@ -10,11 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
- Changed reaction emoji sorting [PR #391](https://github.com/marmot-protocol/whitenoise/pull/391)
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix npubs middle ellipsis by adding snap to words option [PR #388](https://github.com/marmot-protocol/whitenoise/pull/388)
|
||||
|
||||
@@ -279,9 +279,7 @@ class WnMessageBubble extends StatelessWidget {
|
||||
spacing: 4.w,
|
||||
runSpacing: 4.h,
|
||||
children: [
|
||||
for (final reaction
|
||||
in (reactions.toList()
|
||||
..sort((a, b) => a.emoji.compareTo(b.emoji))))
|
||||
for (final reaction in reactions)
|
||||
WnReaction(
|
||||
key: ValueKey(reaction.emoji),
|
||||
emoji: reaction.emoji,
|
||||
|
||||
@@ -227,7 +227,7 @@ void main() {
|
||||
expect(widget.type, WnReactionType.incoming);
|
||||
});
|
||||
|
||||
testWidgets('renders reactions in stable alphabetical order regardless of input order', (
|
||||
testWidgets('renders reactions in order sent by rust crate', (
|
||||
tester,
|
||||
) async {
|
||||
final reactions = [
|
||||
@@ -246,7 +246,7 @@ void main() {
|
||||
|
||||
final widgets = tester.widgetList<WnReaction>(find.byType(WnReaction)).toList();
|
||||
final emojis = widgets.map((w) => w.emoji).toList();
|
||||
final expectedEmojis = ['❤️', '👍', '🔥'];
|
||||
final expectedEmojis = ['🔥', '❤️', '👍'];
|
||||
expect(emojis, equals(expectedEmojis));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user