mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-24 17:32:18 +00:00
285fcd55a94de9034ace3d921e204505fab8def0
12
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
84423a0096 | fix: resolve TypeScript errors and optimize User Skills with async IO | ||
|
|
cca4a3a37e |
fix: clear other selections on file interaction, not tab switch
Move selection clearing from tab switch and pane focus handlers into toggleSelection/rangeSelect. This means: - Switching tabs just to look around preserves all selections - Actually clicking/selecting files clears other tabs' selections Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
e3b882bdf9 |
feat(sftp): add tree view explorer for SFTP pane (#547)
* feat(sftp): add onListDirectory to SftpPaneCallbacks interface Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * feat(sftp): implement onListDirectory in left and right callbacks * feat(sftp): add tree view i18n keys * feat(sftp): add list/tree view mode toggle to toolbar * feat(sftp): add viewMode state and tree view conditional rendering to SftpPaneView * feat(sftp): implement SftpPaneTreeView with lazy loading and context menu Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(sftp): resolve lint errors in tree view implementation Rename inner `t` and `ts` variables in onListDirectory callbacks to `toSize`/`toTs`/`ms` to avoid shadowing the outer `t` translation param. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * fix(sftp): resolve post-merge lint errors - Remove duplicate sftp.context.copyPath i18n key (upstream added it too) - Remove unused AlertCircle import from SftpPaneFileList (upstream removed usage) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * perf(sftp): optimize SftpPaneTreeView render pipeline Split useMemo into two stages so selection changes no longer rebuild the full node descriptor array. Extract stable selection-aware callbacks (drag, copy, delete) via refs so TreeNode React.memo can reliably bail out. Remove unused props (onNavigateTo, draggedFiles), move NodeDescriptor type to module scope, and fix selectedFiles undefined bug in context menu. * feat(sftp): add path-aware rename and delete for tree view Wire renameFileAtPath and deleteFilesAtPath through the full callback stack so tree view context menu actions operate on full paths instead of basenames. Update useSftpPaneDialogs to accept entryPath in openRenameDialog and resolve parent dir in handleDelete, keeping list view behaviour unchanged. * fix: harden SFTP tree view actions and selection * fix: support tree selection shortcuts and nested create targets * fix: keep SFTP tree view sorting in sync * Improve SFTP tree view interactions and refresh behavior * Optimize SFTP tree refresh and pane state usage * Reduce remaining SFTP tree performance overhead * Fix nested SFTP drop target routing * Restore keyboard access to parent tree entry * Revert "Display approved AI commands in terminal sessions before their output. (#546)" This reverts commit |
||
|
|
834a677cfe |
chore: remove debug console.log and unused exports (#445)
* chore: remove 65 debug console.log statements from production code Remove bracketed debug traces ([SFTP navigateTo], [SFTPBackend], [ManagedSourceSync], [AutoSync], [CloudSync], [Settings], etc.) across 16 files. These were development logging that shipped to production, creating noise in the console. Also clean up dead variables left behind after log removal (hotkeyDebug, results, verification reads). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove 43 unused exports and dead type definitions Remove export keywords from symbols that are never imported outside their defining file. Symbols still used internally keep their definitions; symbols not used at all are removed entirely. Removed entirely: TerminalLine, SessionLogsSettings, KDFParams, SyncManagerConfig, GoogleTokenResponse, OneDriveTokenResponse, getSyncStatusColor, resolveHostTerminalAppearance, TerminalAppearanceDefaults. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
f5b745ec63 |
fix: resolve SFTP tab connection key race in workspace mode (#443)
* fix: resolve SFTP tab connection key race condition in workspace mode When rapidly switching focus between workspace panes, the single pendingConnectionKeyRef could be overwritten before the tracking effect mapped it to the created tab. This left tabs unmapped in tabConnectionKeyMapRef, causing duplicate tabs on subsequent switches. Replace the two-step async mechanism (pendingConnectionKeyRef + deferred tracking effect) with a synchronous onTabCreated callback on connect(). The callback fires immediately after the tab ID is determined, before any async SSH work begins, eliminating the race window entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: scope SFTP transfers to active connection and prevent stale session lookups Two fixes for workspace focus-switching issues: 1. Transfer queue now filters by the active connection's host, so switching focus between workspace panes only shows transfers relevant to the currently displayed SFTP tab. 2. Move sftpSessionsRef.delete() before the async closeSftp() call to close the race window where concurrent code could look up a stale sftpId that the backend has already removed, causing "SFTP session not found" errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: allow SFTP focus switching during file transfers Active transfers should not block workspace focus-following. Transfers run on their own sftpId independent of the active tab, and forceNewTab preserves old connections, so switching focus is safe. Only interactive operations (text editor, permissions dialog, file opener, file watches) still block host switching. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: refresh correct SFTP tab after transfer completes during focus switch When a transfer completes while focus has switched to a different host, refresh was targeting the currently active pane instead of the pane that initiated the transfer. Add optional tabId parameter to navigateTo() and refresh() so callers can target a specific tab. Capture the tab ID at transfer start and use it for the post-transfer refresh, ensuring the correct tab's file list is updated regardless of which tab is currently focused. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: auto-reconnect SFTP when session is lost during navigation When navigateTo() detected a missing or expired SFTP session, it cleared the connection to null, showing the empty "Select a host" state. Now it delegates to handleSessionError(), which triggers the existing reconnection mechanism — keeping files visible while reconnecting in the background. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * perf: eliminate redundant stat calls before file transfers Before this change, each file transfer performed 3-4 stat calls over the network before the progress bar started moving: 1. startTransfer: stat to get file size (~100ms) 2. processTransfer: stat again if size was 0 (~100ms) 3. Conflict check: stat source file for mtime (~100ms) 4. Backend: stat again if totalBytes missing (~100ms) Now: - Use the source pane's cached file list for size and mtime (zero network cost) instead of stat calls in startTransfer - Store sourceLastModified on TransferTask so the conflict check can use it directly instead of a redundant source stat - Backend already skips stat when totalBytes is provided This saves ~200-300ms of network round-trips per file before the progress bar starts moving. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * perf: show immediate progress feedback during transfer setup The progress bar previously stayed at 0% for ~500ms-1s while the backend acquired an isolated SFTP channel and waited for the first data chunk. Users perceived this as the transfer being "sluggish". Now start simulated progress immediately for all single-file transfers (not just non-streaming ones). When the first real progress update arrives from the backend, the simulation is stopped and real progress takes over seamlessly. This gives instant visual feedback that the transfer is in progress. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: show accurate transfer progress instead of simulated values The progress system had fundamental issues: 1. Simulated progress ran for ALL transfers including streaming ones, creating fake progress that could reach 95% while real progress was at 60%. The Math.max ratchet prevented regression, so users saw inflated numbers. 2. Speed and remaining time were based on simulated data during the setup phase, giving misleading estimates. Changes: - Only use simulated progress for non-streaming transfers (no real progress callback available). Streaming transfers get real data. - Remove the double ratchet (Math.max) from onProgress — the backend already enforces monotonic progress, so the frontend should trust the reported values directly. - Show an indeterminate "preparing..." state during the setup phase (channel acquisition, conflict check) instead of fake progress. This honestly communicates that the transfer is starting. - Hide speed and remaining time during the indeterminate phase since no real data is available yet. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: remove dead progress simulation and non-streaming transfer code startStreamTransfer is always available in Electron, so: - Remove the non-streaming fallback path in transferFile() that read entire files into memory with no progress reporting - Remove startProgressSimulation / stopProgressSimulation and all related refs (progressIntervalsRef, useSimulatedProgress, hasStreamingTransfer) - Remove the cleanup effect for progress intervals All transfers now use the streaming path with real backend-reported progress. The indeterminate "preparing..." state covers the setup phase until the first real progress arrives. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * perf: reduce SFTP transfer concurrency from 64 to 4 64 parallel SFTP read/write requests overwhelmed servers, causing the first chunk response to be delayed by 46+ seconds. Reducing to 4 concurrent requests provides a responsive first progress update (~1-2s) while still offering significant speedup over sequential streaming. Also adds timing logs to the transfer pipeline (processTransfer, transferFile, downloadFile, uploadFile) to aid future diagnostics. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address review findings from PR #443 Critical fixes: - Fix refresh/navigateTo type signatures to include the tabId option parameter — previously it was silently ignored, making tab-targeted refresh non-functional - Fix handleSessionError/reconnection in navigateTo for background tabs: when called with explicit tabId, update that specific tab instead of the active tab (which could be a different host) - Fix uploadExternalFiles to capture and pass tabId for post-upload refresh (was missing, only uploadExternalEntries was fixed) Medium fixes: - Restore Math.max monotonic ratchet on single-file onProgress to guard against any non-monotonic backend values - Add stat fallback in processTransfer to populate sourceLastModified when file is not in the pane's visible file list (filtered/search) - Adjust TRANSFER_CONCURRENCY from 4 to 8 as a better throughput/ responsiveness balance Cleanup: - Remove all debug timing logs (console.log with Transfer/downloadFile/ uploadFile prefixes) from both frontend and backend Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: prevent background tab navigation from rolling back active tab Two P1 fixes from automated review: 1. navSeqRef race: navigateTo uses a per-side sequence counter, so a background tab refresh would bump it and cause the active tab's concurrent navigation to think it was superseded, restoring previousPath instead of applying the fetched files. Now when navSeqRef is superseded but tabNavSeqRef still matches, the fetched result is applied (it's valid for this tab — only a different tab bumped the counter). 2. Auto-follow tear down: needsNewTab only checked hostId, so same host with different session-time overrides (port/protocol) would reuse the tab and close the old SFTP session, aborting any in-flight transfer. Now needsNewTab is true whenever the current connection is alive, always preserving it with forceNewTab. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
c542520dee |
feat: SFTP sidebar polish - workspace caching, toolbar overflow, terminal cwd navigation
## Summary - Add SFTP side panel with workspace-level connection caching for instant switching between terminal endpoints - Responsive toolbar with overflow menu that collapses action buttons when panel is narrow, prioritizing breadcrumb path display - Silent terminal CWD detection via separate SSH exec channel (no visible commands in terminal) - Extract SftpTransferQueue as reusable component with i18n support - Remove passphrase from port forwarding credentials (decrypted at load time) - Add compressed upload support to uploadEntriesDirect - Fix various eslint warnings and code quality issues Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
77fd7a42a8 |
fix(sftp): drag-upload goes to wrong directory after navigation (#311)
* fix(sftp): update currentPath immediately on navigation to prevent stale upload target When navigating directories without a cache hit, currentPath was only updated after the async file listing completed. If a drag-and-drop upload occurred during or shortly after this window, getActivePane would return the old currentPath, causing files to upload to the previous directory. Now currentPath is updated immediately when loading begins, ensuring upload operations always target the correct directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): revert currentPath to previous value when navigation fails Address review feedback: if the directory listing throws a non-session error, restore currentPath to its previous value so later operations (e.g. uploads) don't target a path that was never successfully loaded. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): clear files when entering loading state to prevent stale interactions Address P1 review: the loading overlay is pointer-events-none, so users could still interact with old files during navigation. Since currentPath is now updated immediately, actions like delete/rename would resolve against the new path but display old files. Clear files and selection when loading begins to eliminate this inconsistency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): restore previous files when reverting path on navigation error Address P2 review: since files are now cleared when loading begins, a failed navigation would leave the pane with the old path but an empty file list. Save and restore the previous files alongside the previous path in the error handler. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): restore selected files when reverting on navigation error Address P2 review: save and restore selectedFiles alongside path and files in the error handler so users don't lose their selection when a navigation attempt fails. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): restore tab state when navigation is superseded by another request Address P1 review: navSeqRef is tracked per-side not per-tab, so a navigation from a different tab on the same side can invalidate this request. When the sequence check causes an early return, restore this tab's previous path, files, and selection instead of leaving it with cleared files and a stale loading state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): avoid overwriting newer navigation state when superseded When a navigation request is superseded by a newer one on the same tab (e.g., fast A→B→C), the completing request should not blindly restore its previous state, as that would overwrite the latest navigation's optimistic update. Now we check if the tab's current path still matches what this request set before restoring. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): use per-tab request ID to guard superseded navigation restores Replace the ambiguous currentPath equality check with a per-tab navigation request ID (tabNavSeqRef). The old check failed when refresh() triggered a navigation to the same path — the stale request would incorrectly match and restore previous state. The new approach tracks the latest requestId per tab, so: - Same-tab superseded navigations (including same-path refreshes) correctly skip the restore. - Cross-tab superseded navigations (different tab on the same side) correctly restore the orphaned tab's state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): track per-tab nav sequence to prevent cache-hit state overwrite When a cache-miss request (A) is pending and a cache-hit request (B) runs on the same tab, A's superseded handler could overwrite B's result because it only checked path equality. Add tabNavSeqRef to track the latest requestId per tab, so superseded requests correctly skip restore when a newer navigation (including cache hits) has already handled the tab. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: remove leftover merge conflict markers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): restore to last confirmed state instead of optimistic state When multiple navigations are in flight (A→B→C), the second navigation would snapshot the optimistic state (path=B, files=[]) as its "previous" state. If it then failed or was superseded, it would restore to an empty file list instead of the last successfully loaded directory. Introduce lastConfirmedRef to track the last known-good state per tab, updated only on successful navigation (cache hit or listing success). Restore-on-error and restore-on-supersede now always revert to this confirmed state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): guard restores against stale connection after reconnect/disconnect connect() and disconnect() reuse the same tab ID but bump navSeqRef without updating tabNavSeqRef, so a pending navigation could restore stale state from a previous host into a freshly reconnected tab. Fix by: - Capturing connectionId at navigation start and checking it in every updateTab restore callback (prev.connection?.id !== connectionId) - Storing connectionId in lastConfirmedRef and re-seeding confirmed state when the connection changes, preventing old host data from being used as the restore target Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): keep files visible during loading and re-seed confirmed state Two UI regressions fixed: 1. After a file mutation (delete/create/rename), lastConfirmedRef still held the pre-mutation snapshot. If the subsequent refresh failed, the error handler would restore stale files (e.g. resurrecting deleted items). Fix: re-seed confirmed state from the pane whenever it is settled (not loading), capturing any optimistic mutation updates. 2. Clearing files to [] on navigation start left a tab blank when superseded by another tab navigating on the same side. Fix: keep existing files visible during loading — the loading overlay already has pointer-events-none to prevent interaction. Files are replaced on success or restored from lastConfirmedRef on error/supersede. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(sftp): block interaction with stale files during directory loading The loading overlay used pointer-events-none, allowing clicks to pass through to stale file rows underneath. Since currentPath is updated immediately on navigation, interacting with old filenames during a slow load would resolve paths against the new directory. Remove pointer-events-none from the loading overlay so it properly blocks all interaction with the stale file list while loading. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: ignore .claude/ directory in eslint config The .claude/worktrees/ directory contains full repo copies from agent worktrees. ESLint was scanning these, causing 621 pre-existing errors (no-undef for Node.js globals in .cjs files) that blocked npm run dev. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
f517c85d07 |
feat: Add SFTP keyboard shortcuts for copy, paste, cut, select all, rename, delete (#180)
* Initial plan * feat: Add SFTP keyboard shortcuts support for copy, paste, cut, select all, rename, delete, refresh, and new folder operations Co-authored-by: binaricat <16399091+binaricat@users.noreply.github.com> * feat: Add keyboard shortcuts support to SFTPModal for select all, rename, delete, refresh, and new folder Co-authored-by: binaricat <16399091+binaricat@users.noreply.github.com> * fix: Address code review feedback - optimize useMemo deps and add same-pane paste notification Co-authored-by: binaricat <16399091+binaricat@users.noreply.github.com> * Fix SFTP paste source path * fix: delete sources after SFTP cut paste * Fix SFTP delete key matching * Fix cut delete after successful SFTP transfers * fix: finalize cut-paste deletes after conflicts * fix: track original names for cut transfers * Fix delete key matching for shortcuts * fix: respect visible files for sftp select all * Fix modal selection and cut cleanup * Throw on missing SFTP delete prerequisites * Fix dialog action handler memo deps --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: binaricat <16399091+binaricat@users.noreply.github.com> |
||
|
|
a4abcab019 | Merge feature/gb18030 into main | ||
|
|
ca91483d01 | Merge upstream/main | ||
|
|
dfcdcda189 |
Refactors module imports and updates hook deps
Adjusts relative import paths across the application to reflect recent changes in the project's directory structure. This primarily affects SFTP state management and modal components. Updates React hook dependency arrays for `useCallback` and `useEffect` to ensure proper memoization and re-execution, addressing `react-hooks/exhaustive-deps` linting rules. Improves type safety for translation function parameters by changing `Record<string, any>` to `Record<string, unknown>`. Adds the `ls` command to the allowed commands for the Claude AI assistant in local settings. |
||
|
|
951d1307cd |
Refactors SFTP features for improved modularity and readability
Decomposes the core SFTP state management hook and related UI components into smaller, domain-specific custom hooks and specialized sub-components. This refactoring aims to: - Break down the monolithic `useSftpState` hook into focused hooks like `useSftpConnections`, `useSftpTransfers`, and `useSftpPaneActions`. - Extract complex logic and rendering from `SFTPModal` and `SftpView` into dedicated presentational components and custom hooks. - Centralize SFTP-related types and utility functions into new `sftp/types.ts` and `sftp/utils.ts` modules. The changes enhance code organization, maintainability, and testability across the SFTP functionality. |