From 1397d0faed21f3555eace09651450b9ecf6855e9 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sun, 8 Jan 2023 20:23:23 +0100 Subject: [PATCH] allow editing the current SFTP path by double-clicking - #7154, fixed #7291, fixed #7295, fixed #6666, fixed #6646, fixed #6354, fixed #5646 --- tabby-ssh/src/components/sftpPanel.component.pug | 13 ++++++++++++- tabby-ssh/src/components/sftpPanel.component.ts | 13 +++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tabby-ssh/src/components/sftpPanel.component.pug b/tabby-ssh/src/components/sftpPanel.component.pug index 58867ad3..c2f74171 100644 --- a/tabby-ssh/src/components/sftpPanel.component.pug +++ b/tabby-ssh/src/components/sftpPanel.component.pug @@ -1,11 +1,22 @@ .header - .breadcrumb.mr-auto + input.form-control.flex-grow-1.w-0( + *ngIf='editingPath !== null', + type='text', + autofocus, + (keydown.enter)='confirmPath()', + (keydown.esc)='editingPath = null', + (blur)='editingPath = null', + [(ngModel)]='editingPath' + ) + .breadcrumb(*ngIf='editingPath === null', (dblclick)='editPath()') a.breadcrumb-item((click)='navigate("/")') SFTP a.breadcrumb-item( *ngFor='let segment of pathSegments', (click)='navigate(segment.path)' ) {{segment.name}} + .breadcrumb-spacer.flex-grow-1.h-100((dblclick)='editPath()') + button.btn.btn-link.btn-sm.d-flex((click)='openCreateDirectoryModal()') i.fas.fa-plus.mr-1 div(translate) Create directory diff --git a/tabby-ssh/src/components/sftpPanel.component.ts b/tabby-ssh/src/components/sftpPanel.component.ts index 2c663fcc..9f27cb9b 100644 --- a/tabby-ssh/src/components/sftpPanel.component.ts +++ b/tabby-ssh/src/components/sftpPanel.component.ts @@ -27,6 +27,7 @@ export class SFTPPanelComponent { @Output() pathChange = new EventEmitter() pathSegments: PathSegment[] = [] @Input() cwdDetectionAvailable = false + editingPath: string|null = null constructor ( private ngbModal: NgbModal, @@ -182,6 +183,18 @@ export class SFTPPanelComponent { window.localStorage.sshCWDTipDismissed = 'true' } + editPath (): void { + this.editingPath = this.path + } + + confirmPath (): void { + if (this.editingPath === null) { + return + } + this.navigate(this.editingPath) + this.editingPath = null + } + close (): void { this.closed.emit() }