-
-
Notifications
You must be signed in to change notification settings - Fork 6
Update line break draft format wording #3273
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
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #3273 +/- ##
=======================================
Coverage 82.52% 82.52%
=======================================
Files 605 605
Lines 35196 35205 +9
Branches 5715 5697 -18
=======================================
+ Hits 29045 29053 +8
- Misses 5299 5312 +13
+ Partials 852 840 -12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @RaymondLuong3)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 182 at r1 (raw file):
await this.projectService.onlineSetUsfmConfig(this.projectId, this.currentFormat); this.lastSavedState = this.currentFormat; // not awaited so that the user is directed to the draft generation page
I don't understand this comment. How does awaiting prevent a redirect after saving?
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 185 at r1 (raw file):
this.servalAdministration.onlineRetrievePreTranslationStatus(this.projectId).then(() => { this.router.navigate(['projects', this.projectId, 'draft-generation']); this.noticeService.show(translate('draft_usfm_format.changes_have_been_saved'));
Given the redirect only happens if it's successful, I think the notice is unneeded and doesn't match what we do elsewhere.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.html
line 65 at r1 (raw file):
{{ t("save_changes") }} </button> <div class="progress" [ngClass]="{ saving: saving }">
What about [class.saving]="saving"
?
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.html
line 66 at r1 (raw file):
</button> <div class="progress" [ngClass]="{ saving: saving }"> <mat-spinner diameter="24"></mat-spinner>
I really dislike how this spinner changes the layout, but I don't have anything great to suggest. My best idea is to replace the check mark with a spinner, but making that work is somewhat challenging.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.scss
line 92 at r1 (raw file):
justify-content: flex-end; .progress {
How about:
.progress:not(.saving) {
visibility: hidden;
}
Only one rule needed, and the intent is clearer.
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Nateowami)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.html
line 65 at r1 (raw file):
Previously, Nateowami wrote…
What about
[class.saving]="saving"
?
Good idea. Done.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.html
line 66 at r1 (raw file):
Previously, Nateowami wrote…
I really dislike how this spinner changes the layout, but I don't have anything great to suggest. My best idea is to replace the check mark with a spinner, but making that work is somewhat challenging.
I agree. I also did not like how adding the spinner means we have to adjust the layout for the action buttons. But I think the spinner is worth keeping to communicate that something happened when the user clicked save.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.scss
line 92 at r1 (raw file):
Previously, Nateowami wrote…
How about:
.progress:not(.saving) { visibility: hidden; }Only one rule needed, and the intent is clearer.
Done.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 182 at r1 (raw file):
Previously, Nateowami wrote…
I don't understand this comment. How does awaiting prevent a redirect after saving?
Thanks for catching this. The comment was obsolete. I've updated it.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 185 at r1 (raw file):
Previously, Nateowami wrote…
Given the redirect only happens if it's successful, I think the notice is unneeded and doesn't match what we do elsewhere.
That would work. If the user clicks save, that is explicit enough that we will save their changes.
d4e4cab
to
634d929
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.
Reviewed 4 of 6 files at r2.
Reviewable status: 5 of 7 files reviewed, 1 unresolved discussion (waiting on @RaymondLuong3)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.html
line 66 at r1 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
I agree. I also did not like how adding the spinner means we have to adjust the layout for the action buttons. But I think the spinner is worth keeping to communicate that something happened when the user clicked save.
Can you:
- Space cancel and save as far apart as possible (
justify-content: space-between;
) - Put the spinner and save button in a wrapper
- Put the spinner to the left of the save button
I think that would look a lot better and not shift the layout.
634d929
to
cad6289
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.
Reviewable status: 4 of 7 files reviewed, 1 unresolved discussion (waiting on @Nateowami)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.html
line 66 at r1 (raw file):
Previously, Nateowami wrote…
Can you:
- Space cancel and save as far apart as possible (
justify-content: space-between;
)- Put the spinner and save button in a wrapper
- Put the spinner to the left of the save button
I think that would look a lot better and not shift the layout.
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.
Reviewed 1 of 6 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @RaymondLuong3)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.html
line 66 at r1 (raw file):
Looks a lot better! Thanks!
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 185 at r3 (raw file):
this.servalAdministration .onlineRetrievePreTranslationStatus(this.projectId) .then(() => this.router.navigate(['projects', this.projectId, 'draft-generation']));
Is it intentional that you're not showing the error message when retrieving pretranslations fails? The normal way to write this would be:
await this.servalAdministration.onlineRetrievePreTranslationStatus(this.projectId);
this.router.navigate(['projects', this.projectId, 'draft-generation']);
By not using await, you're not catching the error in the catch clause.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 186 at r3 (raw file):
.onlineRetrievePreTranslationStatus(this.projectId) .then(() => this.router.navigate(['projects', this.projectId, 'draft-generation'])); } catch {
Errors that are caught should also be reported, ideally to Bugsnag, but at a minimum logged to the console.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 187 at r3 (raw file):
.then(() => this.router.navigate(['projects', this.projectId, 'draft-generation'])); } catch { this.noticeService.showError(translate('draft_usfm-format.failed_to_save'));
This translation key does not exist. If you used this.i18n.translateStatic()
instead of the bare translate()
, it would have been obvious, since it provides type safety.
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Nateowami)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 185 at r3 (raw file):
Previously, Nateowami wrote…
Is it intentional that you're not showing the error message when retrieving pretranslations fails? The normal way to write this would be:
await this.servalAdministration.onlineRetrievePreTranslationStatus(this.projectId); this.router.navigate(['projects', this.projectId, 'draft-generation']);By not using await, you're not catching the error in the catch clause.
No, that was not intentional. Thanks for catching that.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 186 at r3 (raw file):
Previously, Nateowami wrote…
Errors that are caught should also be reported, ideally to Bugsnag, but at a minimum logged to the console.
I'll log it to the console. The backend already has error reporting built in.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 187 at r3 (raw file):
Previously, Nateowami wrote…
This translation key does not exist. If you used
this.i18n.translateStatic()
instead of the baretranslate()
, it would have been obvious, since it provides type safety.
Done.
cad6289
to
8e25b75
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.
Reviewed 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @RaymondLuong3)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 186 at r3 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
I'll log it to the console. The backend already has error reporting built in.
Please actually catch and log the error, rather than just logging a string. The error message you've added isn't even necessarily correct; there are multiple things that can throw in this context.
fbb7fd9
to
8235f34
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.
Reviewable status: 6 of 7 files reviewed, 1 unresolved discussion (waiting on @Nateowami)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-usfm-format/draft-usfm-format.component.ts
line 186 at r3 (raw file):
Previously, Nateowami wrote…
Please actually catch and log the error, rather than just logging a string. The error message you've added isn't even necessarily correct; there are multiple things that can throw in this context.
Good suggestion. Done.
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.
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @RaymondLuong3)
This PR updates the wording for the line break options in the draft format component. Additionally, the user now navigates back to the generate draft page after saving the changes which is more intuitive. A progress circle has been introduced to notify the user their changes are currently saving.
I marked this as testing not required since the changes can be tested by a developer.
This change is