Skip to content

Commit fea0c4e

Browse files
committed
msglist [nfc]: Cut already-broken logic for slightly less padding at bottom
This `i == 1` condition was never true, because in that situation the caller would build a MarkAsReadWidget instead of calling this method. This 8px vs. 11px distinction dates back to the prototype: 731b199 made it 8px instead of 0px, and the distinction itself goes back to the commit 9916194 msglist: Start on rendering messages in the prototype's first hours. The logic that drove it, though, became fragile with e7fe06c which changed it from "i == 0" (the end of the list, OK that's fairly canonical as a special value) to "i == 1" (more arbitrary). So then it naturally got broken a little later, in 56ab395 in 2023-11, and it's been broken ever since: we just always show 11px of padding here. We might further change the layout in the future, but if we do we'll fix it forward starting from the behavior the app has already had for over a year.
1 parent 6a50072 commit fea0c4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/widgets/message_list.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
622622
if (i == 2) return TypingStatusWidget(narrow: widget.narrow);
623623

624624
final data = model!.items[length - 1 - (i - 3)];
625-
return _buildItem(zulipLocalizations, data, i);
625+
return _buildItem(zulipLocalizations, data);
626626
}));
627627

628628
if (!ComposeBox.hasComposeBox(widget.narrow)) {
@@ -659,7 +659,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
659659
]);
660660
}
661661

662-
Widget _buildItem(ZulipLocalizations zulipLocalizations, MessageListItem data, int i) {
662+
Widget _buildItem(ZulipLocalizations zulipLocalizations, MessageListItem data) {
663663
switch (data) {
664664
case MessageListHistoryStartItem():
665665
return Center(
@@ -685,7 +685,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
685685
return MessageItem(
686686
key: ValueKey(data.message.id),
687687
header: header,
688-
trailingWhitespace: i == 1 ? 8 : 11,
688+
trailingWhitespace: 11,
689689
item: data);
690690
}
691691
}

0 commit comments

Comments
 (0)