mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 15:41:17 +00:00
285fcd55a94de9034ace3d921e204505fab8def0
497
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
aeacd913f5 |
feat: sync global SFTP bookmarks via cloud sync (#553)
* feat: sync global SFTP bookmarks via cloud sync Global SFTP path bookmarks were stored only in localStorage and not included in the cloud sync payload, so they could not be synced across devices. Add them to the sync settings, with auto-sync detection via a custom event and in-memory snapshot rehydration on import. Local bookmarks remain device-specific by design. Closes #548 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: deduplicate global SFTP bookmarks by path during merge When the same path is bookmarked independently on two devices, each generates a different random ID. The entity-array merge preserves both, creating duplicates. Add path-based deduplication after settings merge, following the same pattern used for known hosts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: sync global bookmarks across renderer windows via storage event When cloud sync imports bookmarks in the Settings window, the main window's in-memory snapshot stays stale. Listen for cross-window storage events on the bookmark key to auto-rehydrate. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- 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 |
||
|
|
2a75f863f8 |
fix: reset cloud sync connect button when OAuth popup is closed (#544)
* fix: reset cloud sync connect button when OAuth popup is closed When users close the OAuth popup without completing authorization, the connect button was stuck in "Connecting" state indefinitely (up to 5-minute timeout). Changes: - Track OAuth popup window and poll for closure (Google, OneDrive) - Cancel OAuth callback server when popup is closed, immediately rejecting the pending promise instead of waiting for timeout - Reset provider status via disconnectProvider on auth failure so the connect button returns to clickable state - Suppress toast for user-initiated cancellation (popup closed) - Also reset GitHub provider status on device flow failure Closes #542 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use resetProviderStatus instead of disconnectProvider on auth failure disconnectProvider tears down existing connections (signOut, delete adapter, clear merge base). If a user was re-authenticating and cancelled, this would destroy their working connection. Add resetProviderStatus() that only resets the UI status to 'disconnected' without any teardown side effects. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add resetProviderStatus to CloudSyncHook interface Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove noreferrer from OAuth popup to enable window tracking noreferrer implies noopener in browser spec, causing window.open() to return null and defeating the popup closure detection entirely. Safe to remove since OAuth targets are trusted providers (Google, Microsoft) and the Referer is just a localhost URL. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: guard resetProviderStatus and cancel delayed popup on early failure - resetProviderStatus only resets if status is 'connecting', preserving already-authenticated providers when sync initialization fails - Cancel the delayed setTimeout for window.open if callbackPromise rejects before 100ms, preventing a stray popup and leaking interval Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: reset GitHub provider status when device flow modal is closed The modal onClose only hid the modal and stopped the polling flag, but the provider status stayed at 'connecting'. Now calls resetProviderStatus('github') so the button returns to clickable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
7639191c50 |
fix: preserve AI chat history across reconnects (#541)
* fix: preserve AI chat history across reconnects
* fix: retarget restored AI sessions on reconnect
* feat: format tool call results with proper line breaks
Extract stdout/stderr from structured results and unescape \n/\t
so command output displays with real line breaks like terminal output.
Supports both JSON object {stdout,stderr} and executor text formats.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: restrict unescape to stdout/stderr fields only
Plain strings may contain legitimate backslash sequences (file paths,
regex patterns) that should not be converted. Only apply unescape to
stdout/stderr fields extracted from command execution results.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address review findings for AI chat reconnect
1. Add explicit activeTerminalTargetIds guard in shouldRetargetActiveSession
to prevent retargeting sessions owned by other terminals, making the
invariant locally verifiable.
2. Only preserve orphaned terminal sessions with hostIds — workspace,
local, and serial sessions generate fresh IDs and would be permanently
unreachable, wasting MAX_STORED_SESSIONS quota.
3. Clear stale streaming state when restoring a session whose ACP handle
was already cleaned up (e.g., reconnect during mid-response), so the
user can send new messages.
4. Restore overflow-hidden on user message bubbles to prevent content
bleeding past rounded border corners.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address round 2 review findings
1. Fix streaming state clear: only clear for sessions whose targetId
doesn't match current scope (restored from different terminal),
not for built-in Catty chats that never set externalSessionId.
2. Exclude local/serial sessions from preservation: their synthetic
hostIds (local-*/serial-*) change on every open and can never be
matched back.
3. Preserve non-zero exitCode in formatted tool results so failed
commands show a visible failure signal.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: only clear streaming state during retarget, not for all restored sessions
The previous condition (targetId !== scopeTargetId) also fired for
built-in Catty sessions during normal operation, killing active streams.
Now streaming is only cleared when shouldRetargetActiveSession is true,
meaning the session came from a disconnected terminal where any
in-flight response is guaranteed to be dead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address round 3 review findings
1. Clear externalSessionId during retarget to prevent stale ACP handle
from surviving if retarget runs before orphan cleanup.
2. Only retarget in visible AI panels — hidden/background panels should
not race to claim orphaned sessions.
3. Remove unescapeTerminalOutput — data flow trace confirms real newline
characters arrive at the component. The unescape was corrupting
legitimate backslash sequences in paths and patterns.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: only ACP-cleanup deleted sessions, not preserved ones
Preserved sessions may be reused on reconnect. Running aiAcpCleanup
on them asynchronously could race with a newly started ACP conversation
on the same session ID, tearing down the fresh provider.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: abort in-flight streams during retarget and restore ACP cleanup
1. Abort the active request's AbortController when retargeting a session
with stale streaming state. Prevents late chunks from the old run
appending into the restored chat.
2. Restore ACP cleanup for all orphaned sessions (not just deleted ones).
Preserved sessions get a new externalSessionId on next use, so
cleaning the old one prevents subprocess leaks without affecting
future conversations.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: guard hidden panels from session ownership and skip null map entries
1. Only assign restored sessions in visible panels — hidden panels
should not race to own sessions via setActiveSessionId, preventing
MCP/tool calls from being bound to the wrong terminal.
2. Skip null entries in activeSessionIdMap when building
activeTerminalTargetIds — deleted chats should not block same-host
history matching on other terminals.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: guard MCP sync behind visibility and cancel exec/approvals on retarget
1. Only sync MCP session metadata from visible panels to prevent
hidden panels from overwriting the scope mapping.
2. Cancel pending approvals and in-flight exec (Catty + ACP) during
retarget, matching handleStop behavior. Prevents stale tool results
and approval prompts from reappearing after session retarget.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: restore MCP sync for hidden panels
MCP scope is keyed by chatSessionId so hidden panels don't overwrite
visible panels' mappings. The isVisible guard was breaking background
chats that need updated terminal session metadata after reconnects
or workspace changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: remove unused deletedIds variable
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
c3224d30c6 |
feat: network device mode for SSH + serial charset encoding support (#540)
* feat: add deviceType field to Host model for network device support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: pass deviceType through session metadata pipeline Thread deviceType from Host model through AITerminalSessionInfo, IPC types, and mcpServerBridge so AI agents can inspect device type per session. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: route network device SSH sessions to raw PTY execution When deviceType === 'network', handleExec now uses execViaRawPty instead of execViaPty so vendor CLIs (Huawei VRP, Cisco IOS, etc.) receive commands as-is without POSIX shell wrapping or markers. The command blocklist is also skipped for network devices, consistent with the existing serial session bypass. AI context description updated to document the raw-execution behaviour for network device sessions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add network device mode toggle to host settings UI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add network device awareness to Catty Agent system prompt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: extend network device mode to Catty Agent exec path and host context - Add network device detection and raw execution routing to aiBridge.cjs (the primary Catty Agent command path), not just the MCP bridge - Export getSessionMeta from mcpServerBridge for reuse in aiBridge - Surface deviceType in Catty Agent system prompt host list so the AI can identify which sessions are network devices - Pass deviceType through buildSystemPrompt context Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: exempt network device sessions from client-side blocklist and update ACP context - Add deviceType to ExecutorContext sessions type - Skip renderer-side command blocklist for deviceType=network sessions in shared toolExecutors.ts (not just main-process side) - Update ACP agent context hint to mention network device sessions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: only show network device mode toggle for SSH hosts Telnet and local hosts don't support the network device execution path, so hiding the toggle prevents users from enabling a broken configuration. Serial hosts already use raw mode by default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: exclude Mosh sessions from network device raw execution path Mosh uses a shell-backed PTY and cannot connect to vendor CLIs, so network device mode should only apply to SSH and serial sessions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: prefer session.protocol over metadata for Mosh detection Mosh tabs report protocol:"ssh" in renderer metadata but "mosh" in the main-process session object. Prioritize session.protocol (runtime truth) to correctly exclude Mosh from network device raw execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: suppress deviceType metadata for Mosh sessions Mosh requires a shell-backed PTY and cannot connect to vendor CLIs, so omit deviceType from AI-facing metadata when session is Mosh-backed. This prevents the AI from being told to use vendor CLI syntax when the actual execution path uses normal shell wrapping. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use exit code 0 for network device sessions and hide toggle for Mosh - Network device / serial sessions return exitCode: null from vendor CLIs. Default to 0 instead of -1 so the AI doesn't misinterpret successful commands as failures. - Hide the network device mode toggle when Mosh is enabled, since the setting is suppressed at runtime for Mosh sessions anyway. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: preserve null exit codes and restrict raw mode to SSH/serial - Preserve exitCode: null for network device sessions instead of coercing to 0, so the AI knows exit status is unavailable rather than seeing a misleading success code. - Explicitly whitelist SSH/serial protocols for network device mode instead of just excluding mosh, preventing local/telnet sessions from accidentally entering raw execution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use UTF-8 encoding for SSH network device raw execution execViaRawPty hardcodes latin1 for serial port data decoding. Add an encoding option (default: latin1) and pass utf8 from SSH network device call sites so multi-byte characters aren't corrupted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use host charset for serial port decoding instead of hardcoded latin1 - Extract charsetToNodeEncoding() to module scope in terminalBridge - Serial sessions now read options.charset (from Host.charset) for both terminal display decoding and AI command output - Store serialEncoding on session object so exec paths can use it - Pass encoding through all execViaRawPty call sites - Default encoding changed from latin1 to utf8 (matches most modern network equipment and is the safer default for CJK environments) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: move serialEncoding declaration before session object creation serialEncoding was referenced in the session object literal before its const declaration, causing a TDZ ReferenceError that would crash every serial connection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: tighten isNetworkDevice logic and clean up edge cases - Align toolExecutors isNetworkDevice check with bridge logic: require explicit SSH/serial protocol match instead of trusting deviceType alone - Remove empty-string protocol match from isSshOrSerial in both bridges to prevent local/unknown sessions from being treated as network devices - Widen exitCode return type to `number | null` to match actual behavior - Clear deviceType when enabling Mosh (incompatible combination) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: update MCP server tool descriptions for network device sessions The get_environment and terminal_execute tool descriptions only mentioned serial/raw sessions for network devices. Updated to also reference deviceType: network SSH sessions so external AI agents (Claude, Codex) know about the new execution mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: include deviceType in get_environment and guard execViaChannel fallback - Add deviceType to executeWorkspaceGetInfo session mapping and return type so Catty Agent's get_environment tool matches MCP bridge output - Guard both aiBridge and mcpServerBridge against falling through to execViaChannel for network device sessions — network devices require an interactive PTY and exec channels would produce broken behavior Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add charset setting to serial host configuration UI Serial hosts now have a charset input in the Advanced section, defaulting to UTF-8. The value is saved to Host.charset and used by the serial decoder in terminalBridge. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add charset to serial quick-connect modal with full pipeline - Add charset input to SerialConnectModal (Advanced section) - Thread charset through onConnect callback → handleConnectSerial → createSerialSession → TerminalSession.charset - Add charset field to TerminalSession interface - Include charset in fallback host builder for quick-connect sessions so createTerminalSessionStarters can pass it to startSerialSession - Saved hosts also store charset via onSaveHost Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: constrain serial connect modal height with scrollable content Modal content could overflow the viewport when Advanced section was expanded. Add max-h-[85vh] to DialogContent with flex layout so the content area scrolls while header and footer buttons stay visible. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: propagate charset through all serial session creation paths - Add charset to startSerialSession type in global.d.ts - Copy host.charset to TerminalSession in connectToHost serial path - Copy host.charset in createWorkspaceWithHosts serial path - Propagate session.charset in splitSession (both workspace and standalone) - Propagate session.charset in copySession Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: propagate charset in remaining session creation paths Add host.charset to connectToHost (non-serial), createWorkspaceWithHosts (non-serial), and runSnippet session creation for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
40d80fe535 |
perf: comprehensive UI and state management optimization (#539)
* perf: comprehensive performance optimization across UI and state management - Replace Array.find/includes with Map/Set lookups for O(1) access in hot paths - Add requestAnimationFrame throttling to all mousemove resize handlers - Remove redundant forceUpdate + useSyncExternalStore double subscription - Extract terminal search decoration config to module-level constant - Pause server stats polling and resize handlers for hidden terminals - Add timer cleanup for useEffect/useLayoutEffect with setTimeout - Use useEffectEvent to stabilize effect callbacks and reduce effect re-runs - Use useDeferredValue for QuickSwitcher search input - Batch activeTabStore notifications with microtask coalescing - Memoize sessionLogConfig and activityTrackedSessions to prevent child re-renders - Use ref pattern for stable onTerminalDataCapture callback - Skip TerminalLayer pre-warming when no sessions or workspaces exist Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: flush final resize value before canceling RAF Apply the last computed size synchronously on mouseup/cleanup before canceling the pending requestAnimationFrame. This prevents the final drag delta from being dropped when mouseup fires before the queued frame executes. Addresses review feedback from codex on all 3 RAF-throttled resize handlers: split resize, side panel resize, and SFTP column resize. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: initialize lastClientXRef on resize start to prevent click-collapse Without initialization, a click on the resize handle without dragging would use lastClientXRef=0, computing a large negative diff and collapsing the column to minimum width. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: revert useDeferredValue for QuickSwitcher search useDeferredValue can lag behind the actual input, causing quickResults to reflect a stale query when the user types fast and presses Enter. This is a correctness regression - the selected item may not match the user's intent. The host list is typically small (<200), so synchronous filtering is fast enough without deferral. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: restore runtime activity guard to prevent stale badge on tab switch The pre-filtered activityTrackedSessions reduces subscriptions for disconnected sessions, but removing the runtime shouldMarkSessionActivity check introduced a race: between tab switch and effect re-subscription, old listeners could mark the newly-focused session as unread. Restore the activeTabIdRef.current guard inside the callback as a safety net. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: defer initialConnectDoneRef flag until auto-connect executes Moving the flag inside the setTimeout callback prevents it from being set when the timer is canceled by cleanup. Previously, if the effect re-ran before the setTimeout(0) fired, the timer was cleared but the ref was already true, permanently skipping the initial local connect. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: capture resizingRef fields before setState updater Destructure field/startX/startWidth from the ref upfront so the functional updater closure never reads resizingRef.current after it may have been cleared by handleResizeEnd. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove activeTabId from activityTrackedSessions to stabilize subscriptions Depending on activeTabId caused subscriptions to tear down and recreate on every tab switch, resetting the ChunkedEscapeFilter mid-sequence and producing false unread badges. The runtime guard via activeTabIdRef already handles the active-tab check, so pre-filtering only needs to exclude disconnected sessions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: fetch server stats immediately when tab becomes visible again Use hasFetchedRef to distinguish first connect (2s delay for connection stabilization) from tab resume (immediate fetch). Prevents showing stale CPU/memory data for 2 seconds after switching back to a terminal. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: restore cold-start prewarm and reset network stats on tab resume 1. Revert shouldPrewarm guard - TerminalLayer should always prewarm after 1.2s regardless of session/workspace count, as the purpose is to hide lazy-load latency before the user opens their first terminal. 2. Reset netRxSpeed/netTxSpeed to 0 when resuming a hidden terminal tab. The backend computes network throughput as a delta from the previous sample, so the first fetch after a long hidden interval would show artificially low throughput averaged over the gap. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: reset hasFetchedRef on disconnect and preserve built-in theme precedence 1. Clear hasFetchedRef when connection drops so reconnects get the 2s stabilization delay before first stats fetch. 2. Reverse theme merge order in themeById Map so built-in themes are written last and take precedence over custom themes with duplicate IDs, matching the original find() semantics and other resolution sites (customThemeStore.getThemeById, Terminal.tsx). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: also clear per-interface network speeds on tab resume Reset rxSpeed/txSpeed on each netInterfaces entry in addition to the aggregate values, so the network hovercard doesn't show stale throughput while waiting for the first fresh poll after resume. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: reset capture ref on retry and skip warmup for established connections 1. Reset terminalDataCapturedRef in handleRetry() so log capture works for retried sessions (retry doesn't change sessionId, so the effect that resets the ref never re-runs). 2. Track connection start time to skip the 2s warmup delay when a tab becomes visible for a connection that was already established while hidden. Only apply the warmup for truly fresh connections (<2s old). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: prevent overlapping stats requests and track connection time while hidden 1. Add fetchInFlightRef guard to prevent concurrent getServerStats requests that could race and corrupt baseline CPU/network data. 2. Move connectedAtRef initialization before the isVisible check so connections that complete while the tab is hidden record their start time. This ensures the warmup delay is correctly skipped when the tab becomes visible for an already-stable connection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: reset fetchInFlightRef on disconnect to unblock reconnect stats A pending getServerStats request from a previous connection could keep fetchInFlightRef set, causing the reconnected session's initial fetch to be skipped until the old request timed out. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: clear fetchInFlightRef when tab becomes hidden Ensures the resume fetch isn't blocked by an in-flight request from the previous visible cycle. Any stale response from the old request will be quickly overwritten by the fresh immediate fetch on resume. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use generation counter to invalidate stale stats responses Replace fetchInFlightRef with a generation counter that increments on each fetch. Stale responses from before a hide/show cycle are discarded by comparing the captured generation against the current value, fully preventing pre-hide requests from overwriting zeroed network stats. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: increment fetch generation on effect setup to invalidate in-flight requests The generation was only incremented inside fetchStats, but the resume setTimeout hadn't fired yet when old responses arrived. Incrementing at effect setup time ensures any pre-hide in-flight request is immediately stale, preventing it from overwriting zeroed network stats. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
9136569809 |
feat: Add session activity indicator and store (#528)
* Add session activity indicator and store Introduce a SessionActivityStore (useSyncExternalStore) to track which tabs/workspaces have unread terminal activity. TerminalLayer now strips terminal control sequences, listens for session data, and marks tabs as active when not focused; it also clears activity on focus change and prunes stale IDs. TopTabs consumes the activity map to render a breathing activity dot on session/workspace tabs and adjusts the workspace tab layout to show the dot next to the pane count. Add CSS animation for the activity indicator. * fix: buffer incomplete escape sequences across data chunks Add ChunkedEscapeFilter to carry partial ANSI/OSC escape-sequence tails between successive data chunks, preventing false-positive activity badges from split control sequences on busy sessions. Also fix missing trailing newline in sessionActivity.ts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove 256-byte cap on pending escape sequence tails Long OSC sequences (e.g. clipboard/title payloads) can exceed 256 bytes. Removing the cap ensures they are fully buffered across chunks instead of being misclassified as printable output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: buffer OSC tails that end on bare ESC awaiting backslash OSC sequences terminated with ESC\ can split at the ESC boundary. Extend the incomplete tail regex to also match an in-progress OSC sequence ending with ESC (awaiting the closing backslash). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
de874fc8c5 |
fix: 修复双击检查更新崩溃 & 优化更新 UX (#522) (#531)
* fix: prevent double-click update crash and improve update UX (#522) - Add state guards to prevent checkForUpdates during active download - Disable "Check for Updates" button during checking/downloading/ready - Make version badge trigger in-app download instead of opening GitHub - Change error toast action from "Open Releases" to "View in Settings" - Add "Download Now" button in system settings as primary action - Keep GitHub release link as secondary fallback in settings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: reset download state when downloadUpdate() rejects Clears _isDownloading and broadcasts error status on catch so the update UI does not get stuck after a failed download attempt. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: only show Download Now after a completed update check Prevents downloadUpdate() from being called with stale cached state before electron-updater has run checkForUpdates(), avoiding a "Please check update first" error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use correct broadcast function and prime updater before download - Replace undefined broadcastUpdateStatus with broadcastToAllWindows - Call checkForUpdate before downloadUpdate to ensure electron-updater has populated update metadata Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use correct error payload field and guard unsupported platforms - Use { error: ... } instead of { message: ... } in download error broadcast to match renderer expectations - Bail out of startDownload when checkForUpdate returns unsupported or throws, instead of entering a failing download path Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: guard startDownload against in-flight and no-update check results Bail out when checkForUpdate returns checking, not-available, or unsupported states to prevent calling downloadUpdate prematurely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove duplicate error broadcast and fallback to releases on unsupported - Remove redundant broadcastToAllWindows in download catch (global error listener already handles it) - Open release page instead of silently returning when platform does not support auto-update Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: check supported before available to ensure release page fallback Unsupported platforms return { available: false, supported: false }, so the supported check must come first to open the release page instead of silently returning. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: skip download when update is already ready or downloading Guard against re-downloading when checkForUpdate returns ready or downloading sentinel, preventing overwrite of valid install state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: fallback to release page when electron-updater reports no update When GitHub API found an update but electron-updater does not, open the release page instead of silently doing nothing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
34f9d2a663 |
chore: 死代码清理与架构分层修复 (#524)
* chore: 移除死代码并修复架构分层违规 - 删除未使用的 ACP 模块 (infrastructure/ai/acp/) - 删除未使用的 AI 组件 (ExecutionPlan, PermissionDialog) - 将 syncPayload.ts 从 domain 移至 application 层,修复分层违规 - 移除未使用的导出 (useSecurityState, useProviderStatus, GitHubAuthState, getAgentCommandLabel, ImageAttachment, HotkeyActions) - 收窄 Electron bridge module.exports,移除未使用的导出函数 - 将仅内部使用的函数/类型取消导出 (isSupportedLocale, SyncDashboard) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: 二次审查清理 — 移除更多死代码和架构违规 - 移除未使用的 ConversationEmptyState 组件和类型 - 移除未使用的 PromptInputSelect 系列组件 (5 个导出) - 移除 global.d.ts 中残留的 SMBConfig 类型和 cloudSyncSmb* 方法声明 - 移除 useAutoSync.ts 中未使用的 toast 导入 (同时修复 application→components 反向依赖) - 清理因删除而产生的多余 import Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: 消除直接 localStorage 访问,提取 safeSend 共享工具 localStorage 集中化: - 新增 storageKeys 常量: SIDE_PANEL_WIDTH, PF_RECONNECT_CANCEL, DEBUG_HOTKEYS, DEBUG_UPDATE_DEMO - TerminalLayer/SettingsApplicationTab/App.tsx/useUpdateCheck 改用 localStorageAdapter - CloudSyncManager 内部方法改用 localStorageAdapter - portForwardingService 改用 localStorageAdapter + 集中 key safeSend 去重: - 新增 electron/bridges/ipcUtils.cjs 共享模块 - sshBridge/sftpBridge/portForwardingBridge/sshAuthHelper/aiBridge 统一引用 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: 终审清理 — 移除未使用的 require 和废弃类型别名 - 移除 sftpBridge.cjs 中未使用的 require("node:net") - 移除 aiBridge.cjs 中未使用的 require("node:path") - 移除 types.ts 中已废弃的 ChatMessageImage 类型别名 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 修复 ESLint 错误 — 组件不再直接导入 infrastructure - 新增 useStoredNumber hook,TerminalLayer 通过 hook 访问侧边栏宽度 - SettingsApplicationTab 的 isUpdateDemoMode 改为从 useUpdateCheck hook 传入 - 移除 useCloudSync.ts 中未使用的 CloudSyncManager 导入和 GitHubAuthState 接口 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: 提取 notification port,消除 application 层对 components 的依赖 将 toast 通知抽象为 application/notification.ts 端口, UI 层通过 setNotify 注入实现,useAutoSync 改用 notify 接口。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
39a398aa2b |
SFTP 右键菜单添加「复制文件路径」功能 (#514)
* feat(sftp): add "Copy file path" to right-click context menu (#507) Add a context menu item that copies the full remote file/directory path to clipboard using navigator.clipboard.writeText(). Works for both files and directories. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 使用 joinPath 构建复制路径,修复 Windows 路径分隔符问题 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: joinPath 去除 Unix 路径尾部多余斜杠 避免 currentPath 带 trailing slash 时产生双斜杠路径(如 /var/log//syslog)。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
0b7c52523e |
feat: 终端沉浸模式 (#517)
* feat: add terminal immersive mode When enabled, the UI chrome (tab bar, sidebar, status bar) adapts its colors to match the active terminal's theme, creating a visually cohesive experience. Colors are derived from the terminal theme's hex values and converted to HSL for CSS custom property overrides. - Add useImmersiveMode hook with hex-to-HSL conversion and token derivation - Add reapplyCurrentTheme to useSettingsState for restoring original theme - Integrate with App.tsx to resolve active terminal's effective theme - Add immersive mode toggle in Appearance settings with i18n (en/zh-CN) - Add CSS transition class for smooth 300ms color changes - Support cross-window sync via IPC for Settings window toggle - Handle per-host theme overrides and workspace focused sessions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 沉浸模式多项改进与 bug 修复 - 修复 primaryForeground 硬编码白色导致浅色 cursor 对比度不足 - 修复 SettingsPage 直接导入 infrastructure 层违反架构约束 - 修复 TerminalSession 类型未导入导致 TS 编译错误 - 修复 TopTabs memo 缺少 logViews 导致 logView 变化不触发重渲染 - 重构 useImmersiveMode 为纯 effect hook,状态由 useSettingsState 统一管理 - Workspace 多终端主题不一致时禁用沉浸模式 - 排除 logView tab 误触发沉浸模式 - 沉浸模式下禁用 dark/light 切换按钮 - Agent 图标使用 CSS mask 跟随文字颜色 - Agent 下拉菜单 overflow-hidden 修复 hover 溢出 - 退出沉浸模式使用 overlay 淡出避免闪烁 - immersive-transition class 仅在沉浸实际生效时添加 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: 沉浸模式默认开启 新用户默认启用沉浸模式,已有设置的用户不受影响。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * perf: 沉浸模式主题切换性能优化 - 启动时预计算所有内置主题的 CSS 字符串,切换时 O(1) 查表 - 自定义主题懒计算并缓存,后续切换同样 O(1) - useLayoutEffect 替代 useEffect,paint 前完成避免闪烁 - 跳过无效的 dark/light class 切换 - apply 和 restore 逻辑拆分为独立 effect - 去掉主题列表 hover 渐变动画 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 修复 Codex review 提出的三个问题 - [P1] base UI theme 变化时不再覆盖沉浸模式的 dark/light class - [P2] fingerprint 加入 theme.type,检测自定义主题 dark↔light 编辑 - [P2] 沉浸模式设置接入 sync pipeline (collect/apply/rehydrate) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: focus 模式 workspace 支持沉浸 + settingsVersion 加入 immersiveMode - focus 模式 workspace 使用 focusedSessionId 的主题,不再要求所有 session 一致 - settingsVersion 加入 immersiveMode 依赖,确保 auto-sync 能检测到变化 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 沉浸模式 sync 一致性修复 - 初始化时将默认值写入 localStorage,确保 collectSyncableSettings 能收集到 - rehydrateAllFromStorage 后通过 IPC 广播给其他窗口 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: focus 模式关闭 focused session 后 fallback 到剩余 session 的主题 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 沉浸模式加入 storage event 跨窗口同步 将 immersiveMode 加入 settingsSnapshotRef 和 handleStorageChange, 确保 web/preview 场景下多窗口间沉浸模式状态同步。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: 沉浸模式同步 Electron 原生窗口背景色 切换沉浸主题时同步调用 setTheme/setBackgroundColor, 使 Windows 上的窗口边框颜色与沉浸主题一致。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
35194036cb |
Merge pull request #502 from crawt/perf/settings-window-prewarm-hide-on-close
perf(settings): prewarm settings window and hide on close |
||
|
|
c74b78a49d | Reconcile AI session state with live sessions | ||
|
|
a7f42ec93e | Avoid dropping unflushed AI sessions during cleanup | ||
|
|
a886d509f8 |
perf(settings): prewarm settings window and hide on close
Instead of creating a new BrowserWindow on each user click, the settings window is now: 1. Pre-warmed silently 3 s after app startup (showOnLoad: false) 2. Hidden instead of destroyed when the user closes it 3. Instantly shown/focused on subsequent opens |
||
|
|
d6fea6c328 | Preserve AI session state and cleanup across panel unmounts | ||
|
|
6b1d9ee409 | Gate jump-proxy checks on usable endpoints | ||
|
|
c0c0378df0 | Ignore incomplete jump-host proxy configs | ||
|
|
093951150c | Only validate first-hop jump proxies | ||
|
|
a0418039c4 | Prefer jump-host proxy over target proxy guards | ||
|
|
a0a2567fa5 | Validate jump-host proxy credentials early | ||
|
|
2c551cf5e8 | Sanitize proxy credentials for jump hosts | ||
|
|
c54aa52191 | Support proxy config on jump hosts | ||
|
|
859d4b8156 | Fix auto-start auth readiness checks | ||
|
|
c6e07cf149 | Clean up port forwarding auto-start lint | ||
|
|
0ab18ce186 | Fix port forwarding startup and cleanup races | ||
|
|
f814719b32 | Fix jump-host port forwarding edge cases | ||
|
|
ee6b05892d | Support jump hosts for port forwarding | ||
|
|
4bf61c02a0 |
fix: pass permissions field from SFTP listing to frontend (#480)
The remote file listing mapper in useSftpDirectoryListing.ts was dropping the `permissions` field returned by the backend. This caused the permissions dialog to show all checkboxes unchecked (000) and the file list to show "--" in the permissions column. One-line fix: add `permissions: f.permissions` to the mapped object. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
fe27dd8a9d |
fix: address Codex round 3 — accurate auth logs and clean state
P2: Remove premature onAuthAttempt calls from buildAuthHandler's array branch — methods are listed before connect(), making logs inaccurate. P2: Handle "waiting for user input..." and "user responded" as literal log messages, not as "Trying X..." format, in both SSH and SFTP. P3: Clear connectionLogs after successful SFTP connect so directory navigation doesn't replay stale auth transcript in the loading overlay. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
a94293d31e |
fix: address Codex review — scoped progress, local reset, connected event
P2: Guard SFTP progress callback with navSeqRef check to prevent stale auth logs from leaking into a reused tab after retry/disconnect. P3: Reset connectionLogs when connecting to local filesystem, avoiding stale remote auth logs showing in the local pane. P3: Emit 'connected' progress event when the final SFTP SSH session is ready, so the log confirms the connection completed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
45794b7f6f |
feat: unified auth logging for SSH and SFTP connections
Add detailed authentication method logs to both SSH terminal and SFTP connection flows, giving users visibility into which methods are tried, rejected, or require input. Backend (shared): - sshAuthHelper buildAuthHandler: track lastAttemptedLabel, log method rejections and "all methods exhausted" via onAuthAttempt callback - sftpBridge: add sendSftpProgress helper, wire onAuthAttempt to both chain and main buildAuthHandler calls, emit connecting/authenticating/ connected/error progress events via new IPC channel Backend (SSH-specific): - sshBridge: log method rejections in custom authHandler, log keyboard-interactive prompt/response and all-methods-exhausted IPC/Bridge: - preload: register netcatty:sftp:connection-progress listener, expose onSftpConnectionProgress in bridge API - global.d.ts: add onSftpConnectionProgress type Frontend (SFTP): - types.ts: add connectionLogs to SftpPane - useSftpConnections: subscribe to progress events during connect, convert to human-readable log lines, accumulate in pane state - SftpPaneFileList: show logs below spinner during connecting, show expandable "Show logs" in error view with collapsible log panel Frontend (SSH): - createTerminalSessionStarters: format rejected methods with ✗ prefix and "all methods exhausted" message Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
7f83b22c95 |
fix: address Codex review — SFTP jump host identity files and skip handling
P1: Pass identityFilePaths for jump hosts in SFTP credentials so chain connections can load IdentityFile keys for bastion hosts. P2: When the passphrase dialog is skipped or times out (not just cancelled), clear the encrypted key and continue to the next identity file. Previously skip/timeout fell through and left the encrypted key in connOpts, causing the same stall this feature is meant to fix. Applies to all 4 identity file loading paths (SSH chain, SSH main, SFTP chain, SFTP main). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
e3fdb1f7ff |
feat: support IdentityFile from SSH config import (#463)
SSH config import now parses the `IdentityFile` directive and stores the file paths on the host as `identityFilePaths`. At connection time, the SSH and SFTP bridges resolve these paths, read the key file content, and use it for authentication — matching the behavior of OpenSSH and Tabby. If the key file is encrypted, a passphrase dialog is shown before connecting. If the user cancels, the key is skipped and auth falls back to other methods. If the file doesn't exist, a warning is logged and the next key path is tried. Changes: - domain/models.ts: add `identityFilePaths` to Host interface - domain/vaultImport.ts: parse `IdentityFile`, expand `~`, store paths - global.d.ts: add `identityFilePaths` to NetcattySSHOptions and NetcattyJumpHost types - createTerminalSessionStarters.ts: pass identityFilePaths for both main connection and jump hosts - useSftpHostCredentials.ts: pass identityFilePaths for SFTP - sshBridge.cjs: read identity files at connection time for both main and chain connections, with encrypted key passphrase prompting - sftpBridge.cjs: same for SFTP main and chain connections Closes #463 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
a6af1dffed |
fix: resolve SSH chain connection hang and improve connection progress (#465)
* fix: resolve SSH chain connection hang and improve connection progress - Fix Promise never settling when conn 'close' fires before 'ready' during chain connections, which caused "reply was never sent" error - Replace fake timed progress animation with real backend events - Send granular connection progress for all SSH connections (not just chain), including: connecting, key exchange, auth attempts, forwarding, shell opening - Surface auth method attempts (SSH agent, key names, password) in progress logs so users can diagnose authentication failures - Include error details in progress events for better error visibility Closes #463 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: scope progress events by sessionId, prevent duplicate errors, hide chain UI for direct SSH - Add sessionId to chain progress payload so events are scoped per session (P1) - Set settled=true in error/timeout handlers to prevent close handler from emitting a second misleading 'closed unexpectedly' error (P2) - Only show chain progress UI when total > 1 so direct SSH connections don't render as 'Chain 1/1' (P3) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: mark shell-open failure as settled before closing connection The conn.shell() error branch calls conn.end() which triggers the close handler, but settled was not set yet, causing a duplicate 'closed unexpectedly' error to overwrite the real shell-open failure message. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
3db9b0aa26 |
fix: restore listSftp fallback when statSftp is unavailable
Preserve the original fallback behavior for bridges that don't expose statSftp — probe candidate directories via listSftp instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
ad15d8ceb5 |
fix: detect actual home directory for SFTP instead of hardcoding /home
Query the remote server for the real home directory using two methods:
1. SSH exec `echo ~` — works for any user regardless of home path
2. SFTP realpath('.') — fallback, SFTP cwd is typically home dir
Falls back to the previous hardcoded /home/{username} candidates if
both methods fail. This fixes SFTP auto-open sidebar not navigating
to the correct directory for users with non-standard home paths
(e.g. /usr/home, /export/home, custom paths).
Fixes #458
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
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> |
||
|
|
55ee08315a |
fix: remove unused useEffect import
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> |
||
|
|
a0dce5d4a6 |
feat: support downloading SFTP folders from the new view (#427)
* feat: support SFTP folder downloads in the new view * refactor: remove unused legacy SFTP modal * fix: use directory picker for SFTP folder downloads * fix: wire folder downloads through SFTP side panel * fix: pre-scan SFTP folders for stable download progress * feat: show hybrid progress for SFTP folder downloads * feat: parallelize SFTP folder downloads * feat: adapt SFTP folder download concurrency by file size * feat: pool isolated channels for fast SFTP downloads * fix: address SFTP download review findings * fix: wait for in-flight fast download channels * fix: unblock fast channel waiters on cancel |
||
|
|
17e98090ad |
Add AI support for local terminal sessions (#419)
* Add AI support for local terminal sessions * Fix local AI session metadata and shell safety * Fix local session cloning and multi-exec errors * Refactor local shell detection helpers * Fix local shell helper import path * Fix CJS imports in renderer * Use ESM local shell helpers in renderer * Normalize local shell paths and platform metadata |
||
|
|
4e2089d7e2 |
feat: add option to auto-open sidebar on host connect (#401)
* feat: add option to auto-open sidebar on host connect Closes #396 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: only auto-open SFTP sidebar for SSH/Mosh connections Use allowlist (ssh, mosh) instead of blocklist so telnet and other non-SSH protocols don't trigger SFTP sidebar which would fail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: support auto-open SFTP for Quick Connect / temporary sessions Build a minimal Host from session data when hostId is not in the vault, so Quick Connect sessions also trigger auto-open SFTP sidebar. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: sync SFTP auto-open sidebar setting across windows via IPC Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: skip local terminals and preserve username for temp sessions - Don't fallback protocol to 'ssh' so local terminals are excluded - Include session.username in synthesized Host for Quick Connect Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
4e26852482 |
feat: support multimodal attachments in AI chat (#397)
* feat: support multimodal attachments (images, PDFs, files) in AI chat Previously uploaded images were displayed in the UI but never sent to the AI model, and non-image files (PDF, text) were silently rejected. - Rename useImageUpload → useFileUpload; accept image/*, PDF, and text/* - Rename ChatMessageImage → ChatMessageAttachment with filePath support - Build multimodal SDK messages (ImagePart/FilePart) for Catty Agent - Fix ACP agent path: images inline, non-image files via local path hint so ACP agents (Claude Code, etc.) read them with native file access - Use Electron webUtils.getPathForFile() for reliable file path capture - Compact user message bubble padding Closes #294 (AI file upload issues) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: show real tool names in AI chat instead of ACP wrapper names - Unwrap ACP dynamic tool calls in serializeStreamChunk to extract real tool name, args, and toolCallId from chunk.input - Simplify MCP tool name prefixes (mcp__server__tool → tool) - Pass toolCallId from ACP tool-call events to match tool results - Prevent onToolResult from overwriting correct names with wrapper name - Build toolCallNames map in ChatMessageList for tool result display Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: backward-compatible fallback for legacy `images` field in chat messages Persisted sessions may still have `images` instead of `attachments`. Add `?? m.images` fallback in SDK message builder and renderer so historical image attachments are not silently dropped after upgrade. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: broaden file type support and handle pasted files without path - Accept all file types except video/audio (instead of allowlist) so .json, .yaml, .sh, etc. are not silently rejected - For ACP agents, save pasted/virtual files (no filePath) to temp directory so the agent can still read them Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use managed temp dir for pasted ACP attachments Use tempDirBridge.getTempFilePath() instead of manual os.tmpdir() path so pasted file attachments are tracked by the app's cleanup system. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
3d4fbf8763 |
fix: keep workspace MCP scope in sync (#385)
* fix: keep workspace MCP scope in sync * fix: refresh catty workspace tool context * fix: preserve AI stream state across tab switches * fix: align ACP stop and resume with 1code semantics * fix: harden ACP resume fallback for unsupported agents |
||
|
|
9387590696 |
Fix ACP stop cleanup and cancel state (#384)
* Fix ACP stop cleanup and cancel state * Block ACP tool writes after stop * Kill ACP child processes on cleanup * Cleanup ACP sessions when tabs disappear |
||
|
|
74a04f1d8e |
feat: three-way merge for cloud sync (#381)
Implements automatic three-way merge for cloud sync, replacing the binary USE_REMOTE/USE_LOCAL conflict resolution. Same principle as Git's merge algorithm. After every successful sync, a "base snapshot" is saved (encrypted with AES-256-GCM using the derived master key). When a conflict is detected, the system performs per-entity merge by ID: - Items added on one side → included - Items deleted on one side (unchanged on other) → removed - Items modified on one side only → take that version - Both sides modified same item → prefer local - One side deleted + other modified → keep modification Additional improvements: - Per-provider sync base to prevent cross-provider contamination - Deep merge for nested settings (terminalSettings, customKeyBindings) - Entity merge for array-valued settings (customTerminalThemes) - KnownHost deduplication by (hostname, port, keyType) - Chunked base encoding to avoid stack overflow on large vaults - Base cleared on provider disconnect/reconnect - Correct version numbering after multi-provider merge Closes #378 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
3c258b0f19 |
feat: auto-close tab when user actively exits session (#380)
* feat: auto-close tab when user actively exits a session
When a user intentionally exits a session (e.g. typing `exit`, `logout`,
or Ctrl+D), the tab is now automatically closed instead of showing the
"Start Over" disconnected page. This matches the behavior of macOS
Terminal and other popular terminal emulators.
Network errors, timeouts, and server-initiated disconnects still show
the disconnected page with the Start Over option, so users can reconnect.
In workspace mode, only the individual terminal pane is closed, not the
entire workspace.
Implementation:
- Backend bridges now include a `reason` field in exit events to
distinguish stream-level exits ("exited") from connection errors
("error"), timeouts ("timeout"), and connection closes ("closed")
- SSH bridge captures real exit code from stream "exit" event instead
of hardcoding 0
- Frontend auto-closes session only when reason is "exited"
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address review feedback for auto-close feature
1. Pass exit event to onSessionExit in local shell path (line 757)
to prevent undefined access when checking evt.reason
2. Change Telnet socket close reason from "exited" to "closed" since
a clean socket close can also be server-initiated (idle timeout,
remote shutdown), not just user exit
3. Change Serial port close reason from "exited" to "closed" since
port close can be from device disconnect, not user action
Only SSH stream close and local/mosh process exit (node-pty onExit)
now use reason "exited", which correctly represents user-initiated exits.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: only mark SSH exit as "exited" when stream exit event fired
ssh2's stream "close" event fires whenever the channel closes, not
only on normal shell exit. If the network drops and the channel closes
without a preceding "exit" event, the reason was incorrectly set to
"exited", causing the tab to auto-close instead of showing the
disconnected/Start Over page.
Now tracks whether stream "exit" actually fired via a flag, and only
uses reason "exited" in that case. Otherwise falls back to "closed".
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: classify mosh non-zero exits as errors
Mosh process exiting with a non-zero code typically indicates a
connection or auth failure. Mark these as reason "error" so the
disconnected/Start Over UI is shown instead of auto-closing the tab.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: treat SSH signal-terminated exits as disconnects
ssh2's stream "exit" event also fires for signal terminations (e.g.
SIGHUP from server idle timeout, SIGTERM from admin kill), where code
is null and signal is set. These are not user-initiated exits and
should show the disconnected/Start Over page.
Now only sets streamExited=true when there's a numeric exit code and
no signal present.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: distinguish abnormal local PTY exits from user exits
Local shell terminated by signal or crashing on startup should show
the disconnected UI, not auto-close the tab. Now only marks as
reason "exited" when exitCode is 0 and no signal, matching the same
logic used for mosh.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use signal presence to distinguish local shell exit reason
For local shells, non-zero exit codes are common in user-initiated
exits (e.g. typing `exit` after a failed command returns that
command's exit code). Use signal presence instead: signal means the
process was killed externally (show disconnected UI), no signal
means normal process exit (auto-close tab).
Mosh keeps exitCode-based logic since non-zero there indicates
connection/auth failure, not user exit.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
338ba94d42 |
feat: add paste-only option for snippets (no auto-execute) (#375)
* feat: add "paste only" option for snippets (no auto-execute) Add a noAutoRun flag to snippets that pastes the command into the terminal without appending a carriage return, so users can review and edit before manually pressing Enter. Applies to all snippet execution paths: snippet runner (new session), keyboard shortcut, and startup command. Closes #371 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use clearer wording "仅粘贴" instead of "仅上屏" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: skip onCommandExecuted for paste-only shortcut snippets Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: persist noAutoRun on save and apply to Scripts panel clicks - Include noAutoRun in handleSubmit serialization (was being lost) - Pass noAutoRun through ScriptsSidePanel click handler to TerminalLayer so paste-only snippets work from the Scripts panel too Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
2f1fd399cf |
fix: avoid repeated sync (#370)
Co-authored-by: yuzifu <yuzifu@TB16PGen5.Info> |