Skip to content

Delete Confirmation with "Challenge" has potentially dangerous button defaults #2691

Closed
@sevoku

Description

@sevoku

With the azureDatabases.confirmationStyle=challengeConfirmation prompt style the default button (responds to ⏎ Enter) is always the first number and the last number has always the focus (Space on MacOS):

Image

I think it'd be better to make "Cancel" to always be the default.

Activity

added this to the 0.27.0 milestone on May 15, 2025
added theissue type on May 15, 2025
added
enhancementSmall changes that can slightly improve user experiences.
on May 15, 2025
tnaum-ms

tnaum-ms commented on May 21, 2025

@tnaum-ms
Collaborator

Unfortunately, there is no way to make "Cancel" the default option, or rather - I wasn't able to find a solution here.

That's why there is a different solution in place. The first option is never the default one. The random 'confirmation' choices are always the second or the third option.

https://github.com/microsoft/vscode-cosmosdb/blob/36da7c60b77409474dce72df703f8dfe650fb8ff/src/utils/dialogs/getConfirmation.ts#L131C1-L133C1

@sevoku I'd suggest closing this issue as resolved.

We could potentially improve the comment in the code to make the maintainers aware of the reasoning behind this so that no one changes it back ⚠️

self-assigned this
on May 26, 2025
moved this from In progress to In review in Azure Databases for VSCode: Release Planon May 26, 2025
tnaum-ms

tnaum-ms commented on May 26, 2025

@tnaum-ms
Collaborator

I added more comments to the code base.

sevoku

sevoku commented on May 26, 2025

@sevoku
MemberAuthor

@tnaum-ms ok I see, you're right, the first button will never be the right one, but on MacOS the last button always has the focus and can be activated with Space:

Image

Making it a way less secure approach on MacOS if the right number is the last number. But unfortunately VS Code does not give us more control over this.
I'm fine with closing this since this is not the default option anyway, but it seems to be the default in DocumentDB?

tnaum-ms

tnaum-ms commented on May 26, 2025

@tnaum-ms
Collaborator

@sevoku oh, so on MacOS the default is the first button, but the selection is on the last one..

Tricky - we can do a system-dependent selection, for MacOS would it be always the index 1 then?

It looks like it's just no longer a good option in general and most likely should be removed. Thoughts?

modified the milestones: 0.28.0, 0.26.1 on Jun 2, 2025

8 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementSmall changes that can slightly improve user experiences.

Type

Projects

Status

Done

Relationships

None yet

    Development

    Participants

    @sevoku@tnaum-ms

    Issue actions

      Delete Confirmation with "Challenge" has potentially dangerous button defaults · Issue #2691 · microsoft/vscode-cosmosdb