Add SFTP toggle button to SSH tabs and enable fullscreen support
- Added 📁 folder icon button on SSH tabs to toggle the SFTP file browser
- Button appears on hover/active, styled consistently with the close button
- Removed conflicting Cmd+Shift+F shortcut (clashes with macOS find)
- Added platform-specific window options (Mac, Windows, Linux)
- Added F11 fullscreen toggle and Escape to exit fullscreen
- Cleaned up SFTP panel on session close
This commit is contained in:
@@ -128,6 +128,41 @@
|
|||||||
.tab-status.is-error { background: var(--error); }
|
.tab-status.is-error { background: var(--error); }
|
||||||
.tab-status.is-disconnected { background: var(--text-tertiary); }
|
.tab-status.is-disconnected { background: var(--text-tertiary); }
|
||||||
|
|
||||||
|
/* -----------------------------------------------------------------------
|
||||||
|
SFTP toggle button — revealed on hover (SSH tabs only)
|
||||||
|
----------------------------------------------------------------------- */
|
||||||
|
.tab-sftp {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
font-size: 10px;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
flex-shrink: 0;
|
||||||
|
opacity: 0;
|
||||||
|
transition:
|
||||||
|
opacity var(--transition-fast),
|
||||||
|
background var(--transition-fast),
|
||||||
|
color var(--transition-fast);
|
||||||
|
cursor: pointer;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab:hover .tab-sftp,
|
||||||
|
.tab.active .tab-sftp {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-sftp:hover {
|
||||||
|
background: var(--bg-active);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
Close button — revealed on hover
|
Close button — revealed on hover
|
||||||
----------------------------------------------------------------------- */
|
----------------------------------------------------------------------- */
|
||||||
@@ -147,7 +182,7 @@
|
|||||||
background var(--transition-fast),
|
background var(--transition-fast),
|
||||||
color var(--transition-fast);
|
color var(--transition-fast);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: auto;
|
margin-left: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab:hover .tab-close,
|
.tab:hover .tab-close,
|
||||||
|
|||||||
+13
-11
@@ -333,9 +333,22 @@ class App {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// F11 — toggle fullscreen (Windows/Linux convention)
|
||||||
|
if (e.key === 'F11') {
|
||||||
|
e.preventDefault();
|
||||||
|
if (window.runtime && typeof window.runtime.WindowFullscreen === 'function') {
|
||||||
|
window.runtime.WindowFullscreen();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Escape — close any open overlays
|
// Escape — close any open overlays
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
this.commandPalette.close();
|
this.commandPalette.close();
|
||||||
|
// Also exit fullscreen if active (Windows/Linux)
|
||||||
|
if (window.runtime && typeof window.runtime.WindowUnfullscreen === 'function') {
|
||||||
|
window.runtime.WindowUnfullscreen();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl/Cmd+Shift+D — split pane vertically (left/right)
|
// Ctrl/Cmd+Shift+D — split pane vertically (left/right)
|
||||||
@@ -361,17 +374,6 @@ class App {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl/Cmd+Shift+F — toggle SFTP file browser on active SSH session
|
|
||||||
if (mod && e.shiftKey && e.key === 'F') {
|
|
||||||
e.preventDefault();
|
|
||||||
if (this.state.activeSessionId) {
|
|
||||||
var session = this.state.getSession(this.state.activeSessionId);
|
|
||||||
if (session && session.protocol === 'ssh') {
|
|
||||||
this.sftp.toggle(this.state.activeSessionId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -418,6 +418,20 @@ class TabManager {
|
|||||||
tab.classList.add('tab-pinned');
|
tab.classList.add('tab-pinned');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SFTP toggle button (SSH sessions only)
|
||||||
|
if (sessionInfo.protocol === 'ssh') {
|
||||||
|
const sftpBtn = createElement('button', 'tab-sftp', {
|
||||||
|
textContent: '📁',
|
||||||
|
title: 'Toggle SFTP file browser',
|
||||||
|
'aria-label': 'Toggle SFTP',
|
||||||
|
});
|
||||||
|
sftpBtn.addEventListener('click', (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
this.app.sftp.toggle(sessionInfo.id);
|
||||||
|
});
|
||||||
|
tab.appendChild(sftpBtn);
|
||||||
|
}
|
||||||
|
|
||||||
// Close button
|
// Close button
|
||||||
const closeBtn = createElement('button', 'tab-close', {
|
const closeBtn = createElement('button', 'tab-close', {
|
||||||
textContent: '×',
|
textContent: '×',
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ import (
|
|||||||
"github.com/wailsapp/wails/v2"
|
"github.com/wailsapp/wails/v2"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options"
|
"github.com/wailsapp/wails/v2/pkg/options"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||||||
|
"github.com/wailsapp/wails/v2/pkg/options/linux"
|
||||||
|
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
||||||
|
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
||||||
|
|
||||||
application "github.com/copilot-ssh-client/app/internal/app"
|
application "github.com/copilot-ssh-client/app/internal/app"
|
||||||
"github.com/copilot-ssh-client/app/frontend"
|
"github.com/copilot-ssh-client/app/frontend"
|
||||||
@@ -32,6 +35,17 @@ func main() {
|
|||||||
OnStartup: nexus.Startup,
|
OnStartup: nexus.Startup,
|
||||||
OnShutdown: nexus.Shutdown,
|
OnShutdown: nexus.Shutdown,
|
||||||
OnDomReady: nexus.DomReady,
|
OnDomReady: nexus.DomReady,
|
||||||
|
// macOS: enable the green fullscreen traffic-light button.
|
||||||
|
Mac: &mac.Options{
|
||||||
|
About: &mac.AboutInfo{
|
||||||
|
Title: "Nexus Terminal",
|
||||||
|
Message: "A premium desktop terminal client",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// Windows: default decorations include maximise; fullscreen via F11.
|
||||||
|
Windows: &windows.Options{},
|
||||||
|
// Linux: use the default window manager decorations (fullscreen via WM).
|
||||||
|
Linux: &linux.Options{},
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
nexus.APIService(),
|
nexus.APIService(),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user