-
Notifications
You must be signed in to change notification settings - Fork 214
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
lightbox: Added user's avatar in the lightbox app bar #1092
base: main
Are you sure you want to change the base?
Conversation
3b20b77
to
a1e4aff
Compare
Thanks @shivanshsharma13 ! Please add screenshots showing your changes to the PR description. |
HI @alya Done! |
Thanks for the PR. Before we can review this, it will need (a) tests and (b) to follow our Git style. See our README at: https://github.com/zulip/zulip-flutter#submitting-a-pull-request |
Oh also:
|
a1e4aff
to
38a8e09
Compare
Hi, sorry was a bit confused. Now I have implemented the correct code. It's ready for review. Adding test for this as well. |
|
38a8e09
to
15e1ea8
Compare
Done the changes!
|
Thanks! How about making it size 36px and border-radius Here's a screenshot with those numbers I've suggested: Also please fix indentation and whitespace to match the project's style, and use |
Thanks for those screenshots, although I notice they're a little pixelated.
As I said, the RN app uses 36 and 36 / 8. The lightbox page will likely change when our designer makes a design for it. Temporarily, I think taking these numbers from the RN app is fine. There's no point using the Please choose either:
Please also update the commit with the other things I requested: #1092 (comment) |
15e1ea8
to
1835cba
Compare
Hi, Thanks for the detailed explanation. Added the 36 size and 36/8 as per suggestion. Also changed the indentation. It's ready for review.🙂 |
CI has caught a failing test; please fix that. |
This change updates the lightbox to display the message author's avatar alongside their name and the date in the app bar. The avatar is positioned in the "start" direction (left for LTR layouts, right for RTL layouts) to align with the behavior in the React Native app. Fixes: zulip#41
1835cba
to
a4c4cf7
Compare
Sorry, I just missed updating the test file earlier. It's done now. Thanks! |
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.
Thanks for the update @shivanshsharma13! Left some comments. Also a commit message nit:
Lightbox: Added user's avatar in the lightbox app bar
to
lightbox: Added user's avatar in the lightbox app bar
For finding the right prefix, git log --oneline -- lib/widgets/lightbox.dart
is handy.
]) | ||
), | ||
), | ||
], | ||
), |
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.
nit: Looks like this change expands the parentheses into separate lines. We should fix this.
]) | |
), | |
), | |
], | |
), | |
]))), | |
]), |
], | ||
), | ||
bottom: widget.buildAppBarBottom(context) | ||
); |
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.
nit: same issue here
prepareBoringImageHttpClient(); | ||
final timestamp = DateTime.parse("2024-07-23 23:12:24").millisecondsSinceEpoch ~/ 1000; | ||
final message = eg.streamMessage(sender: eg.otherUser, timestamp: timestamp); | ||
await setupPage(tester, message: message, thumbnailUrl: null); | ||
|
||
// We're looking for a RichText, in the app bar, with both the | ||
// sender's name and the timestamp. |
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.
nit: the comment was specifically for explaining what RichText
was used for. Let's leave it as-is
// Check Avatar properties | ||
final avatar = tester.widget<Avatar>(find.byType(Avatar)); | ||
check(avatar.size).equals(36); | ||
check(avatar.borderRadius).equals(36 / 8); |
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.
The design properties like size
and borderRadius
are usually verified during reviews. We typically don't need test for these because it only captures a limited scope of bugs and becomes another place to update if the design spec changes.
In the lightbox, the RN app shows the message author's avatar along with their name in the app bar. This change implements the same behavior in the Flutter app, positioning the avatar beside the name/date text in the "start" direction (left in LTR layouts, right in RTL layouts).
The changes:
Screenshot-
Fixes #41