Files
Netcatty/domain/sftpListDensity.ts
T
bincxz 25b79a6947 feat(sftp): tighten bookmarks, compact list, dual-pane entry, and folder scans
Address the SFTP UX list in #3240: wider bookmark management with
confirm/reorder/rename, a compact file-list density, a host-list shortcut
into the existing local/remote dual pane, faster local folder discovery,
and higher small-file upload concurrency.

Tree view already supports double-click to enter directories, so that
item is left as-is.
2026-09-02 14:26:14 +08:00

28 lines
1009 B
TypeScript

export const SFTP_LIST_DENSITIES = ["comfortable", "compact"] as const;
export type SftpListDensity = (typeof SFTP_LIST_DENSITIES)[number];
export const DEFAULT_SFTP_LIST_DENSITY: SftpListDensity = "comfortable";
export function parseSftpListDensity(value: unknown): SftpListDensity {
return value === "compact" ? "compact" : DEFAULT_SFTP_LIST_DENSITY;
}
export function getNextSftpListDensity(density: SftpListDensity): SftpListDensity {
return density === "compact" ? "comfortable" : "compact";
}
export function getSftpListDensityToggleLabelKey(density: SftpListDensity): string {
return density === "compact"
? "sftp.listDensity.switchToComfortable"
: "sftp.listDensity.switchToCompact";
}
export function sftpFileRowDensityClass(density: SftpListDensity): string {
return density === "compact" ? "px-3 py-0.5 text-xs" : "px-4 py-2 text-sm";
}
export function sftpFileRowIconDensityClass(density: SftpListDensity): string {
return density === "compact" ? "h-5 w-5" : "h-7 w-7";
}