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

core: add confirmation prompt when executing clear command history #12495

Closed
vince-fugnitto opened this issue May 8, 2023 · 1 comment · Fixed by #12510
Closed

core: add confirmation prompt when executing clear command history #12495

vince-fugnitto opened this issue May 8, 2023 · 1 comment · Fixed by #12510
Labels
core issues related to the core of the application good first issue good first issues for new contributors ui/ux issues related to user interface / user experience

Comments

@vince-fugnitto
Copy link
Member

Feature Description

The goal is to prompt end-users to confirm whether or not they want to actually clear their command history when executing the command Clear Command History. The confirmation will prevent clearing history accidentally for instance, and aligns with the behavior present in VS Code.

Related Code

Command Registration:

commands.registerCommand(CLEAR_COMMAND_HISTORY, {
execute: () => commands.clearCommandHistory(),
});
}

ConfirmDialog:

Definition:

export class ConfirmDialog extends AbstractDialog<boolean> {

Example Usage:

export async function confirmExit(): Promise<boolean> {
const safeToExit = await new ConfirmDialog({
title: nls.localizeByDefault('Are you sure you want to quit?'),
msg: nls.localize('theia/core/quitMessage', 'Any unsaved changes will not be saved.'),
ok: Dialog.YES,
cancel: Dialog.NO,
}).open();
return safeToExit === true;
}

@vince-fugnitto vince-fugnitto added good first issue good first issues for new contributors core issues related to the core of the application ui/ux issues related to user interface / user experience labels May 8, 2023
@helloworldmygithub
Copy link
Contributor

I want to work on this issue

helloworldmygithub added a commit to helloworldmygithub/theia that referenced this issue May 10, 2023
The commit add confirmation prompt when executing clear command history

Signed-off-by: zhangyi <[email protected]>
vince-fugnitto pushed a commit that referenced this issue May 11, 2023
The commit adds a confirmation prompt when executing the `clear command history` command.

Signed-off-by: zhangyi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core issues related to the core of the application good first issue good first issues for new contributors ui/ux issues related to user interface / user experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants