Skip to content
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

SF-3028 Add final confirmation step when generating drafts #2787

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

josephmyers
Copy link
Collaborator

@josephmyers josephmyers commented Oct 9, 2024

image

I believe this may actually be the first of the mixed source UI PR's to be ready.


This change is Reviewable

@Nateowami Nateowami changed the title SF-3028 Confirm step SF-3028 Add final confirmation step when generating drafts Oct 9, 2024
@Nateowami
Copy link
Collaborator

Here's a screenshot of about where we were at the end of the conversation, for reference.

@josephmyers
Copy link
Collaborator Author

Two things Bethany suggested that I think are worth capturing here:

  • Using ranges when training books have the exact same source/target
  • Collapsing the training card by default

@josephmyers
Copy link
Collaborator Author

Given how condensed the training card can be with the latest changes, I think we should postpone the expand/collapse card til we confirm we need it.

Base automatically changed from fix/SF-2997 to master October 14, 2024 17:41
@Nateowami
Copy link
Collaborator

Nateowami commented Oct 16, 2024

This is an improvement, but:

  • I think there should be 4 rows here, not one giant cell
  • List of books to translate is still not in the same style as the books to draft from. Preferably same font size, comma separated. That's what I recall discussing last time we met.
  • Book names should be localized using the I18nService
  • I also think the font weight of 100 is too light.

@josephmyers
Copy link
Collaborator Author

  • I think there should be 4 rows here, not one giant cell

I am surprised to hear you say this. This would be going back toward the more blatant table style Bethany criticized last week. Combining the identical rows provides much-needed spacing. This is what the table style looks like:
image

  • List of books to translate is still not in the same style as the books to draft from. Preferably same font size, comma separated. That's what I recall discussing last time we met.

I'm not understanding. Aren't the books to translate and the books to draft from the same thing?

  • Book names should be localized using the I18nService

Yes, thanks. I haven't done localization yet (see raw text in HTML), but I'll do this one now. Should I fix the other places in the component that are forcing English, too?

  • I also think the font weight of 100 is too light.

I disagree. The lighter weight breaks up the monotony of the text and allows us to focus on the book data without needing to increase its weight. This weight is particularly suited to explanatory text like this, which isn't intended to be the focus, while still being readable. Unless you think it's not readable? I'm open to other suggestions, but simply using the standard font weight looked bad.

I do notice that 100-300 are all the same. Maybe we could define a level in between what we have now and the standard?

@josephmyers
Copy link
Collaborator Author

Talked with Nathaniel. It appears that the font sizes between the top and bottom are slightly different. I'll look into this. And we do in fact want the bottom books comma separated on one line.

@josephmyers
Copy link
Collaborator Author

josephmyers commented Nov 5, 2024

At the recent UX meeting, we decided to combine the identical training book ranges to a single cell, comma separated, with word/span wrapping that doesn't separate the individual ranges.

Edit: with full book names

@Nateowami
Copy link
Collaborator

After meeting with Nigel, this is looking good. Several things:

  • Remove margin-bottom from .explanation
  • Localize everything, including book names
  • Instead of list.join(', '), add this method to the I18nService and use it instead (not all languages do commas the same as English):
  enumerateList(list: string[]): string {
    return new (Intl as any).ListFormat(this.localeCode, { style: 'long', type: 'conjunction' }).format(list) as string;
  }

I think we're both happy with it once these changes are included.

@josephmyers josephmyers force-pushed the feature/SF-3028 branch 2 times, most recently from ed18e85 to 91b2744 Compare November 20, 2024 22:08
<div class="confirm-books cell-padding-block">
@for (range of element.ranges; track range) {
@if (range !== element.ranges[element.ranges.length - 1]) {
<span class="confirm-book">{{ range }}, </span>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be updated to use i18n.enumerateList

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. We do lose out on the word-wrapping control we had previously, however

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 79.20%. Comparing base (661951c) to head (c7c4ce3).

Files with missing lines Patch % Lines
...neration-steps/draft-generation-steps.component.ts 91.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2787      +/-   ##
==========================================
+ Coverage   79.18%   79.20%   +0.02%     
==========================================
  Files         533      533              
  Lines       30965    31001      +36     
  Branches     5049     5057       +8     
==========================================
+ Hits        24520    24555      +35     
- Misses       5659     5660       +1     
  Partials      786      786              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josephmyers josephmyers marked this pull request as ready for review December 2, 2024 04:54
@josephmyers
Copy link
Collaborator Author

@Nateowami, it sounds like you're owning the review on this? Or maybe @nigel-wells?

Copy link
Collaborator

@Nateowami Nateowami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 5 files at r1, 1 of 4 files at r2.
Reviewable status: 2 of 6 files reviewed, 1 unresolved discussion (waiting on @josephmyers)


src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation-steps/draft-generation-steps.component.html line 204 at r3 (raw file):

              <td mat-cell *matCellDef="let element" class="bookName">
                <div class="confirm-books cell-padding-block">
                  {{ this.i18n.enumerateList(element.ranges) }}

this. is not needed, here or below.

Copy link
Collaborator Author

@josephmyers josephmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 6 files reviewed, all discussions resolved (waiting on @Nateowami)


src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation-steps/draft-generation-steps.component.html line 204 at r3 (raw file):

Previously, Nateowami wrote…

this. is not needed, here or below.

Done

This involved a few overrides on the stepper to get it to look normal, including enabling header hover when a step is incomplete, disabling font size growth for the selected step, and hiding the odd "edit" state which cluttered up the stepper.

Also removed the "initial/steps" tab group on the parent and the extra, persistent Back button.
Lots of the component logic is handjammed, but we can fix this once the preceding tasks are merged.
Switched to a card design. The gray box was too much color, decreased contrast, and just didn't look great.

Inserted the titles from Step 1, with the source name added to the second.
Also displaying the display name of the language codes for the training table header (assuming it's retrievable).
And force synced the book font size
I think my previous iteration is more readable, but I'm content if others are fine with it.
This does mean we won't have as much control about word wrapping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants