Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/conch_tauri/frontend/files-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
<div class="fp-pane-container">
<div class="fp-pane" id="fp-remote"></div>
<div class="fp-transfer-bar">
<button class="fp-transfer-btn" id="fp-download" title="Download selected">&#8595; Download</button>
<button class="fp-transfer-btn" id="fp-upload" title="Upload selected">&#8593; Upload</button>
<button class="fp-transfer-btn" id="fp-download" title="Download selected file from remote to local"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" style="vertical-align:-2px"><path d="m 2.001 8.211 1.386 -1.385 3.635 3.635 -0.021 -8.461 h 2 l 0.021 8.461 3.634 -3.635 1.385 1.385 -6.041 6.001 z"/></svg></button>
<button class="fp-transfer-btn" id="fp-upload" title="Upload selected file from local to remote"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" style="vertical-align:-2px"><path d="m 2.001 7.789 1.386 1.385 3.635 -3.635 -0.021 8.461 h 2 l 0.021 -8.461 3.634 3.635 1.385 -1.385 -6.041 -6.001 z"/></svg></button>
</div>
<div class="fp-pane" id="fp-local"></div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions crates/conch_tauri/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,9 @@
}
.ssh-session-node {
display: flex; align-items: center; gap: 6px;
padding: 3px 10px 3px 14px; cursor: default;
padding: 3px 10px 3px 14px; cursor: pointer;
}
.ssh-session-node:hover { background: var(--input-bg); }
.ssh-session-dot {
width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0;
}
Expand Down Expand Up @@ -940,8 +941,8 @@
r.setProperty('--blue', tc.blue);
r.setProperty('--cyan', tc.cyan);
r.setProperty('--magenta', tc.magenta);
r.setProperty('--input-bg', tc.panel_bg);
r.setProperty('--hover-bg', tc.panel_bg);
r.setProperty('--input-bg', tc.input_bg);
r.setProperty('--hover-bg', tc.input_bg);
document.body.style.background = tc.background;
} catch (e) {
console.warn('Failed to load theme colors:', e);
Expand Down Expand Up @@ -1762,6 +1763,8 @@
r.setProperty('--tab-bar-bg', tc.tab_bar_bg);
r.setProperty('--tab-border', tc.tab_border);
r.setProperty('--active-highlight', tc.active_highlight);
r.setProperty('--input-bg', tc.input_bg);
r.setProperty('--hover-bg', tc.input_bg);
r.setProperty('--red', tc.red);
r.setProperty('--green', tc.green);
r.setProperty('--yellow', tc.yellow);
Expand Down
47 changes: 25 additions & 22 deletions crates/conch_tauri/frontend/ssh-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@
<div class="ssh-panel-header">
<span class="ssh-panel-title">Sessions</span>
<div class="ssh-panel-actions">
<button class="ssh-icon-btn" id="ssh-add-server" title="New Connection">+</button>
<button class="ssh-icon-btn" id="ssh-add-folder" title="New Folder">&#128193;</button>
<button class="ssh-icon-btn" id="ssh-refresh" title="Refresh">&#8635;</button>
<div style="position:relative">
<button class="ssh-icon-btn" id="ssh-add-new" title="New..."><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" style="vertical-align:-2px"><path d="M 4 7 h 8 v 2 H 4 Z M 7 4 h 2 v 8 H 7 Z"/></svg></button>
</div>
<button class="ssh-icon-btn" id="ssh-refresh" title="Refresh"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" style="vertical-align:-2px"><path d="m 7.972 0 v 2 c -3.314 0 -6 2.686 -6 6 0 3.314 2.686 6 6 6 3.28 0 5.94 -2.633 5.994 -5.9 0.004 -0.033 0.006 -0.066 0.006 -0.1 0 -0.006 -0.004 -0.011 -0.004 -0.018 h -1.992 c 0 0.006 -0.004 0.011 -0.004 0.018 0 2.209 -1.791 4 -4 4 -2.209 0 -4 -1.791 -4 -4 0 -2.209 1.791 -4 4 -4 v 2 l 3.494 -3.018 z"/></svg></button>
</div>
</div>
<div class="ssh-quick-connect">
Expand Down Expand Up @@ -120,8 +121,10 @@
});

// Buttons
panelEl.querySelector('#ssh-add-server').addEventListener('click', () => showConnectionForm());
panelEl.querySelector('#ssh-add-folder').addEventListener('click', showAddFolderDialog);
panelEl.querySelector('#ssh-add-new').addEventListener('click', (e) => {
e.stopPropagation();
showNewMenu(panelEl.querySelector('#ssh-add-new'));
});
panelEl.querySelector('#ssh-refresh').addEventListener('click', refreshAll);

// Auth prompts
Expand Down Expand Up @@ -169,6 +172,16 @@
quickConnectEl.select();
}

function showNewMenu(anchorBtn) {
const rect = anchorBtn.getBoundingClientRect();
const fakeEvent = { clientX: rect.left, clientY: rect.bottom + 4 };
showContextMenu(fakeEvent, [
{ label: 'New Connection', action: () => showConnectionForm() },
{ label: 'New Folder', action: () => showAddFolderDialog() },
{ label: 'New Tunnel', action: () => { if (window.tunnelManager) window.tunnelManager.show(); } },
]);
}

function handleGlobalKeydown(e) {
// Keyboard shortcuts are now handled via native menu accelerators.
// The menu emits events which are caught in the menu-action listener.
Expand Down Expand Up @@ -530,8 +543,7 @@
const headerRow = document.createElement('div');
headerRow.className = 'ssh-tunnels-header';
headerRow.innerHTML =
`<span class="ssh-section-header-inline">SSH Sessions</span>` +
`<button class="ssh-icon-btn ssh-icon-btn-sm" id="ssh-add-server-inline" title="New Connection">+</button>`;
`<span class="ssh-section-header-inline">SSH Sessions</span>`;
frag.appendChild(headerRow);
}

Expand All @@ -554,12 +566,6 @@

serverListEl.innerHTML = '';
serverListEl.appendChild(frag);

// Wire the inline add button if present.
const addBtn = serverListEl.querySelector('#ssh-add-server-inline');
if (addBtn) {
addBtn.addEventListener('click', () => showConnectionForm());
}
}

function makeSectionHeader(text) {
Expand Down Expand Up @@ -675,8 +681,7 @@
const headerRow = document.createElement('div');
headerRow.className = 'ssh-tunnels-header';
headerRow.innerHTML =
`<span class="ssh-section-header-inline">Tunnels</span>` +
`<button class="ssh-icon-btn ssh-icon-btn-sm" id="ssh-add-tunnel" title="New Tunnel">+</button>`;
`<span class="ssh-section-header-inline">Tunnels</span>`;
frag.appendChild(headerRow);

for (const t of tunnels) {
Expand All @@ -691,11 +696,6 @@
}

tunnelsSectionEl.appendChild(frag);

// Wire add button
tunnelsSectionEl.querySelector('#ssh-add-tunnel').addEventListener('click', () => {
if (window.tunnelManager) window.tunnelManager.show();
});
}

function createTunnelNode(tunnel) {
Expand All @@ -713,13 +713,16 @@
}

const isConnected = status === 'active' || status === 'connecting';
const btnLabel = isConnected ? 'Disconnect' : 'Connect';
const btnIcon = isConnected
? '<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor" style="vertical-align:-2px"><path d="M 2 2 v 12 h 12 v -12 z"/></svg>'
: '<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor" style="vertical-align:-2px"><path d="M 3 2 v 12 l 11 -6 z"/></svg>';
const btnTitle = isConnected ? 'Disconnect' : 'Connect';

el.innerHTML =
`<span class="tunnel-dot ${dotClass}"></span>` +
`<span class="ssh-tunnel-label">${esc(tunnel.label)}</span>` +
(errorMsg ? `<button class="ssh-tunnel-btn ssh-tunnel-edit-btn">Edit</button>` : '') +
`<button class="ssh-tunnel-btn">${btnLabel}</button>`;
`<button class="ssh-tunnel-btn" title="${btnTitle}">${errorMsg ? 'Error' : btnIcon}</button>`;

if (errorMsg) {
el.title = 'Error: ' + errorMsg;
Expand Down
8 changes: 4 additions & 4 deletions crates/conch_tauri/frontend/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
const toast = document.createElement('div');
toast.className = 'conch-toast conch-toast-' + level;

const icon = level === 'success' ? '\u2713'
: level === 'error' ? '\u2717'
: level === 'warn' ? '\u26A0'
: '\u2139';
const icon = level === 'success' ? '<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="m 7.877 1.002 c -1.345 0.027 -2.695 0.446 -3.883 1.277 -3.167 2.217 -3.932 6.56 -1.715 9.727 2.217 3.167 6.558 3.932 9.725 1.715 2.277 -1.595 3.312 -4.282 2.891 -6.854 -0.098 -0.601 -0.285 -1.16 -0.527 -1.701 l -6.352 7.258 -0.688 0.813 -0.781 -0.75 -3 -3 c -0.376 -0.376 -0.376 -1.061 0 -1.438 0.376 -0.376 1.061 -0.376 1.438 0 l 2.25 2.25 6.023 -6.893 c -1.077 -1.241 -2.509 -2.03 -4.043 -2.301 -0.441 -0.078 -0.889 -0.112 -1.338 -0.104 z"/></svg>'
: level === 'error' ? '<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="m 8 1 c -3.866 0 -7 3.134 -7 7 0 3.866 3.134 7 7 7 3.866 0 7 -3.134 7 -7 0 -3.866 -3.134 -7 -7 -7 z m -1 2 h 2 V 9 h -2 z m 0 8 h 2 v 2 h -2 z"/></svg>'
: level === 'warn' ? '<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="m 7.955 0.667 c -0.343 0.015 -0.654 0.206 -0.824 0.504 l -7 12.338 c -0.379 0.667 0.103 1.494 0.869 1.494 h 14 c 0.767 0 1.248 -0.828 0.869 -1.494 l -7 -12.338 c -0.186 -0.326 -0.539 -0.521 -0.914 -0.504 z M 7 4 h 2 v 6 H 7 z m 0 7 h 2 v 2 H 7 z"/></svg>'
: '<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="m 8 1 c 0.552 0 1 0.448 1 1 0 0.033 -0.002 0.067 -0.006 0.1 2.29 0.459 4.006 2.471 4.006 4.9 l 0 2 v 2.5 l 2 2 v 0.5 H 13 3 1 v -0.5 l 2 -2 0 -4.5 c 0 -2.429 1.716 -4.442 4.006 -4.9 C 7.002 2.067 7 2.033 7 2 c 0 -0.552 0.448 -1 1 -1 z M 9.729 15 c -0.357 0.618 -1.015 0.999 -1.729 1 -0.714 -0.001 -1.373 -0.382 -1.73 -1 z"/></svg>';

toast.innerHTML = `
<div class="conch-toast-header">
Expand Down
2 changes: 2 additions & 0 deletions crates/conch_tauri/src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub(crate) struct ThemeColors {
pub panel_bg: String,
pub tab_bar_bg: String,
pub tab_border: String,
pub input_bg: String,
pub active_highlight: String,
}

Expand Down Expand Up @@ -74,6 +75,7 @@ pub(crate) fn resolve_theme_colors(config: &UserConfig) -> ThemeColors {
panel_bg: darken(bg, 8),
tab_bar_bg: darken(bg, 14),
tab_border: lighten(bg, 18),
input_bg: lighten(bg, 10),
active_highlight: lighten(bg, 28),
}
}
Loading