mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
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.
28 lines
1009 B
TypeScript
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";
|
|
}
|