Skip to content

Commit 8f0b8f3

Browse files
committed
msg_list: Use faster fade-out for mark-as-read animations
Fixes part of zulip#613
1 parent fd46f9a commit 8f0b8f3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/widgets/message_list.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,9 @@ class _AnimatedUnread extends StatelessWidget {
635635
opacity: isRead ? 0 : 1,
636636
// Web uses 2s and 0.3s durations, and a CSS ease-out curve.
637637
// See zulip:web/styles/message_row.css .
638-
duration: Duration(milliseconds: isRead ? 2000 : 300),
638+
// As of now we wait for the ack from the server
639+
// so we're going with 0.1s as soon as the ack is received.
640+
duration: Duration(milliseconds: isRead ? 100 : 300),
639641
curve: Curves.easeOut,
640642
child: child);
641643
}

test/widgets/message_list_test.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,9 @@ void main() {
657657
..status.equals(AnimationStatus.dismissed);
658658

659659
final frames = await tester.pumpAndSettle();
660-
check(frames).isGreaterThan(1);
660+
// equals 1 when animation duration is 100ms
661+
// and increases as duration does.
662+
check(frames).isGreaterOrEqual(1);
661663
check(getAnimation(tester, message.id))
662664
..value.equals(0.0)
663665
..status.equals(AnimationStatus.completed);

0 commit comments

Comments
 (0)