mirror of
https://github.com/veeso/termscp.git
synced 2026-04-01 07:42:17 -07:00
Comprehensive design for incremental refactoring of the 13k-line FileTransferActivity god-struct using a unified Pane abstraction. Detailed step-by-step plan covering 6 phases: split monoliths, error handling, Pane struct, action dedup, session split, view reorg. Extract 26 popup components from the monolithic 1,868-line popups.rs into 20 individual files under popups/. Each file contains one or two related components with their own imports. The popups.rs module file now contains only module declarations and re-exports. Replace 8 panic!() calls with error!() logging and early returns/fallthrough. These panics documented invariants (e.g. "this tab can't do X") but would crash the app if somehow triggered. Error logging is safer and more resilient. Replace raw FileExplorer fields in Browser with Pane structs that bundle the explorer and connected state. Move host_bridge_connected and remote_connected from FileTransferActivity into the panes. Add navigation API (fs_pane, opposite_pane, is_find_tab) for future unification tasks. Rename private get_selected_file to get_selected_file_by_id and add three new unified methods (get_selected_entries, get_selected_file, is_selected_one) that dispatch based on self.browser.tab(). Old per-tab methods are kept for now until their callers are migrated in subsequent tasks. Collapse _local_/_remote_ action method pairs (mkdir, delete, symlink, chmod, rename, copy) into unified methods that branch internally on is_local_tab(). This halves the number of action methods and simplifies the update.rs dispatch logic. Also unifies ShowFileInfoPopup and ShowChmodPopup dispatching to use get_selected_entries(). Move `host_bridge` and `client` filesystem fields from FileTransferActivity into the Pane struct, enabling tab-agnostic dispatch via `fs_pane()`/ `fs_pane_mut()`. This eliminates most `is_local_tab()` branching across 15+ action files. Key changes: - Add `fs: Box<dyn HostBridge>` to Pane, remove from FileTransferActivity - Replace per-side method pairs with unified pane-dispatched methods - Unify navigation (changedir, reload, scan, file_exists, has_file_changed) - Replace 147-line popup if/else chain with data-driven priority table - Replace assert!/panic!/unreachable! with proper error handling - Fix typo "filetransfer_activiy" across ~29 files - Add unit tests for Pane Net result: -473 lines, single code path for most file operations.
125 lines
2.9 KiB
TOML
125 lines
2.9 KiB
TOML
[package]
|
|
authors = ["Christian Visintin <christian.visintin@veeso.dev>"]
|
|
categories = ["command-line-utilities"]
|
|
description = "termscp is a feature rich terminal file transfer and explorer with support for SCP/SFTP/FTP/Kube/S3/WebDAV"
|
|
edition = "2024"
|
|
homepage = "https://termscp.veeso.dev"
|
|
include = ["src/**/*", "build.rs", "LICENSE", "README.md", "CHANGELOG.md"]
|
|
keywords = ["terminal", "ftp", "scp", "sftp", "tui"]
|
|
license = "MIT"
|
|
name = "termscp"
|
|
readme = "README.md"
|
|
repository = "https://github.com/veeso/termscp"
|
|
version = "0.19.1"
|
|
rust-version = "1.89.0"
|
|
|
|
[package.metadata.rpm]
|
|
package = "termscp"
|
|
|
|
[package.metadata.rpm.cargo]
|
|
buildflags = ["--release"]
|
|
|
|
[package.metadata.rpm.targets]
|
|
termscp = { path = "/usr/bin/termscp" }
|
|
|
|
[package.metadata.deb]
|
|
maintainer = "Christian Visintin <christian.visintin@veeso.dev>"
|
|
copyright = "2025, Christian Visintin <christian.visintin@veeso.dev>"
|
|
extended-description-file = "docs/misc/README.deb.txt"
|
|
|
|
[[bin]]
|
|
name = "termscp"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
argh = "^0.1"
|
|
bitflags = "^2"
|
|
bytesize = "^2"
|
|
chrono = "^0.4"
|
|
content_inspector = "^0.2"
|
|
dirs = "^6"
|
|
edit = "^0.1"
|
|
filetime = "^0.2"
|
|
hostname = "^0.4"
|
|
keyring = { version = "^3", features = [
|
|
"apple-native",
|
|
"windows-native",
|
|
"sync-secret-service",
|
|
"vendored",
|
|
] }
|
|
lazy-regex = "^3"
|
|
lazy_static = "^1"
|
|
log = "^0.4"
|
|
magic-crypt = "4"
|
|
notify = "8"
|
|
notify-rust = { version = "^4", default-features = false, features = ["d"] }
|
|
nucleo = "0.5"
|
|
open = "5"
|
|
rand = "0.10"
|
|
regex = "^1"
|
|
remotefs = "^0.3"
|
|
remotefs-aws-s3 = "0.4"
|
|
remotefs-kube = "0.4"
|
|
remotefs-smb = { version = "^0.3", optional = true }
|
|
remotefs-webdav = "^0.2"
|
|
rpassword = "^7"
|
|
self_update = { version = "^0.42", default-features = false, features = [
|
|
"rustls",
|
|
"archive-tar",
|
|
"archive-zip",
|
|
"compression-flate2",
|
|
"compression-zip-deflate",
|
|
] }
|
|
serde = { version = "^1", features = ["derive"] }
|
|
shellexpand = "3"
|
|
simplelog = "^0.12"
|
|
ssh2-config = "^0.7"
|
|
tempfile = "3"
|
|
thiserror = "2"
|
|
tokio = { version = "1", features = ["rt"] }
|
|
toml = "1"
|
|
tui-realm-stdlib = "3"
|
|
tuirealm = "3"
|
|
tui-term = "0.2"
|
|
unicode-width = "0.2"
|
|
version-compare = "^0.2"
|
|
whoami = "2"
|
|
wildmatch = "2"
|
|
|
|
[target."cfg(target_family = \"unix\")".dependencies]
|
|
remotefs-ftp = { version = "^0.4", features = [
|
|
"native-tls-vendored",
|
|
"native-tls",
|
|
] }
|
|
remotefs-ssh = { version = "^0.7", default-features = false, features = [
|
|
"find",
|
|
"libssh-vendored",
|
|
] }
|
|
uzers = "0.12"
|
|
|
|
[target."cfg(target_family = \"windows\")".dependencies]
|
|
remotefs-ftp = { version = "^0.4", features = ["native-tls"] }
|
|
remotefs-ssh = { version = "^0.7" }
|
|
|
|
[dev-dependencies]
|
|
pretty_assertions = "^1"
|
|
serial_test = "^3"
|
|
|
|
[build-dependencies]
|
|
cfg_aliases = "0.2"
|
|
vergen-git2 = { version = "9", features = ["build", "cargo", "rustc", "si"] }
|
|
|
|
[features]
|
|
default = ["smb", "keyring"]
|
|
github-actions = []
|
|
isolated-tests = []
|
|
keyring = []
|
|
smb = ["dep:remotefs-smb"]
|
|
smb-vendored = ["remotefs-smb/vendored"]
|
|
|
|
[profile.dev]
|
|
incremental = true
|
|
|
|
[profile.release]
|
|
strip = true
|