Commit Graph

47 Commits

Author SHA1 Message Date
Christian Visintin
a252caa66b refactor: FileTransferActivity pane-agnostic dispatch (#386)
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.
2026-02-27 21:58:31 +01:00
Christian Visintin
f4156a5059 feat: Import bookmarks from ssh config with a CLI command (#364)
Some checks failed
Linux / build (push) Has been cancelled
MacOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
* feat: Import bookmarks from ssh config with a CLI command

Use import-ssh-hosts to import all the possible hosts by the configured ssh config or the default one on your machine

closes #331
2025-11-08 15:32:52 +01:00
veeso
368570592f feat(cli): added --wno-keyring flag to disable keyring
Some checks are pending
Linux / build (push) Waiting to run
MacOS / build (push) Waiting to run
Windows / build (push) Waiting to run
closes #308
2025-03-22 13:44:02 +01:00
veeso
806793421e fix(bookmarks): Local directory path is not switching to what's specified in the bookmark
closes #316
2025-03-22 13:25:29 +01:00
veeso
cdf303a847 fix: fixed a crash when the local directory specified in the auth form does not exist
fix #319
2025-03-15 16:46:57 +01:00
veeso
b0f314837e build(deps): updated dependencies and edition to 2024 2025-03-15 14:15:45 +01:00
Christian Visintin
aab266a661 285 feature request multi host (#293) 2024-10-07 16:27:45 +02:00
Christian Visintin
ca005cbecd save local file paths in bookmark (#204)
* fix: renamed Bookmark 'directory' to 'remote_path' (keep name in file)

* feat: local_path as file transfer parameter and in bookmark
2023-07-06 16:05:22 +02:00
Christian Visintin
044f2436f8 Don't prompt for password if a ssh key is set for that host (#186)
* feat: don't ask password if a ssh key is set for that host

* fix: User from ssh config was not used as it should

* fix: forgot a file
2023-05-13 16:09:37 +02:00
veeso
c5eeae74b7 fmt 2023-05-09 15:40:21 +02:00
Christian Visintin
9009002b6e debug log belongs in cache directory not config directory (#179)
* log files are now written to cache dir instead of config dir

* lint

* fmt
2023-05-09 15:32:42 +02:00
veeso
4d5f3a6b63 lint 2023-02-11 12:23:56 +01:00
veeso
0057a657d2 removed license headers 2022-06-09 14:28:02 +02:00
Christian Visintin
e0d8b80cdf Bookmark name as hostname for cli args (#111)
bookmark name as hostname for cli args
2022-05-03 11:54:48 +02:00
veeso
ced7573241 symlink command 2022-01-06 10:44:34 +01:00
veeso
027545f14c Removed docs headers 2022-01-06 10:44:34 +01:00
veeso
df7a4381c4 Removed filetransfer module; migrated to remotefs crate 2022-01-06 10:44:34 +01:00
veeso
54b5583d1a Migrated termscp to tui-realm 1.x 2022-01-06 10:44:34 +01:00
veeso
764cca73d1 linter 2021-08-10 22:27:20 +02:00
veeso
f36bb65b45 Removed redundant remoteOpts struct; use FileTransferParams only 2021-07-23 14:31:29 +02:00
veeso
37abe596c7 context getters 2021-07-08 15:43:23 +02:00
veeso
e6b44e1461 ConfigClient is an option no more; config client degraded mode 2021-07-08 15:07:24 +02:00
veeso
0a7e29d92f Theme provider and '-t' and '-c' CLI options 2021-07-07 12:54:30 +02:00
veeso
7f9d92cbe9 Working on logging 2021-05-16 15:09:17 +02:00
veeso
300256b196 Changed activity paths 2021-05-08 19:28:47 +02:00
veeso
a5fe62e502 Localhost in activity; no more in Context 2021-05-06 22:16:38 +02:00
veeso
3dbe024029 Fixed warnings 2021-03-27 11:41:47 +01:00
veeso
1ad75adf87 License changed to MIT 2021-03-26 22:25:10 +01:00
veeso
f0d87ff8c4 will_umount method in Activity 2021-03-21 17:16:52 +01:00
veeso
30c2aa144b FileTransferParams as member of Context 2021-03-21 16:38:11 +01:00
ChristianVisintin
56d705e253 Config client shared in the context 2021-03-08 12:01:40 +01:00
veeso
4ff7fc079c Added CLI options to set starting working directory on both local and remote hosts 2021-02-25 14:27:34 +01:00
ChristianVisintin
23ca2baa8c Cargo clippy 2021-01-16 18:02:12 +01:00
ChristianVisintin
76fdd9864c Fixed copyright header 2021-01-16 15:13:58 +01:00
veeso
2bd3d33ff6 Updated copyright 2021-01-09 20:45:06 +01:00
ChristianVisintin
e354d17c70 SetupActivity logic 2020-12-25 16:41:49 +01:00
ChristianVisintin
562a1b3ae8 Clippy optimizations 2020-12-16 16:35:11 +01:00
ChristianVisintin
55bda874f0 Optimized code and performance using clippy 2020-12-12 12:14:51 +01:00
ChristianVisintin
357c0c9189 Fixed mouse captures issue with the terminal 2020-12-06 10:55:15 +01:00
ChristianVisintin
a328a4f751 Added to FileTransferProtocol bool secure flag to Ftp 2020-12-03 08:16:07 +01:00
ChristianVisintin
ca797558d7 Allow FTPS/FTP; added secure param 2020-12-01 16:41:15 +01:00
ChristianVisintin
7e085096c8 Context as Activity member; on_destroy context is released 2020-11-29 11:33:59 +01:00
ChristianVisintin
39bd881468 Deleted ScpProtocol; use FileTransferProtocol 2020-11-24 22:33:35 +01:00
ChristianVisintin
d871497a49 Working on main activity (FileTransferActivity) 2020-11-24 22:05:11 +01:00
ChristianVisintin
1f217f7806 Auth activity input fields 2020-11-24 15:13:36 +01:00
ChristianVisintin
18db7f0305 enable/disable raw mode 2020-11-23 16:59:30 +01:00
ChristianVisintin
d692cdf28d Too many things to do here... working on activity manager 2020-11-22 15:32:44 +01:00