fix: remove reaction sortin in alphabetical order (#391)

This commit is contained in:
Pepi
2026-02-26 09:29:42 -03:00
committed by GitHub
parent 7cd7906072
commit 4729e0f80b
3 changed files with 5 additions and 5 deletions
+2
View File
@@ -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)
+1 -3
View File
@@ -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,
+2 -2
View File
@@ -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));
});