Redo connection manager: Stacks, More options, drag & drop, WinSCP import
Folders become Stacks (connections.json v2, no v1 migration): collapsible stack-first list, open-stack-in-tabs (first reuses a pristine tab), drag connections between stacks. More... reveals a per-connection Local directory applied to the other panel when local and untouched. Import reads a WinSCP.ini export incl. deobfuscated passwords. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+8
-8
@@ -11,21 +11,21 @@ import type { ConnectionStore } from "./store/connections";
|
||||
export async function applyApplicationMenu(store: ConnectionStore): Promise<void> {
|
||||
if (process.platform !== "darwin") return;
|
||||
|
||||
const { folders, connections } = await store.load();
|
||||
const { stacks, connections } = await store.load();
|
||||
const item = (c: SavedConnection): ApplicationMenuItemConfig => ({
|
||||
label: c.name,
|
||||
action: `connect:${c.id}`,
|
||||
});
|
||||
const rootItems = connections.filter((c) => !c.folderId).map(item);
|
||||
const folderMenus: ApplicationMenuItemConfig[] = folders.map((folder) => ({
|
||||
label: folder.name,
|
||||
submenu: connections.filter((c) => c.folderId === folder.id).map(item),
|
||||
const looseItems = connections.filter((c) => !c.stackId).map(item);
|
||||
const stackMenus: ApplicationMenuItemConfig[] = stacks.map((stack) => ({
|
||||
label: stack.name,
|
||||
submenu: connections.filter((c) => c.stackId === stack.id).map(item),
|
||||
}));
|
||||
|
||||
const connectSubmenu: ApplicationMenuItemConfig[] = [
|
||||
...rootItems,
|
||||
...folderMenus,
|
||||
...(rootItems.length || folderMenus.length ? [{ type: "separator" } as const] : []),
|
||||
...looseItems,
|
||||
...stackMenus,
|
||||
...(looseItems.length || stackMenus.length ? [{ type: "separator" } as const] : []),
|
||||
{ label: "Connection Manager…", action: "manage-connections" },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user