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
Add helper text for "server URL" with link to documentation #595
base: main
Are you sure you want to change the base?
Add helper text for "server URL" with link to documentation #595
Conversation
Hey, so one thing I would say is that your commit message should have a description. As stated here |
You must also add new tests for your code so that maintainers will review your code in detail. |
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 @VatsalBhesaniya, I'm looking forward to this! This will help people get what they need to start using the app.
Small comments below. Also, this will need tests. Here are the things I would test:
- Basic happy case: When the text is tapped, the URL is opened. For this, see our uses of
testBinding.takeLaunchUrlCalls()
. - Error case: When the URL fails to be opened, we show an error dialog. For this, see our uses of
testBinding.launchUrlResult
andcheckErrorDialog
.
Also, please mark the commit with a Fixes
line. I see you've already done this in the GitHub PR description. 🙂
130093f
to
3d0f90a
Compare
@abelaba Thank you for your feedback. 🙂 |
Thanks for the positive feedback! 🙂 I've also updated the commit message to include the Please let me know if you have any further feedback or require any additional changes to the tests. |
Hi! One small comment I meant to leave last time, and I think Greg intends to do the next full review. 🙂 There's still a |
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 @VatsalBhesaniya for adding this (and for the upstream PR flutter/flutter#145157 that added this helper
field!) See comments below.
3585ecd
to
98f2e2f
Compare
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 @VatsalBhesaniya for the revision!
In this version, the first commit introduces a duplicate _launchUrl
function which is missing the mode
logic, much like in the previous revision as discussed at #595 (comment) . Then the second commit deduplicates the two functions into one combined place.
As part of writing clear and coherent commits, we want to avoid that intermediate step where we're adding a _launchUrl
function that has the wrong behavior. So instead a good commit sequence would be:
- Move the existing
_launchUrl
to the new file, renaming it, perhaps splitting into pieces, but maintaining the exact same behavior. This will be an NFC commit. - Add i18n for that function.
- Add the UI that resolves login: Link to doc to help users understand what a "server URL" is and how to find theirs #109, calling that function.
After that's done it'll again be possible to do a fine-grained review. In the meantime, here's a couple of comments from a high-level look.
fbbcc13
to
a683136
Compare
Thank you for your detailed feedback and guidance! I have followed your suggested approach and updated the commits accordingly. Let me know if you have any further suggestions. |
a683136
to
5f8ff32
Compare
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 @VatsalBhesaniya! Small comments below.
Also, please wrap the body text of each commit message; some lines have gotten too long: https://zulip.readthedocs.io/en/latest/contributing/commit-discipline.html#formatting-guidelines
1f6de5b
to
f5efcb1
Compare
- Move the existing launchUrl logic from content.dart to a new file named launch_url.dart. - Split function into pieces to handle realm-based and non-realm URLs. - Refactor error handling into a private function.
f5efcb1
to
e003a66
Compare
Hi @VatsalBhesaniya, it looks like you've updated the PR branch. Is it ready for another review? When you push updates and it's ready for another review, it's helpful if you post a comment saying so, for explicitness; that way reviewers don't have to guess. 🙂 |
Hi @chrisbobbe, Yes, the PR branch is ready for another review! I apologize for the confusion. I made updates locally, but for some reason, they weren't reflecting on GitHub 🤔. This hasn't happened to me before, so I hesitated to request another review until I was certain everything was pushed correctly. |
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 @VatsalBhesaniya! This is very close. Small comments below, and also #595 (comment) (which doesn't appear below for some reason).
|
||
final internalNarrow = parseInternalLink(url, store); | ||
if (internalNarrow != null) { | ||
Navigator.push(context, MessageListPage.buildRoute(context: context, narrow: internalNarrow)); |
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.
Navigator.push(context, MessageListPage.buildRoute(context: context, narrow: internalNarrow)); | |
Navigator.push(context, | |
MessageListPage.buildRoute(context: context, narrow: internalNarrow)); |
nit: break very long line with important information at the end
@@ -61,7 +64,48 @@ void main() { | |||
expectErrorFromText('email@example.com', ServerUrlValidationError.noUseEmail); | |||
}); | |||
|
|||
// TODO test AddAccountPage | |||
group('AddAccountPage Server URL Helper Text', () { |
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.
group('AddAccountPage Server URL Helper Text', () { | |
group('AddAccountPage server URL helper text', () { |
nit: match capitalization to other group
s
final helper = await findHelperText(tester); | ||
await tester.tap(helper); |
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.
final helper = await findHelperText(tester); | |
await tester.tap(helper); | |
await tester.tap(await findHelperText(tester)); |
nit: could save a line by inlining this expression (here and in the other test)
await tester.tap(find.byWidget(checkErrorDialog( | ||
tester, | ||
expectedTitle: zulipLocalizations.errorUnableToOpenLinkTitle, | ||
expectedMessage: zulipLocalizations.errorUnableToOpenLinkMessage( | ||
AddAccountPage.serverUrlHelpUrl.toString(), | ||
), | ||
))); |
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.
await tester.tap(find.byWidget(checkErrorDialog( | |
tester, | |
expectedTitle: zulipLocalizations.errorUnableToOpenLinkTitle, | |
expectedMessage: zulipLocalizations.errorUnableToOpenLinkMessage( | |
AddAccountPage.serverUrlHelpUrl.toString(), | |
), | |
))); | |
await tester.tap(find.byWidget(checkErrorDialog(tester, | |
expectedTitle: zulipLocalizations.errorUnableToOpenLinkTitle, | |
expectedMessage: zulipLocalizations.errorUnableToOpenLinkMessage( | |
AddAccountPage.serverUrlHelpUrl.toString(), | |
)))); |
nit: could be denser here, using fewer lines
Add helper text below the "server URL" field that, when tapped, opens relevant Zulip documentation explaining what a server URL is and how to find theirs. It will help users understand the "server URL" field during login.
Fixes: #109
Screen.Recording.2024-03-29.at.10.53.04.AM.mov
Screen.Recording.2024-03-28.at.7.06.06.PM.mov