-
Notifications
You must be signed in to change notification settings - Fork 10
Support MessageSpec.extraConfirmText
for high-impact confirm prompts
#4064
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
Toolbox PR: xh/toolbox#776 |
@jskupsik -- I love that you are doing this and had been thinking this recently -- in fact I have a PR for another change to our pop-up infrastructure: This seems to me an elegant solution with the current API, but I am wondering if it would make sense to take it one step farther, to have MessageSpec include a 'extraConfirmText' and an
|
|
🔥 -- Really like this change |
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 for taking this on! You will see I recommend scaling back our use of this in Hoist, but the role delete and instance shutdown cases are good ones, and having this feature available for app usage will certainly be helpful.
@@ -136,6 +136,7 @@ export class AlertBannerModel extends HoistModel { | |||
removePreset(preset: PlainObject) { | |||
XH.confirm({ | |||
message: 'Are you sure you wish to delete this preset?', | |||
extraConfirmText: 'DELETE', |
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.
Same, no extra confirm - let's save it for truly high-impact choices that could destabilize a system if done (and then confirmed) accidentally. Deleting a banner preset not one of those cases.
desktop/appcontainer/Message.ts
Outdated
}) | ||
}) | ||
: null | ||
] |
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.
Minor nit might be more readable with conditional checks and pushing onto items vs. multiple ternaries, or use omit
which is designed for this
MessageSpec.extraConfirmText
for high-impact confirm prompts
Co-authored-by: Anselm McClain <[email protected]>
Co-authored-by: Anselm McClain <[email protected]>
# Conflicts: # CHANGELOG.md
- Don't inline label for confirm - might be long - Tweaks to confirm language across toolkit usages for consistency
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.
👍👍
Hoist P/R Checklist
Pull request authors: Review and check off the below. Items that do not apply can also be
checked off to indicate they have been considered. If unclear if a step is relevant, please leave
unchecked and note in comments.
develop
branch as of last change.breaking-change
label + CHANGELOG if so.If your change is still a WIP, please use the "Create draft pull request" option in the split
button below to indicate it is not ready yet for a final review.