Commit graph

103 commits

Author SHA1 Message Date
vrubelroman
2db51e9385 feat(vfs): define the vfs.FS contract, sentinels, PathOps and ReadOnly wrapper (2.0)
Types and interfaces from design §2.1: FS, File, FileInfo, Caps, VolumeID,
RenameMode, CreateMode, PathOps (posix and native), Location.Same, the
optional Trasher/BirthTimer/Execer interfaces and ReadOnly(fs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:21:41 +03:00
vrubelroman
0a98a75212 chore: prepare v0.2.8 (changelog, version bump)
Version in model.go, README, PKGBUILD and flake.nix (which was still at
0.2.6). Tagging/publishing is left to the maintainer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:15:39 +03:00
vrubelroman
dc3d1b77fe fix(remote): make SSHClient safe to close concurrently; refcount shared clients
- sshConn/sftpCli are immutable after Connect; Close is serialized, only
  sets an atomic closed flag and closes the clients, so concurrent calls
  get errors instead of a data race or nil dereference (N-P0-8)
- Acquire/Release user counting: panes own the client from Connect,
  mirror and remote copy/delete jobs take a reference, and leaving a host
  (goParent at root, re-mirror, exit SSH mode) releases instead of closing
  a client another pane or job still uses (N-P1-12, partial)
- ports TestCloseRace; adds a mirror-then-leave UI regression test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:14:53 +03:00
vrubelroman
fbaffb4354 fix(archive): never archive over or into a source; confirm overwrite (U-P0-1)
- CreateArchive refuses an archive path that is a source or lies inside
  one (symlinked parents resolved) and writes to a temp file renamed over
  the target only on success, so failures/cancels leave no partial file
  and keep an existing archive intact
- the UI checks the target before starting and asks before replacing an
  existing archive

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:12:35 +03:00
vrubelroman
2ba00b0ad0 fix(ui): Cyrillic text input, PgDn, and q closing layers before quitting
- Russian-layout translation applies only to command keys; mkdir, rename,
  filter and the SSH form receive the typed runes (U-P1-5)
- PgDn is bound (U-P1-6); help text no longer promises an unbound 'b'
- q with the info pane, a filter or a selection closes that layer like
  Esc and quits only from the bare browser; q no longer closes the SSH
  form while typing (U-P1-16, partial)
- smoke tests for PgDn and Cyrillic mkdir are no longer skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:10:42 +03:00
vrubelroman
6696fea67a fix(ui): caret mode no longer panics under the Ascii color profile (U-P0-3)
The background-preserving reset was built by slicing lipgloss output,
which is empty without colors (NO_COLOR, dumb terminals). It is now
derived from the active termenv profile and skipped when there are no
colors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:09:23 +03:00
vrubelroman
f57565989c fix(ui): delete moves to trash by default; n cancels yes/no dialogs (U-P0-4)
- F8 dialog defaults to the trash; permanent deletion only via D/d
- n/N closes confirm and archive-type dialogs, as their notes promise
- behavior.confirm_delete=false now works, and only skips the question
  for the trash (remote and permanent deletes still ask)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:08:24 +03:00
vrubelroman
8d6fe48536 fix(remote): never follow a symlink when deleting recursively (N-P0-3)
RemoveRecursive used Stat on the root, so deleting a remote symlink to a
directory walked into the target and deleted its contents. The root is
now examined with Lstat (links are removed with Remove), and Walk also
Lstats its root. Ports the analysts' TestRemoveRecursiveSymlinkToDir onto
the sshtest server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:07:26 +03:00
vrubelroman
2f3491c1db fix(ui): block local-path actions in SSH panes and writes into archive panes
- SSH panes: rename, Enter/open/edit/execute on files, archive and unpack
  are refused with a status message instead of acting on the local file
  with the same path (N-P0-1, N-P0-2, N-P1-15)
- copy/move/archive/unpack refuse a passive pane that is an archive
  mount (temp dir deleted on exit) or the ssh:// host list (canWriteTo;
  U-P0-2, N-P2-10); mkdir in the host list is refused too
- startProcess hook so tests can observe xdg-open launches

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:06:24 +03:00
vrubelroman
511375492a fix(ui): show status and errors in a line above the footer (U-P1-1)
m.status was set in ~200 places but never rendered. A single status line
now sits between the panels and the footer, coloured by wording (error /
warning / info); the filter bar takes the same slot instead of growing
the view past the terminal height. Local mkdir now fails on an existing
name instead of silently reporting success.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:03:53 +03:00
vrubelroman
829b1237b2 ci: gofmt/vet/race/vendor checks via Makefile; release reuses CI
- Makefile targets: build, test, race, fmt-check, vet, vendor-check, lint, ci
- ci.yml runs fmt-check, vet, vendor-check, build and race tests; also on
  rework/** branches and callable from release.yml
- gofmt the three files that were not formatted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:02:31 +03:00
vrubelroman
1f6f400276 test: add teadriver and behavioural smoke tests for the old UI
teadriver feeds keys/mouse to Update, runs returned commands concurrently
(unwrapping Batch and Sequence), feeds results back until quiet, skips
long timers, records Quit and ExecProcess requests, and renders View
without ANSI under an Ascii profile (WithProfile for others).

Smoke tests cover navigation, mkdir, copy, rename, filter and delete on
t.TempDir(); PgDn and Cyrillic input are skipped until task 1.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:01:22 +03:00
vrubelroman
ffcc8f5806 test: add fstree helper to build, snapshot and diff directory trees
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:57:11 +03:00
vrubelroman
05da3c0d30 test: add in-process SSH/SFTP server and fault proxy (internal/testutil/sshtest)
Ports the analysts' testbed into a reusable package: Start(Options{Password,
AuthorizedKeys, HostKeys, NoExec, Chroot}), NewProxy with SetDelay/Freeze/
CutAfter/KillAll, IsolatedHome, GenKeys. Exec reports exit-status and
stderr; NoExec rejects exec like ForceCommand internal-sftp. All goroutines
stop on t.Cleanup (checked via runtime.NumGoroutine).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:56:05 +03:00
vrubelroman
0ab59ad7c3 chore: bump version to v0.2.7
Some checks failed
CI / test (push) Has been cancelled
Release / release (push) Failing after 2s
Release / test (push) Successful in 9m39s
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 21:06:34 +00:00
vrubelroman
135f5e0d19 fix: harden copy/move/delete transfers, add CI, dead code cleanup
All checks were successful
CI / test (push) Successful in 10m0s
Audited every copy/move/delete path (local, remote same-host, cross-host)
and fixed:

- Shell command injection in same-host remote cp/mv (unescaped paths
  interpolated into exec strings); added remote.ShellQuote.
- Missing guard against copying/moving a directory into its own
  subdirectory, locally and on same-host remote transfers (unbounded
  recursion / disk fill). New regression tests in ops_test.go.
- Remote-to-remote same-path file copy silently truncating the source
  file via Create() before it finished being read.
- Overwrite warning ("N existing target(s)") never shown for remote
  destinations, only local ones.
- Remote same-host server-side cp never advancing the file-done counter
  (waited on -v output that was never requested).
- Removed a dead "plan-then-confirm" subsystem (5 functions, 2 message
  types, 2 unreachable Update() cases) superseded by the current design.
- Remote delete (SFTP) now runs as a cancellable job with the same
  progress modal as local delete, instead of a single blocking call.

Also add a CI workflow that runs build/vet/test on every push and PR,
since previously they only ran on release tags.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 20:36:00 +00:00
vrubelroman
c15ade247a fix: verify SSH host keys, support ssh-agent, fix remote dir walk bugs
- Replace ssh.InsecureIgnoreHostKey() with TOFU verification against
  ~/.ssh/known_hosts (accept-new for unknown hosts, hard reject on a
  changed key) to close a MITM hole on every SFTP connection.
- Actually connect to a running ssh-agent (SSH_AUTH_SOCK) for auth
  instead of only scanning default key files on disk; give a clear
  error when an explicit IdentityFile is passphrase-protected.
- Fix SSHClient.walk()/DirectorySize: the internal filepathSkipDir
  sentinel leaked out as a real error on stat/ReadDir failures instead
  of being swallowed, aborting size calculation on the first
  unreadable subdirectory instead of skipping it.
- Skip symlink-to-directory entries in remote directory copies instead
  of failing the whole transfer trying to Open() them as regular files.
- Consolidate 5 duplicated sudo-aware home-dir lookups into
  internal/homedir, adding a missing os.Geteuid()==0 check before
  trusting SUDO_USER.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 15:31:32 +00:00
vrubelroman
9c5ad363a4 feat: unified install script, RPM packaging, bump to v0.2.6 2026-05-15 09:45:24 +03:00
vrubelroman
44db42da1e fix: text-input modals (mkdir/rename/SSH) confirm only on Enter, not y 2026-05-14 01:04:26 +03:00
vrubelroman
a468e33e82 chore: bump version to v0.2.5 2026-05-13 13:40:09 +03:00
vrubelroman
fae53d6fd3 feat: remote image preview — detect via magic bytes, download to temp for overlay 2026-05-13 13:28:19 +03:00
vrubelroman
2d6ec2e445 fix: Ctrl+R refresh now properly reloads remote/archive panes via SFTP 2026-05-13 12:57:17 +03:00
vrubelroman
7128e58692 refactor: remove auto-refresh timer — panes already refresh on nav and after ops 2026-05-13 12:50:40 +03:00
vrubelroman
c598350fc5 fix: skip local PathExists check when target is remote (SFTP copy) 2026-05-13 12:43:03 +03:00
vrubelroman
7d2a2dd547 fix: broken background between Background/b and Cancel/c in progress modals 2026-05-13 01:34:00 +03:00
vrubelroman
fd2aa80894 feat: same-host SSH optimization (Exec cp/mv), per-file progress for all remote copies
- SSHClient.Exec() and ExecWithProgress() for server-side commands
- SSHHost.SameAs() and SSHClient.SameHostAs() for host comparison
- Same-host copy uses ExecWithProgress('cp -rv') with per-line progress
- Same-host move uses Exec('mv'), instant server-side rename
- CopyDirFromRemote/ToRemote/BetweenRemotes with per-file progress callbacks
- Context cancellation support for all remote copy operations
- Two-phase remote copy: count files first, then transfer with progress bar
- Fix: consistent modal colors (Enter=Accent, Cancel=CancelButton, Background=Accent)
2026-05-13 01:11:55 +03:00
vrubelroman
8352441bda perf: skip plan phases for copy/delete, remove size tracking, show file count only
- Delete: skip remoteDeletePlanCmd and trashPlanCmd, show dialog immediately
- Copy: skip copyPlanCmd and remoteCopyPlanCmd, show dialog immediately
- CopyStats: no lstat per file, count files via WalkDir only
- Copy: two-phase (count first, then copy with known total + progress bar)
- Progress: file-based ratio, remove Size/Speed display
- Stage: Counting files... → Coping files... (no empty stage)
2026-05-12 17:39:22 +03:00
vrubelroman
bd157b41b0 fix: fallback to home dir on startup, skip session save of SSH remote paths
- Use os.UserHomeDir() as fallback instead of os.Getwd()
- In saveSession(), skip saving pane path when pane is in remote mode
- In applyPaneSession(), verify directory is readable (not just exists)
2026-05-12 15:18:44 +03:00
vrubelroman
2cf198cea8 chore: bump version to v0.2.4 2026-05-04 01:37:10 +03:00
vrubelroman
cb40a1d008 fix: remote directory size calculation via SFTP Walk on Space key 2026-05-04 01:27:06 +03:00
vrubelroman
f3b2fe59c4 feat: auto-refresh directory listing, enabled by default every 5s 2026-05-04 01:07:22 +03:00
vrubelroman
a9ccff8635 fix: reset cursor on enter dir and persist full cursor memory across sessions 2026-05-04 00:36:34 +03:00
vrubelroman
d5569ecdd0 fix: reset scroll offset when preserveKey changes cursor to avoid hidden top entries on go-parent 2026-05-04 00:29:04 +03:00
vrubelroman
152d45c7af feat: persist session state (folder, cursor, active pane) on exit and restore on launch 2026-05-04 00:16:44 +03:00
vrubelroman
b31fffbce4 chore: bump version to v0.2.3 2026-04-29 16:49:43 +03:00
vrubelroman
be7addcb2a chore: bump version to v0.2.2 2026-04-29 16:47:13 +03:00
vrubelroman
c4707d9300 fix: help dialog cleanup + theme selector polish
Help dialog (F1):
- Rename title 'Keyboard and Mouse Help' → 'Keyboard Help'
- Remove entire 'Dialogs and Transfers' section
  (all keys r, a, n, x shown in footer bar)
- Remove 'o', 's', 'q' entries (shown in footer as F9/o, F12/s, F10/q)
- Update 't' from 'cycle theme' → 'select theme'

Theme selector dialog (t):
- Move navigation hint to bottom of dialog
- Color 'Enter' green / 'Esc' red via renderModalHintTokens
2026-04-29 16:26:40 +03:00
vrubelroman
92e72bc8c6 feat: theme selector dialog with live preview (t key)
Replace the simple cycleTheme() with a modal dialog that shows all
19 themes with color swatches, live preview on Up/Down navigation,
and commit/revert on Enter/Esc.

Changes:
- Add modalThemeSelect kind to modalKind enum
- Add themeSelectorState struct + field to Model
- Add openThemeSelector() replacing cycleTheme() call
- Add handleModalKey case for modalThemeSelect (Up/Down/Enter/Esc)
- Add applyThemePreview() and finalizeTheme() helper methods
- Add renderThemeSelectModal() with aligned theme names + swatches
- Update renderModal() dispatch and widen modal for theme selector
- Update help text: 't' now shows 'select theme'
2026-04-29 16:13:29 +03:00
vrubelroman
cd877ab584 feat: mirror pane (p), cursor memory, clean up help dialog
- Add Mirror pane keybinding p (for 'Pane'), SSH restored on s
- Add session-scoped cursor memory per directory
- Fix cursor memory bug: DisplayName() adds trailing / for directories
- Fix remote mirror: use active.Path instead of mount.RemotePath
- Remove F-key/Mouse/b/c entries from F1 help dialog
- Remove Mirror from ShortHelp footer (F-keys only)
- Add missing letter-key bindings to help: p, s, a, n, x
2026-04-29 16:03:34 +03:00
vrubelroman
c8d6976030 refactor: remove Edit key binding, rename ExtractArchive -> Unpack
- Remove unused Edit key binding (no keys assigned, duplicated Enter)
- Rename ExtractArchive to Unpack across KeyMap struct, DefaultKeyMap(),
  ShortHelp(), FullHelp(), and Model.Update() handler
- Rename handleExtractArchive() -> handleUnpack()
- Update help text, status messages, and dialog titles to 'unpack'
2026-04-29 15:20:53 +03:00
vrubelroman
3b9eb4afa5 fix: add cancel button support for extraction; feat: delete progress dialog
- ExtractArchiveToDir now accepts context.Context for cancellation
- extractZipArchive/extractTarArchive check ctx.Done() in extraction loops
- startExtractJob creates context with cancel (C/c now works for extraction)
- Added startDeleteJob method with per-file progress reporting
- Local delete (trash/permanent) now shows progress dialog with B/b and C/c
- renderArchiveProgressModal handles 'delete' kind (file-based progress, no speed)
- archiveDoneMsg handles 'delete' completion (reload panes, clear marks)
2026-04-29 14:12:11 +03:00
vrubelroman
42c51f0ef5 feat: add extraction progress dialog (F11/e)
- ExtractArchiveToDir now accepts progress callback for file-by-file reporting
- Added countArchiveEntries/countZipEntries/countTarEntries helpers
- Added startExtractJob method following startArchiveJob pattern
- archiveJobState now has kind field ('archive'/'extract')
- archiveDoneMsg handler reloads only passive pane for extraction
- renderArchiveProgressModal shows file-based progress for extraction (no size/speed)
- Removed old synchronous extractArchiveCmd() and opExtractArchive case in opMsg
2026-04-29 14:01:36 +03:00
vrubelroman
3229d9b263 feat: merge F8/x delete with F11 archive extraction
- Delete mode toggle ('d') inside existing confirm dialog instead of separate modal
- F11/e shows confirm dialog before extracting archive to opposite pane
- deleteKind field toggles between 'permanent' and 'trash'
- Active pane reloads after extraction so files appear immediately
2026-04-29 13:42:59 +03:00
vrubelroman
8589187a10 cursor: move up on delete, hide size/modified columns in SSH host list, parent '..' empty modified, SSH keepalive 30s 2026-04-29 13:04:47 +03:00
vrubelroman
278b90e5bd Fix log.Printf format verbs to match actual types (vet errors) 2026-04-29 11:53:35 +03:00
vrubelroman
7cd7a24642 Show F11 (permanent delete) in footer bar between F10 and F12 2026-04-29 03:16:18 +03:00
vrubelroman
1ed2d3defb SSH connection status indicators
- Add Connected bool field to vfs.Entry and RemoteMount
- Track connection status in sshState.connectedHosts
- Show status icon (connected/disconnected) in pane header when browsing remote host
- Async SSH connection test with cancel support for Add Host dialog
- Colored labels and styled help text in SSH dialogs
- Confirmation dialog when deleting manually-added SSH hosts
2026-04-29 03:11:53 +03:00
vrubelroman
df4df6b8f6 fix: file type handling on Enter - extensions checked before executable bit
- Reorder Category() to check known extensions (text, config, image,
  pdf, audio, video, archive) before the executable bit check.
  Fixes video/audio/image files with executable bit being opened in
  editor instead of system default application.
- Remove 'executable' from isEditableEntry() - executables are now
  launched via handleExecute() instead of opened in Neovim.
- Add handleExecute() method that runs executable files in the
  terminal via tea.ExecProcess.
- Update handleOpenSelected() to route: text/config -> editor,
  executable -> launch, everything else -> system default (xdg-open).
- Bump version to v0.2.1
2026-04-27 23:18:48 +03:00
vrubelroman
c0df75c57e add Cyrillic→Latin keyboard layout translation for Russian users (ЙЦУКЕН→QWERTY) 2026-04-27 20:30:11 +03:00
vrubelroman
d38945f595 remove duplicate theme aliases (gruvbox, nord-frost); add 4 new themes: one-dark, everforest, github-dark, catppuccin-macchiato 2026-04-27 20:19:43 +03:00