Conversation
pmachapman
left a comment
There was a problem hiding this comment.
Thanks - this is much better than my approach to the problem. Just one fix, then good to go.
@pmachapman reviewed 8 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on nate).
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-options.service.ts
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3737 +/- ##
==========================================
- Coverage 81.33% 81.32% -0.02%
==========================================
Files 620 620
Lines 39051 39056 +5
Branches 6347 6350 +3
==========================================
Hits 31764 31764
- Misses 6318 6323 +5
Partials 969 969 ☔ View full report in Codecov by Sentry. |
fb0b5be to
98a5a7f
Compare
| get formattingOptionsPath(): string[] { | ||
| return ['/projects', this.activatedProjectService.projectId!, 'draft-generation', 'format']; | ||
| } |
There was a problem hiding this comment.
🟡 Non-null assertion on projectId in formattingOptionsPath can produce invalid route
activatedProjectService.projectId is typed string | undefined, but the getter uses a non-null assertion (!) without any guard. If projectId is ever undefined (e.g., during initialization or a race condition), the resulting path becomes ['/projects', undefined, 'draft-generation', 'format'], which Angular coerces to the string "undefined", navigating the user to /projects/undefined/draft-generation/format — a non-existent route. This getter is called from three template bindings (draft-generation.component.html:361, draft-history-entry.component.html:29, draft-history-entry.component.html:59) and from draft-generation.component.ts:358 via this.router.navigate(...). Per the repository's AGENTS.md: "It is better to explicitly check for and handle problems, or prevent problems from happening, than to assume problems will not happen" and "Corner-cases happen. They should be handled in code."
| get formattingOptionsPath(): string[] { | |
| return ['/projects', this.activatedProjectService.projectId!, 'draft-generation', 'format']; | |
| } | |
| get formattingOptionsPath(): string[] { | |
| const projectId: string = this.activatedProjectService.projectId ?? ''; | |
| return ['/projects', projectId, 'draft-generation', 'format']; | |
| } |
Was this helpful? React with 👍 or 👎 to provide feedback.
pmachapman
left a comment
There was a problem hiding this comment.
@pmachapman reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Nateowami).
98a5a7f to
6d4eec8
Compare
| options: [ | ||
| { | ||
| value: true, | ||
| label: this.i18n.translate('draft_generation.formatting_options'), | ||
| highlight: true, | ||
| icon: 'build' | ||
| } | ||
| ] |
There was a problem hiding this comment.
🟡 Dialog has no cancel/dismiss button, only an action button
The formatting options dialog in generateDraftClicked (draft-generation.component.ts:346-357) is created with only a single option (value: true, label "Formatting options"). Unlike every other dialog created via openGenericDialog in this codebase (e.g., the confirm dialogs at draft-generation.component.ts:362-373 and draft-generation.component.ts:385-396), this dialog provides no explicit cancel/close button. While the user can dismiss the dialog by pressing Escape or clicking the backdrop, this is not discoverable and inconsistent with the established UX pattern of always providing a cancel/close option in generic dialogs.
| options: [ | |
| { | |
| value: true, | |
| label: this.i18n.translate('draft_generation.formatting_options'), | |
| highlight: true, | |
| icon: 'build' | |
| } | |
| ] | |
| options: [ | |
| { | |
| value: false, | |
| label: this.i18n.translate('dialog.cancel') | |
| }, | |
| { | |
| value: true, | |
| label: this.i18n.translate('draft_generation.formatting_options'), | |
| highlight: true, | |
| icon: 'build' | |
| } | |
| ] |
Was this helpful? React with 👍 or 👎 to provide feedback.
| "requested_at": "Requested {{ requestedAtTime }}.", | ||
| "requested_by": "Requested by {{ requestedByUserName }} at {{ requestedAtTime }}.", | ||
| "select_formatting_options": "The draft has been created, and there are new formatting options to select. You will only need to do this once, but you can change them whenever you wish.", | ||
| "select_formatting_options": "The draft has been created. Choose formatting options to continue.", |
There was a problem hiding this comment.
🚩 Localization key 'select_formatting_options' changed text significantly without new key
The string for draft_history_entry.select_formatting_options was changed from a detailed explanation ("The draft has been created, and there are new formatting options to select. You will only need to do this once, but you can change them whenever you wish.") to a shorter message ("The draft has been created. Choose formatting options to continue."). Per REVIEW.md: "significant changes to a string should use a new key, otherwise existing translations will continue to show the old string." Since the meaning and length changed substantially, existing translations in other languages will show the old longer text until manually updated, which may be confusing.
Was this helpful? React with 👍 or 👎 to provide feedback.
This came from this morning's meeting.
This change is