-
Notifications
You must be signed in to change notification settings - Fork 320
msglist: Friendlier placeholder text when narrow has no messages (simple version) #1650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gnprice
merged 3 commits into
zulip:main
from
chrisbobbe:pr-empty-msglist-simple-placeholder
Jul 3, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,6 +129,9 @@ void main() { | |
return findScrollView(tester).controller; | ||
} | ||
|
||
final contentInputFinder = find.byWidgetPredicate( | ||
(widget) => widget is TextField && widget.controller is ComposeContentController); | ||
|
||
group('MessageListPage', () { | ||
testWidgets('ancestorOf finds page state from message', (tester) async { | ||
await setupMessageListPage(tester, | ||
|
@@ -346,6 +349,36 @@ void main() { | |
}); | ||
}); | ||
|
||
group('no-messages placeholder', () { | ||
final findPlaceholder = find.byType(PageBodyEmptyContentPlaceholder); | ||
|
||
testWidgets('Combined feed', (tester) async { | ||
await setupMessageListPage(tester, narrow: CombinedFeedNarrow(), messages: []); | ||
check( | ||
find.descendant( | ||
of: findPlaceholder, | ||
matching: find.textContaining('There are no messages here.')), | ||
).findsOne(); | ||
}); | ||
|
||
testWidgets('when `messages` empty but `outboxMessages` not empty, show outboxes, not placeholder', (tester) async { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, good thought to test this. |
||
final channel = eg.stream(); | ||
await setupMessageListPage(tester, | ||
narrow: TopicNarrow(channel.streamId, eg.t('topic')), | ||
streams: [channel], | ||
messages: []); | ||
check(findPlaceholder).findsOne(); | ||
|
||
connection.prepare(json: SendMessageResult(id: 1).toJson()); | ||
await tester.enterText(contentInputFinder, 'asdfjkl;'); | ||
await tester.tap(find.byIcon(ZulipIcons.send)); | ||
await tester.pump(kLocalEchoDebounceDuration); | ||
|
||
check(findPlaceholder).findsNothing(); | ||
check(find.text('asdfjkl;')).findsOne(); | ||
Comment on lines
+373
to
+378
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And this is a nice user-focused structure for the test. |
||
}); | ||
}); | ||
|
||
group('presents message content appropriately', () { | ||
testWidgets('content not asked to consume insets (including bottom), even without compose box', (tester) async { | ||
// Regression test for: https://github.com/zulip/zulip-flutter/issues/736 | ||
|
@@ -1837,9 +1870,6 @@ void main() { | |
final topicNarrow = eg.topicNarrow(stream.streamId, topic); | ||
const content = 'outbox message content'; | ||
|
||
final contentInputFinder = find.byWidgetPredicate( | ||
(widget) => widget is TextField && widget.controller is ComposeContentController); | ||
|
||
Finder outboxMessageFinder = find.widgetWithText( | ||
OutboxMessageWithPossibleSender, content, skipOffstage: true); | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this commit be marked as nfc?