From 2fed61ee2d644edd51f303ee687731716c9a8ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20=C3=85berg?= Date: Thu, 18 Dec 2025 12:01:34 +0100 Subject: [PATCH] Improve SSH agent approval dialog UX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Prevent accidental dismissal by disabling backdrop click (disableClose) - Add 1.5s delay before Authorize button becomes clickable - Fix Deny button to properly close dialog with false result 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../components/approve-ssh-request.html | 10 ++++++++-- .../platform/components/approve-ssh-request.ts | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/platform/components/approve-ssh-request.html b/apps/desktop/src/platform/components/approve-ssh-request.html index c691891487e..ed383219ca6 100644 --- a/apps/desktop/src/platform/components/approve-ssh-request.html +++ b/apps/desktop/src/platform/components/approve-ssh-request.html @@ -13,10 +13,16 @@ {{ "sshkeyApprovalMessageSuffix" | i18n }} {{ params.action | i18n }} - - diff --git a/apps/desktop/src/platform/components/approve-ssh-request.ts b/apps/desktop/src/platform/components/approve-ssh-request.ts index a2cae3d59e7..53ab223ecca 100644 --- a/apps/desktop/src/platform/components/approve-ssh-request.ts +++ b/apps/desktop/src/platform/components/approve-ssh-request.ts @@ -1,5 +1,5 @@ import { CommonModule } from "@angular/common"; -import { Component, Inject } from "@angular/core"; +import { Component, Inject, OnInit } from "@angular/core"; import { FormBuilder, ReactiveFormsModule } from "@angular/forms"; import { JslibModule } from "@bitwarden/angular/jslib.module"; @@ -39,8 +39,11 @@ export interface ApproveSshRequestParams { CalloutModule, ], }) -export class ApproveSshRequestComponent { +export class ApproveSshRequestComponent implements OnInit { approveSshRequestForm = this.formBuilder.group({}); + authorizeEnabled = false; + + private static readonly AUTHORIZE_DELAY_MS = 1500; constructor( @Inject(DIALOG_DATA) protected params: ApproveSshRequestParams, @@ -48,6 +51,12 @@ export class ApproveSshRequestComponent { private formBuilder: FormBuilder, ) {} + ngOnInit(): void { + setTimeout(() => { + this.authorizeEnabled = true; + }, ApproveSshRequestComponent.AUTHORIZE_DELAY_MS); + } + static open( dialogService: DialogService, cipherName: string, @@ -69,10 +78,15 @@ export class ApproveSshRequestComponent { isAgentForwarding, action: actioni18nKey, }, + disableClose: true, }); } submit = async () => { this.dialogRef.close(true); }; + + deny(): void { + this.dialogRef.close(false); + } }