Skip to content

SF-3742 Prompt user to select formatting options before generating draft#3737

Merged
Nateowami merged 2 commits intomasterfrom
feature/SF-3742-prompt-formatting-options-new-draft
Mar 18, 2026
Merged

SF-3742 Prompt user to select formatting options before generating draft#3737
Nateowami merged 2 commits intomasterfrom
feature/SF-3742-prompt-formatting-options-new-draft

Conversation

@Nateowami
Copy link
Copy Markdown
Collaborator

@Nateowami Nateowami commented Mar 10, 2026

This came from this morning's meeting.


Open with Devin

This change is Reviewable

@Nateowami Nateowami added the will require testing PR should not be merged until testers confirm testing is complete label Mar 10, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

@pmachapman pmachapman self-assigned this Mar 11, 2026
@pmachapman pmachapman self-requested a review March 11, 2026 00:14
Copy link
Copy Markdown
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

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

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).

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.32%. Comparing base (a48acd9) to head (6d4eec8).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ate/draft-generation/draft-generation.component.ts 12.50% 7 Missing ⚠️
...ranslate/draft-generation/draft-options.service.ts 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@Nateowami Nateowami force-pushed the feature/SF-3742-prompt-formatting-options-new-draft branch from fb0b5be to 98a5a7f Compare March 11, 2026 18:11
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment on lines +40 to +42
get formattingOptionsPath(): string[] {
return ['/projects', this.activatedProjectService.projectId!, 'draft-generation', 'format'];
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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."

Suggested change
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'];
}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

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

:lgtm:

@pmachapman reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Nateowami).

@pmachapman pmachapman added ready to test and removed will require testing PR should not be merged until testers confirm testing is complete labels Mar 17, 2026
@Nateowami Nateowami added testing complete Testing of PR is complete and should no longer hold up merging of the PR and removed ready to test labels Mar 18, 2026
@Nateowami Nateowami force-pushed the feature/SF-3742-prompt-formatting-options-new-draft branch from 98a5a7f to 6d4eec8 Compare March 18, 2026 14:38
@Nateowami Nateowami enabled auto-merge (squash) March 18, 2026 14:38
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment on lines +349 to +356
options: [
{
value: true,
label: this.i18n.translate('draft_generation.formatting_options'),
highlight: true,
icon: 'build'
}
]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.

Suggested change
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'
}
]
Open in Devin Review

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.",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@Nateowami Nateowami merged commit 885d742 into master Mar 18, 2026
21 of 22 checks passed
@Nateowami Nateowami deleted the feature/SF-3742-prompt-formatting-options-new-draft branch March 18, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing complete Testing of PR is complete and should no longer hold up merging of the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants