mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-24 09:16:29 +00:00
0108390d4f02854bbfcd8fbd0e87cea78ca32add
395
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7c55381f39 |
Add terminals to workspace + New Workspace from QuickSwitcher (#790)
* Add terminals to workspace + New Workspace from QuickSwitcher
Two entry points share a single multi-select picker that lets the
user add Local Terminal + any combination of hosts into a workspace:
1. Focus-mode sidebar "+" button appends the selected targets to the
active workspace as new panes.
2. QuickSwitcher "New Workspace" button (small inline action next to
the Jump To hint) spins up a brand-new workspace tab populated
with the selected targets.
## Changes
### domain/workspace.ts
- pruneWorkspaceNode now rebalances surviving siblings to EQUAL
sizes after removal, instead of re-normalising the prior skew.
Matches the "auto-redistribute on close" expectation.
- New appendPaneToWorkspaceRoot(root, sessionId, direction='vertical'):
if root already splits in the requested direction, pushes the new
pane onto its children and resets sizes to equal; otherwise wraps
root + new pane in a new 0.5/0.5 split. Flattens long chains of
appends instead of producing degenerate nested trees.
### application/state/useSessionState.ts
- appendHostToWorkspace(workspaceId, host, direction?) — atomic
"build a session for this host and append it to the root", keeps
activeTab on the workspace and focuses the new pane.
- appendLocalTerminalToWorkspace(workspaceId, options?, direction?)
— mirror of the above for local shells.
- createWorkspaceFromTargets(targets, name?) — accepts a mixed list
of {kind:'local',...} / {kind:'host',host} and creates a new
workspace with one pane per target. Defaults viewMode to 'focus'
so the QuickSwitcher flow lands in the sidebar layout.
- All three exported from the hook.
### components/workspace/AddToWorkspaceDialog.tsx (new)
QuickSwitcher-styled multi-select picker:
- Fixed top-center overlay, same chrome as QuickSwitcher (border,
shadow, rounded-xl, borderless search input, bg-primary/15 cursor).
- Two sections: Local Shells (currently just Local Terminal) and
Hosts. Hover follows keyboard cursor.
- Toggle rows with click or Space / Enter; ⌘/Ctrl+Enter submits;
Esc closes. Right-side Check marks visible items.
- Thin footer bar with Cancel + "Add N" button.
### App.tsx
- Root-mounted single instance of AddToWorkspaceDialog with a
discriminated-union state:
{ mode: 'append'; workspaceId } | { mode: 'create' } | null.
- onAdd dispatches based on mode — append loops through the picker
targets calling the two append helpers; create calls
createWorkspaceFromTargets once.
- TerminalLayer's focus "+" now sends an onRequestAddToWorkspace
(workspaceId) up to App instead of owning its own dialog.
- QuickSwitcher's onCreateWorkspace callback repurposed to open the
dialog in create mode (replaces the older CreateWorkspaceDialog
route for this specific flow).
### components/TerminalLayer.tsx
- Dropped the inline AddToWorkspaceDialog + addHostPanelOpen state;
replaced the two append callbacks with a single
onRequestAddToWorkspace prop wired to the "+" button.
- Focus-sidebar header: replaced the "Terminals · N" counter with an
immersive borderless search input (bg-transparent, shadow-none,
termFg color) for filtering the terminal list; "+" and Columns2
buttons moved to the right.
- Session list filtered client-side by the search term across
hostLabel / hostname / username.
### components/QuickSwitcher.tsx
- Re-introduced onCreateWorkspace prop (was removed as unused).
- "New Workspace" inline button (Plus icon + label) sits on the
right of the Jump To hint row: border, rounded, hover bg. Click
fires onCreateWorkspace then closes QS.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add configurable New Workspace shortcut
Mirrors QuickSwitcher's "+ New Workspace" button via a keyboard
binding so the dialog can open in one keystroke without passing
through QS.
- domain/models.ts: new DEFAULT_KEY_BINDINGS entry id=new-workspace,
action=newWorkspace, default ⌘+Shift+J (Mac) / Ctrl+Shift+J (PC).
Audited the defaults — only quick-switch uses J (⌘+J), so the
shifted combo is free. The binding sits in the 'app' category so
it shows up in Settings → Shortcuts and can be rebound by the user.
- application/state/useGlobalHotkeys.ts: wire newWorkspace into the
HotkeyActions interface, getAppLevelActions() allowlist, and the
global keydown switch so the scheme-driven handler dispatches it.
- App.tsx: handle case 'newWorkspace' inside executeHotkeyAction by
calling setAddToWorkspaceDialog({ mode: 'create' }) — same entry
as QuickSwitcher's button, just without having to open QS first.
- application/i18n/locales/zh-CN.ts: add '新建工作区' translation for
settings.shortcuts.binding.new-workspace. English falls back to
the KeyBinding.label field ("New Workspace"), so no en.ts change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Address codex P1: don't check setState flag after the updater returns
Codex flagged that appendHostToWorkspace / appendLocalTerminalToWorkspace
were racy: both flipped an `inserted` flag inside setWorkspaces'
updater and then read it synchronously to decide whether to commit
the matching session via setSessions. React does NOT guarantee
updaters run synchronously (concurrent rendering, StrictMode
double-invoke, etc.), so the flag could still be false at the read
site even though the workspace exists. In that case setSessions was
skipped while the queued workspace update could still insert a new
pane referencing newSessionId — leaving a pane with no backing
session in state.
Fix: add a workspacesRef kept in sync with the workspaces state on
every render, and perform the existence check synchronously *before*
queuing any setState. Once we've confirmed the workspace exists on
the latest committed state, both setWorkspaces and setSessions are
called unconditionally, so they can never diverge.
The ref approach also correctly handles the multi-target append
loop path — React batches the updaters and applies them in sequence,
so sibling pane/session writes land in matching order.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Address codex P1+P2: narrow prune rebalance; append in root direction
### P1 — pruneWorkspaceNode over-rebalanced ancestor splits
The equal-sizes rebalance was unconditional during the recursive
walk, so closing a pane deep in one branch also rewrote unrelated
ancestor ratios (e.g., a root 0.8/0.2 vertical split got normalised
to 0.5/0.5 when a grand-child horizontal pane closed).
Now each split level tracks whether it actually lost a DIRECT
child. Only splits where a direct child disappeared get their
siblings reset to equal sizes. Ancestors whose direct children all
survived keep their original ratios (defensively re-normalised in
case a descendant subtree collapsed shape).
### P2 — Append path ignored the root's current direction
onAdd in App.tsx called the two append helpers without a direction,
so both defaulted to 'vertical'. appendPaneToWorkspaceRoot only
flattens into the root split when the directions match; if the
workspace root was horizontal (e.g., user split top/bottom earlier),
each append wrapped the entire existing tree into one side of a new
vertical split — existing panes crammed into one branch, new pane
hoarding half the space.
Read the current root direction out of the target workspace and
pass it down so new panes become peers of the existing root
siblings regardless of horizontal vs vertical.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Address codex P2: allow serial hosts in create-workspace picker
The picker used to filter out every host with protocol='serial'
regardless of mode. That was correct for append mode (the
appendHostToWorkspace helper has no serial path and early-returns)
but a regression for create mode — the old createWorkspaceWithHosts
flow passed serial hosts through and createWorkspaceFromTargets
still builds a SerialConfig-backed session for them, so there was
no reason to block them in the "+ New Workspace" entry.
Move the filter from the dialog up to App.tsx:
- AddToWorkspaceDialog drops the serial filter; selectableHosts is
simply the hosts prop.
- App.tsx passes `hosts.filter(h => h.protocol !== 'serial')` when
mode is 'append', and the full list when mode is 'create'.
Result: users can once again build a workspace from serial hosts
via QuickSwitcher's "+ New Workspace" button or the ⌘/Ctrl+Shift+J
hotkey, while append-to-existing keeps its earlier safe behaviour.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Address codex P2: don't commit session when append target disappears
Follow-up to the earlier ref-based guard. The ref check eliminates
the common "workspace already gone" case but still leaves a small
race: if closeWorkspace runs between the ref read and setWorkspaces'
updater firing, prev.map returns the unchanged workspaces but
setSessions / setActiveTabId still execute — leaving an orphan
session whose workspaceId points at a deleted workspace and jumping
activeTabId to a closed tab.
Nest setSessions + setActiveTabId inside the setWorkspaces updater
so the writes are gated on the same authoritative match used for
the tree update. The setSessions updater also de-dupes by newSessionId
so React 18 StrictMode's dev-time double-invoke of the outer updater
doesn't append the same row twice. Same pattern applied to
appendLocalTerminalToWorkspace.
The existing closeSession already uses the nested-setState shape, so
this matches the codebase convention.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
c6d4d3ec16 |
Block empty/shrunk pushes when sync base is null (#779) (#784)
* Block empty/shrunk pushes when sync base is null (#779) The shrink guard (detectSuspiciousShrink) returned suspicious:false whenever base was null, which is exactly the condition on a fresh install, after unlock-key re-derivation, or when the encrypted base blob fails to decrypt. A device in that state could push a degraded/empty payload and overwrite populated cloud data — the failure mode reported in #779 (Mac → OneDrive → Win11 wiping the keychain on both ends). Accept an optional remote-payload fallback in the guard and use it when base is missing. Plumb the already-decrypted remote payload from the merge branch, and decrypt checkResult.remoteFile on demand in the direct-upload and syncAll branches when base is null. Legitimate cases stay untouched: - no base AND no remote → still not-suspicious (genuinely empty). - outgoing grew past remote → lost is negative, guard skips. - base present → behaviour unchanged, remote fallback ignored. * Harden OneDrive 404 handling, restore barrier, multi-provider divergence (#779) Follow-up fixes on top of the shrink-guard change for the same root incident. - OneDriveAdapter: findSyncFile/downloadSyncFile now retry with short backoff when the Graph API returns "not found". A file uploaded by another device can transiently 404 for seconds while the OneDrive client propagates it, and treating that as "cloud is empty" was a key step in how #779 escalated. The retry is bounded (2 extra attempts, 1.5s/3s backoff) and only fires on null/404 results. - useAutoSync.isRestoreInProgress: self-clear the restore-barrier storage key when its deadline is in the past, and treat a deadline more than 10 minutes in the future as corrupt (clock skew, pathological holdMs, or tampered value) instead of letting it lock auto-sync. - CloudSyncManager + SyncEvent: when the existing divergent-provider- bases check fires, emit a PROVIDERS_DIVERGED event in addition to the console.warn so the UI can surface the warning (was otherwise silent and a known path for one provider's merged payload to overwrite a differently-configured provider's data). |
||
|
|
51a6b7efaa |
Preload compact history on first turn after app restart (#753 hedge) (#769)
* Preload compact history on first turn after app restart (#753 hedge) Symptom (confirmed on Copilot CLI, originally reported on Codex in #753): after closing and reopening Netcatty, the AI chat UI still shows the prior conversation but the agent responds "this is the beginning of our conversation, no previous records". Earlier context is lost entirely. Root cause: the bridge relied on session/load throwing "not found" to trigger the catch-block fallback that replays compact history. Some ACP agents (Copilot CLI, some Codex builds) silently spawn a new session when handed a stale id instead of erroring. The catch-block never fires → historyReplayFallback stays false → the first turn sends only the latest prompt → agent sees zero context. Fix: when we're creating a new provider process AND telling it to resume an existing session id AND the renderer gave us compact history, preload historyReplayFallback=true as a hedge. If the agent really did reload the session, the replay is ~3KB of redundant context (small waste). If the agent silently started fresh, the replay restores durable constraints + last few raw turns so the first response is coherent. After the first successful streamed turn clears the flag (the round-2 post-stream hook), steady state is back to sending only the latest prompt. Cost is bounded to one replay per app-restart-and-prompt. Test: "replays compact history on the first turn after app restart even when session/load 'succeeds'" — mocks createACPProvider to behave like Copilot CLI (no error thrown, no real resume), asserts the first streamText call carries history+latest (length 2) and the second only latest (length 1). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Fix AI session resume and agent switching * Preserve hidden draft when switching agents --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
f6f3147afb |
Tab bar: duplicate-adjacent insertion + wheel-to-horizontal scroll (#743)
* Improve tab UX: insert duplicated tabs adjacent to source, enable wheel scroll on tab bar Addresses #737. - Duplicating a tab now inserts the new tab immediately after the source in the tab order, instead of appending it to the far right where it was hard to find with many tabs open. - The top tab strip now translates vertical mouse-wheel deltas into horizontal scrolling, so users with many tabs can reach the ends of the strip without dragging. Trackpad gestures that already carry horizontal delta are left alone to preserve native two-finger swiping. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Address Codex review: read source session inside functional updater Codex flagged that reading `session` from the closure broke the atomicity guarantee of the previous implementation — rapid repeated duplicates could miss freshly queued state. - Pre-allocate the new session id outside both setters so it stays stable across StrictMode double-invocations. - Move the source lookup back into `setSessions`' functional updater so it always reads the freshest committed/queued state. - Drop `sessions` from the useCallback dependency list now that we no longer read it. - Fast-path tabOrder insertion when the source is already in tabOrder to avoid re-deriving the full effective order in the common case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Address Codex review: gate active-tab and tab-order updates on successful create Codex flagged that `setActiveTabId(newSessionId)` and `setTabOrder(...)` ran unconditionally even when `setSessions` bailed out (source tab was closed before the duplicate handler ran). That left activeTabId pointing at an id that was never appended to sessions, putting the terminal layer into an invalid "no matching tab" state. Move both nested setState calls inside the `setSessions` functional updater so they only fire when the source is actually present. Mirrors the original pre-PR pattern; nested updates are idempotent so StrictMode's double-invocation is harmless. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
54b26511a1 |
Cloud sync data-loss prevention (4-layer defense) (#742)
* feat(sync-guard): extend SyncState with BLOCKED + add shrink event variants
* feat(sync-guard): add detectSuspiciousShrink pure function with 12 unit tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* polish(sync-guard): drop unnecessary cast, sharpen test naming, pin priority invariant
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(test): include domain/*.test.ts in npm test glob
* feat(sync-guard): gate syncToProvider with shrink detection + force-push override
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(sync-guard): reset overrideShrinkOnce before early return for invariant strictness
* fix(sync-guard): extend shrink guard to syncAllProviders (the actual sync entry point)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(sync-guard): apply empty-vault guard uniformly to auto and manual sync
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(sync-guard): preserve merge base on same-account re-auth
Adds providerAccountId persistence; completePKCEAuth and completeGitHubAuth
now only clear syncBase/anchor when the authenticated account id differs from
the previously stored one, preventing zombie-entry resurrection on token
refresh. disconnectProvider clears the stored id so a reconnect starts fresh.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(sync-guard): add i18n strings for sync-blocked banner + force-push modal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(sync-guard): add SyncBlockedBanner showing shrink findings with restore/force-push actions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(sync-guard): stable subscribeToEvents reference + type-safe finding narrowing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(sync-guard): force-push confirmation modal + scroll restore button into view
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* ux(local-backups): show version as title, demote reason+timestamp to meta line
* feat(local-backups): record + display sync data version (v5/v6...) on each backup
Each backup now captures the live CloudSyncManager.localVersion at creation
time. UI shows it as title (v5, v6, ...) with timestamp + reason demoted to
the meta line. Backups created before this field existed (or before any
successful cloud sync) fall back to timestamp as title.
Replaces the earlier app-version-transition title which conflated app
version with sync data version.
* fix(sync-guard): consume override flag at sync entry + restore provider status on block
- Snapshot+clear overrideShrinkOnce at top of syncToProvider and
syncAllProviders so an early-return cannot leak the flag to a later
unrelated sync (Codex P1).
- Restore provider status to 'connected' when shrink-block returns from
syncToProvider; previously left provider stuck on 'syncing' in the
UI (Codex P2).
- Process pre-existing check errors before returning from the
shouldBlockAll branch in syncAllProviders so a check-failed provider
isn't dropped from results (Codex P2).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(sync-guard): refactor force-push to parameter passing + add credential-availability guard
The previous design used a one-shot boolean flag on CloudSyncManager set
by forcePushOverrideShrink(). Even with snapshot+clear at sync entry
points, the renderer wrapper's await ensureUnlocked() could throw before
the flag was consumed, leaving it armed for the next unrelated sync.
Fix: pass overrideShrink as a call-time parameter through the chain.
Eliminates the persistent flag and its leak surface.
Also: force-push now runs the same ensureSyncablePayload(...) guard the
other manual sync entry points use, so a vault with encrypted-credential
placeholders won't be uploaded via the force path either.
Addresses the latest two Codex P1/P2 findings on #742.
* fix(sync-guard): backfill account id from in-memory state for upgrade-path re-auth
Users upgrading to this PR have no netcatty.sync.accountId.* persisted yet.
On their first re-auth the guard saw previousId=null and cleared the
merge base anyway, defeating the point of the same-account preservation.
Snapshot the in-memory account id BEFORE overwriting providers[provider]
and use it as a fallback when the persisted id is missing. New users
(no prior connection at all) still get the clear-on-first-auth path.
Addresses Codex P1 on #742.
* fix(sync-guard): inspect force-push results + mark blocked single-provider as error
- Force-push handler now inspects syncNow result entries: applies any
mergedPayload to local state, only clears the banner when all providers
report success, surfaces a toast error otherwise. Previously the banner
cleared unconditionally regardless of network/auth failures (Codex P1).
- syncToProvider shrink-block branches now mark provider status as
'error' with a 'Sync blocked: would delete too much' message instead
of 'connected'. Status aggregators treat 'connected' as healthy, so
the blocked upload was surfacing as 'synced' in the UI (Codex P2).
syncAllProviders already used this pattern; this brings the
single-provider path in line.
* fix(sync-guard): exempt USE_LOCAL conflict + clear post-merge BLOCKED + expose 'blocked' status
- USE_LOCAL conflict resolution now passes { overrideShrink: true }: the
conflict modal already served as user confirmation, and shrink-blocking
it left users with a closed modal and an opaque banner (Review C-1).
- Post-merge round-trip in useAutoSync now detects shrink-blocked results
and resets syncState to IDLE via new manager.clearShrinkBlockedState().
The merged data is already applied locally; the next user-triggered
sync will re-check, and we don't wedge the manager in BLOCKED with no
visible banner outside the Settings tab (Review I-1).
- overallSyncStatus now reports 'blocked' as a distinct value from
'error', so downstream UI (status icon, future badges) can offer
shrink-block-specific affordances (Review I-2).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(sync-guard): stabilize banner subscription dep + map 'blocked' status to error indicator
- The SyncBlockedBanner subscription useEffect depended on [sync] (the
whole hook return object), which gets a new reference every render.
This caused the listener to be unsubscribed+resubscribed on every
render, opening a tiny race window where a SYNC_BLOCKED_SHRINK event
could be missed and the banner would never appear. Destructure
subscribeToEvents (already useCallback-stable) and depend on it
directly, so the effect runs exactly once on mount.
- SyncStatusButton's status mapping had no arm for the new 'blocked'
value, falling through to 'none' (idle). The global status indicator
said healthy while the in-page banner said paused. Map 'blocked' to
the same error indicator used for 'conflict' so the UI is consistent.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(sync-guard): only clear banner on actual success + hydrate from manager state
- Banner subscription now clears only on SYNC_COMPLETED with result.success.
SYNC_STARTED (auto-sync timer ticks) and SYNC_FORCED (fires BEFORE upload)
could clear the banner prematurely, removing the user's recovery affordance
while the underlying issue was unresolved (Codex P2).
- Manager now persists the last shrink finding in state.lastShrinkFinding
alongside the SYNC_BLOCKED_SHRINK emission. New public getter
getShrinkBlockedFinding() returns it when syncState is BLOCKED. Renderer
hydrates the banner on mount so a block that happened off-screen
(auto-sync while user was on another tab) is still visible when they
open Sync Settings (Codex P2).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(sync-guard): unified BLOCKED-cleared event + USE_LOCAL inspects results
- USE_LOCAL conflict resolution now inspects syncNow() results, applies
any mergedPayload to local state, surfaces a toast error and KEEPS the
modal open on failure (so user can switch to USE_REMOTE). Mirrors the
force-push handler pattern. Without this, USE_LOCAL silently 'succeeded'
even when providers failed (Codex CLI P1).
- New SYNC_BLOCKED_CLEARED event emitted on every BLOCKED -> non-BLOCKED
transition via a private exitBlockedState() helper. Banner subscribes to
this single signal instead of guessing from per-provider SYNC_COMPLETED
events. Fixes:
- Multi-provider scenarios where first SYNC_COMPLETED clears the banner
while a later provider was still going to fail (Codex CLI P1).
- clearShrinkBlockedState() (post-merge self-heal) silently leaving
the banner stuck because no event was emitted (Codex CLI P2).
- disconnectProvider() now also exits BLOCKED state. Disconnecting
implicitly resolves any pending shrink-block warning, otherwise the
stale alert carried over to the next-account reconnect (Codex CLI P2).
- All BLOCKED -> non-BLOCKED transitions consolidated through
exitBlockedState() so lastShrinkFinding cleanup + event emission are
always paired (Codex CLI P3 #6 covered).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(sync-guard): only clear BLOCKED on actual success, not on transient ERROR/SYNCING/CONFLICT
Previous patch called exitBlockedState() at every BLOCKED -> non-BLOCKED
transition, but this clears the banner on transitions that don't actually
resolve the shrink concern:
- SYNCING (sync just started — about to try, may fail)
- ERROR (transient transport failure, shrink concern still real)
- CONFLICT (separate concern; doesn't resolve the shrink)
If a user was in BLOCKED then triggered a sync that failed for an unrelated
reason (network, auth), the banner cleared and they lost the warning.
Restrict exitBlockedState() to terminal-success transitions:
- IDLE on successful upload (data made it to cloud — concern resolved)
- explicit clears (disconnectProvider, clearShrinkBlockedState)
- conflict resolution (USE_REMOTE/USE_LOCAL also end in IDLE)
Found by Codex CLI review of commit
|
||
|
|
8ef91e1266 |
Ctrl+W close priority + local shell busy confirmation (#739)
* feat(ctrl-w): add ps-node + windows-process-tree + tsx deps for close-priority feature * fix(ctrl-w): drop ps-node dep and add windows-process-tree to asarUnpack Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): add ptyProcessTree bridge with per-platform child-process enumeration Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): ptyProcessTree uses args= for full command + warns on pid overwrite - Replace `comm=` with `args=` in defaultListPosix so the full command line is captured on both macOS (BSD ps) and Linux (GNU ps), avoiding the 15-char TASK_COMM_LEN truncation. - Add console.warn in registerPid when the same sessionId is overwritten with a different pid, making the race condition visible in logs. - Add test: registerPid warns exactly once on a pid change, not on a same-pid re-registration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): register local PTY pid with ptyProcessTree on spawn/exit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): unregister pids in cleanupAllSessions to match per-delete invariant Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): add IPC handlers for pty child processes and confirm-close dialog Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): guard BrowserWindow.fromWebContents null and document dialog dismiss contract Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): expose ptyGetChildProcesses and confirmCloseBusy on window.netcatty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): add i18n strings for close-busy-terminal dialog Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): add resolveCloseIntent pure function with 8 unit tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): expose handleCloseSidePanel via ref to App.tsx Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): wire resolveCloseIntent + local-shell busy confirmation into closeTab hotkey Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ctrl-w): add re-entrancy guard, aggregate busy count, sync sidebar ref, dedupe intent branches Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ctrl-w): auto-close workspace when its last session is closed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): sidebar close wins over focused terminal in priority chain Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): sidebar priority applies to single-session tabs too, not just workspaces Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ctrl-w): compute empty-workspace auto-close outside setSessions updater Addresses Codex P2 on #739: React 18+ does not guarantee updater execution timing under concurrent scheduling. Moving the decision outside the updater makes the microtask queue deterministic. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|
|
4574f1e2b2 |
fix: stabilize scoped AI draft/session transitions (#724)
* fix: correct terminal AI history resume behavior
The previous implementation plan mistakenly treated reopening an old terminal AI session in a fresh or reconnected SSH tab as a scope-retargeting feature.
The intended rule is draft-first:
- a fresh or reconnected terminal opens on a blank draft
- older chats remain available in history for manual access
- selecting history does not imply automatic scope transfer into the new tab
This change is a rule correction, not a conflict between product rules.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: harden ai draft transitions
* fix ai session continuation from history
* fix: clear stale activeSessionIdMap entry when view resolves to draft
Addresses the Codex P2 review on aiPanelViewState.ts:38. When a terminal
scope mounts with a persisted activeSessionIdMap entry but no explicit
panelView and no draft, resolveDisplayedPanelView now returns the
default draft view (terminal fresh-start behavior). The sync effect
that writes into activeSessionIdMap is guarded by `if (!activeSession)
return`, so the old entry stays put. That stale entry then leaks into
activeTerminalTargetIds in every other scope, and
getSessionScopeMatchRank uses it to suppress host-matched history that
is actually resumable — so valid sessions vanish from the history
drawer until another action rewrites the map.
Add a dedicated effect that clears the scope's activeSessionIdMap
entry whenever the resolved panel view is draft but a persisted
session id is still present. This keeps the map an accurate record of
"which session each scope is currently showing" instead of a lagging
snapshot.
Also extend sessionScopeMatch.test.ts to cover the rank=2 exact-match
branch and the scope-type mismatch short-circuit, which were missing
from the original suite.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: track cross-terminal session ownership by session id, not targetId
Addresses the Codex follow-up review on commit
|
||
|
|
5bc5a6c8b2 |
fix: address Codex follow-up review on PR #720 (#723)
* fix: address Codex follow-up review on PR #720 Two issues surfaced by Codex's post-merge review of PR #720: P1 — useAutoSync.ts: startup retry exhaustion wedged auto-sync. The retry effect previously returned at `attempt >= 4` without opening `remoteCheckDoneRef`. A session with persistent inspect failures (long network outage, provider rate-limit loop) left auto-sync silently disabled for the rest of the session until restart or provider/unlock transition. After exhaustion, open the gate: the specific dangers we gate-closed against (empty-push, partial-apply push) are now covered by independent guards (`hasMeaningfulSyncData`, the apply-in-progress sentinel, and `checkProviderConflict`'s inspect-failure throw at upload time). This matches manual sync's existing semantic rather than silently strict-gating auto-sync. P2 — CloudSyncSettings.tsx: restore buttons were per-row disabled, not globally. A user could click Row A, then Row B while A was still applying — two concurrent `applyProtectedSyncPayload` calls in the same window. `withRestoreBarrier` serializes across windows but NOT same-window re-entry, so the second restore's sentinel-clear could mask a still-partial first apply. Disable every restore button while any restore is in flight. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: keep auto-sync gate closed on retry exhaust; open on manual sync Codex's re-review of PR #723 correctly flagged that opening the auto-sync gate after startup retry exhaustion reintroduces the destructive-clobber path the gate was supposed to prevent. Concrete scenario: local vault is partially lost (non-empty, just missing entries), remote has not changed since our last anchor, user edits a field after a long outage → auto-sync pushes the partially-lost vault over the intact remote. `checkProviderConflict` doesn't catch this (anchor matches), `hasMeaningfulSyncData` doesn't catch this (non-empty), and the empty-vault prompt doesn't fire. Revert the retry-exhaust gate-open. The gate now stays closed until either: 1. A startup `checkRemoteVersion` succeeds (normal path), OR 2. A `syncNow` completes successfully. A manual sync from Settings implicitly runs per-provider `checkProviderConflict` — the same inspect the startup path would have done — so a successful manual sync is equivalent to a successful startup reconciliation from the gate's point of view and opens the gate for the rest of the session. This preserves Codex's safety ask (no auto-push without a confirmed remote state) while giving the user a clear escape hatch (manual sync) that doesn't require a restart. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
db69d5ac39 |
[codex] Harden sync overwrite protection and add local restore history (#720)
* fix: harden sync overwrite recovery * refactor: separate backup retention settings * refactor: align backup retention controls * refactor: simplify backup retention card * fix: address PR #720 deep-review findings - Close the cross-window restore race by holding a time-bounded barrier in localStorage during every destructive apply; useAutoSync skips pushes while it's set, preventing a pre-restore snapshot from clobbering just-restored cloud data. - Round-trip startup three-way merges so merged-in local additions actually reach the cloud instead of living only on the device that ran the merge until the next edit. - Upgrade sync signatures from a 64-char ciphertext prefix to full SHA-256 (v3), closing the tail-mutation replay weakness. - Harden the vault-backup IPC: payload size cap, enum-validated reason, sanitized version strings, strict maxCount, concurrent-call mutex, monotonic createdAt to avoid same-ms ordering ties. - Extract the anchor-change decision into a pure module with unit tests covering no-anchor, resource-id drift, and signature mismatch paths. - Capture the protective backup from the pre-apply closure snapshot so it reflects what's being replaced rather than what was imported. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address PR #720 follow-up review findings Make protective backup abort-on-failure (was best-effort console.error), preserve nested syncedAt in fingerprint, use UTF-8 byte length for size guard, throw on conflict-inspect failure so stale uploads can't leak through, treat unreadable remote as changed, canonical-JSON signature meta, and hold the version stamp on transient backup failures so the retry path still fires. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address second-pass review findings on PR #720 - Hold version-change stamp when payload is non-meaningful (covers the startup vault-rehydrate race where a transient empty snapshot would permanently skip the upgrade backup). - readBackupRecord stat-checks before readFile so an oversized file in the backup dir cannot OOM the renderer on enumeration. - Reject maxBackups input outside 1..100 instead of silently clamping (matches the i18n error copy and the main-process sanitizer bound). - Wrap USE_LOCAL conflict-resolution push in withRestoreBarrier so a concurrent auto-sync in another window cannot interleave. - sha256Hex throws SyncSignatureUnavailableError on missing WebCrypto subtle; createSyncedFileSignature returns null, forcing the unreadable-remote → three-way-merge path instead of a weak length-only pseudo-signature. - Document that array order in normalizePayloadForHash is an invariant enforced by producers, not the hash function. - Drop three-way-merge completion logs from console.log to console.info. - Comment the implicit restore → store-listener refresh chain so future refactors don't silently break the UI reload path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address third-pass review findings on PR #720 Resolves I-3 through I-8 and related cleanup items identified in the deep review. Highlights: - replace setTimeout(0) post-merge round-trip with a direct syncAllProviders call using the already-computed merged payload, removing the React-commit race - resolve the empty-vault confirmation promise on unmount so a mid-dialog window teardown doesn't leak the resolver - retry the version-change backup as hosts/keys hydrate, instead of latching on the first (possibly empty) snapshot - heartbeat-refresh the cross-window restore barrier so long applies cannot expose a post-60s window to concurrent auto-sync - add a diagnostic warning when connected providers hold divergent bases (multi-account configurations) - surface a user-visible "Sync paused" toast when startup inspect fails, replacing the previous silent gate-open - tie-break backup list sort by id when createdAt collides - extract applyProtectedSyncPayload so the main and settings windows cannot drift on restore-barrier / protective-backup handling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address deep-review findings on PR #720 Deep re-review surfaced six Important issues that survived the prior four review rounds. All are hardened here: - I1: fsync the protective backup file AND its directory before the rename completes, so a system crash between backup creation and the restore it guards cannot leave a torn/zero-length safety net. - I3: persist an apply-in-progress sentinel across the non-atomic localStorage writes in applySyncPayload. A crash mid-apply now surfaces on the next startup (toast + refuse auto-push) instead of silently pushing the half-applied state over an intact cloud copy. - I2: only open the auto-sync gate (remoteCheckDoneRef) when the startup inspect validated cleanly. Add a bounded exponential-backoff retry so a transient inspect failure self-heals instead of wedging auto-sync until restart. - I5: save the sync base BEFORE advancing the per-provider anchor inside uploadToProvider. A renderer crash between the two writes now degrades to "stale anchor forces re-inspect on next run," which re-merges against the fresh base — eliminating the silent base-drift window where a 3rd-device race could misclassify entries. - I6: main process broadcasts a vaultBackups:changed IPC event on every mutation; useLocalVaultBackups subscribes so protective backups created from the main window show up in the Settings backup list without manual refresh. - I4: update PR description + code comment to match the actual (safer) design: auto-sync gate opens on vault init, with hasMeaningfulSyncData + restore barrier preventing empty-push; the version-change backup is best-effort and retries as data hydrates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: serialize startup checkRemoteVersion and stabilize its deps Re-review flagged that checkRemoteVersion's useCallback depended on `config` — a fresh object literal from App.tsx on every render — so the retry effect restarted with attempt=0 on every vault edit and could spawn overlapping in-flight inspect+apply runs. Two concurrent commitRemoteInspection + onApplyPayload calls could race on the apply-in-progress sentinel around interleaved writes. Route `buildPayload`, `config.onApplyPayload`, and `config.startupReady` through refs so checkRemoteVersion's identity no longer churns with unrelated App state. Add an in-flight guard that returns early when a previous invocation is still awaiting the network, closing the same-window re-entry gap that withRestoreBarrier intentionally doesn't cover. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: release in-flight lock on no-connected-provider early return Third-pass review caught that `checkRemoteInFlightRef` was acquired before the `!connectedProvider` check, so that early return leaked the lock and every subsequent retry-timer tick silently no-op'd. Move the acquisition past the early return so the only path that takes the lock reaches the finally-release. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
1ca2cd8ec2 |
feat: add "paste selection" terminal command with bindable shortcut
Adds a new terminal action that pastes the terminal's current selection at the cursor without going through the system clipboard — the equivalent of X11 PRIMARY-selection paste. Default shortcut: ⌘ + Shift + X / Ctrl + Shift + X. Also surfaces the action in the terminal right-click menu, disabled when there is no selection. Does not change middle-click paste behavior. Closes #637 |
||
|
|
363f03a92d | fix ai draft scope state updates | ||
|
|
c5d15a14c9 |
fix: avoid orphaned AI session storage churn
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
75dc3dd72b |
feat: scope AI draft and session resume state
- persist drafts, panel views, and active sessions per terminal/workspace scope - restore scoped AI session selection on reconnect and cold mount - prefer unsent drafts over implicit history fallback - avoid redundant active session map rewrites during scoped cleanup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
af2589e60b |
Merge pull request #704 from tces1/MoreSkills
feat: add Netcatty user skills scanning and chat selection flow |
||
|
|
f89afc0e05 |
feat: add setting to hide the standalone SFTP top tab
Adds a "Show SFTP tab" toggle in Settings → Appearance (under the Vault section) that controls visibility of the standalone SFTP view in the top tab bar. When disabled: - The SFTP tab is removed from the top tab strip. - The openSftp hotkey (Ctrl+Shift+O / ⌘⇧O) becomes a no-op. - If the user is currently on the SFTP tab, the active tab auto- switches to Vaults. The in-session SFTP side panel (opened from the terminal toolbar) is unaffected — that is the surface users keep when they hide the top-level tab. Setting persists via localStorage, syncs across windows, and is included in the cloud SyncPayload alongside the existing Vault visibility toggles (showRecentHosts, showOnlyUngroupedHostsInRoot). Default: on. Addresses the first ask in #690. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
8e6392e503 | persist vault root filter toggles immediately | ||
|
|
8b99f2411f | fix vault root host filter sync and empty states | ||
|
|
84423a0096 | fix: resolve TypeScript errors and optimize User Skills with async IO | ||
|
|
c3c579b8a0 | fix: close remaining theme sync gaps | ||
|
|
75bbd1f300 | fix: preserve theme inheritance and modal rollback | ||
|
|
76d37d982a |
fix: upgrade-safe default + cross-window broadcast for follow-theme
P1: Follow mode defaulted ON when the storage key was missing, which is true for ALL existing users after upgrade (not just fresh installs). Now checks whether a terminal theme was already stored — if so, this is an upgrade and we default OFF to preserve the user's manual choice. Only genuinely fresh installs (no terminal theme in storage) default to ON. P2: The follow-theme persist effect now calls notifySettingsChanged and a matching branch in the cross-window storage event handler syncs the toggle state across windows, matching the pattern used by all other terminal settings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
6d2f3f28c0 |
feat: add "Follow Application Theme" for terminal + 14 UI-matched terminal themes (#675)
When enabled (default for new users), the terminal theme automatically switches to match the active app UI theme — so the terminal background blends seamlessly with the app chrome, regardless of which UI theme preset the user picks (Snow, Midnight, Forest, etc.). ## New terminal themes (14) Each built-in UI theme preset now has a corresponding terminal theme with an exactly matching background color: Light: ui-snow, ui-pure-white, ui-ivory, ui-mist, ui-mint, ui-sand, ui-lavender — ANSI palette based on netcatty-light with per-theme cursor colors that complement the UI accent. Dark: ui-pure-black, ui-midnight, ui-deep-blue, ui-vscode, ui-graphite, ui-obsidian, ui-forest — ANSI palette based on netcatty-dark with accent-matched cursors and selections. ## "Follow Application Theme" setting - New toggle in Settings → Terminal → Theme section - Default ON for new users, persisted in localStorage - When ON: terminal theme auto-derived from the active UI theme via a mapping table in domain/terminalAppearance.ts - When OFF: manual theme selector shown (existing behavior) - Switching the app between light/dark (or changing the UI theme preset) instantly updates the terminal theme ## Files changed (9) - terminalThemes.ts: +14 theme definitions - terminalAppearance.ts: UI→terminal mapping table + getTerminalThemeForUiTheme() - useSettingsState.ts: followAppTerminalTheme state + persist + currentTerminalTheme derivation - storageKeys.ts: new storage key - SettingsTerminalTab.tsx: toggle UI + conditional theme selector - SettingsPage.tsx: pass new props - App.tsx: destructure new state - en.ts + zh-CN.ts: 2 new i18n keys Closes #675 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
c771979178 |
Add Skills + CLI mode for external agents (#599)
* Add Skills + CLI external agent workflow * feat: add Skills + CLI transport for ACP agents * chore: remove branch-local compatibility shims |
||
|
|
58c651500e |
feat: add Gist revision history UI for vault restore (#685)
* feat: add Gist revision history UI for vault restore (#679) Adds a "History" button on the GitHub Gist provider card in Settings → Sync & Cloud. Clicking it opens a modal that lists all Gist revisions (newest first) and lets the user preview and restore any historical version with one click. ## How it works 1. The GitHub API already returns a `history` array when fetching a Gist (`GET /gists/{id}`). The existing `getGistHistory()` reads this. A new `downloadGistRevision(sha)` function fetches a specific revision via `GET /gists/{id}/{sha}`. 2. CloudSyncManager exposes `getGistRevisionHistory()` (metadata only, no decryption) and `downloadGistRevision(sha)` (decrypt + return payload and preview counts). 3. useCloudSync threads both methods through to the UI. 4. CloudSyncSettings renders a three-state modal: - **Loading**: spinner while fetching revision list - **Revision list**: clickable rows with SHA prefix + date, "Current" badge on the latest - **Preview**: after clicking a revision, shows entity counts (hosts, keys, snippets, identities) and a "Restore This Version" button 5. Decryption uses the current master password. If the revision was encrypted with a different password (user changed it since then), a clear error message is shown instead of a crash. ## Changes - `GitHubAdapter.ts`: add `downloadGistRevision()` standalone function + `getHistory()` / `downloadRevision()` class methods - `CloudSyncManager.ts`: add `getGistRevisionHistory()` and `downloadGistRevision(sha)` with decrypt + preview - `useCloudSync.ts`: expose both methods - `CloudSyncSettings.tsx`: add `extraActions` slot to ProviderCard, render "History" button on GitHub card, revision history modal with list → preview → restore flow - `en.ts` + `zh-CN.ts`: 18 new i18n keys for the modal Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use getConnectedAdapter and lazy gist discovery for history APIs P1: CloudSyncManager's history methods accessed this.adapters directly instead of getConnectedAdapter(), which lazily initializes adapters. After an app restart the adapter map is empty even though the provider is persisted as connected, making history fail until another sync path initializes it. P2: GitHubAdapter.getHistory() and downloadRevision() bailed early when gistId was missing, unlike download() which calls findSyncGist() to lazily discover it. Users whose gist was created after initial setup would see no revisions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address round-2 codex review on PR #685 P1: Renamed cloudSync.history.* keys to cloudSync.revisionHistory.* to avoid duplicate key collision with the existing "Sync History" section title. P2: Added getGistRevisionHistory and downloadGistRevision to the CloudSyncHook type interface so the hook contract matches reality. P2: Simplified decrypt error handling — any error from the decrypt path now shows the friendly "cannot decrypt" message rather than relying on fragile substring matching. P2: Clear historyRevisions on each handleOpenHistory call so stale data doesn't linger under error banners on retry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: restore correct i18n key for Sync History section title The sed rename pass accidentally changed the Sync History panel heading (line 1290) from cloudSync.history.title to cloudSync.revisionHistory.title. Restored the original key so the two sections have distinct titles. Also removed unused err parameter in the catch block. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
bcf653dd2e |
fix: prevent empty vault from overwriting cloud data on startup (#683)
* fix: prevent empty vault from overwriting cloud data on startup (#679) Fixes a data-loss scenario where an empty local vault (caused by an update, storage corruption, or import failure) silently overwrites a non-empty cloud vault on startup via auto-sync. The root cause is a startup timing race: the debounced auto-sync effect (3s after data change) can fire before checkRemoteVersion (1s delay + async download) completes its remote pull. When the local vault is empty, this pushes an empty payload to the Gist, permanently erasing the user's data. Four complementary fixes: A. Empty vault push guard (useAutoSync syncNow): Auto-sync refuses to push a payload where hosts, keys, snippets, and identities are ALL empty. Manual sync from Settings is still allowed for the rare case where the user intentionally emptied everything. Prevents the most dangerous path. B. Skip redundant post-merge push (useAutoSync checkRemoteVersion): After applying a three-way merge result from the remote, set skipNextSyncRef so the data-change effect does not immediately re-upload the same payload. Removes one unnecessary API call per startup sync. C. Gate auto-sync on remote check completion (useAutoSync effect): Added remoteCheckDoneRef — the debounced auto-sync effect will not fire until checkRemoteVersion has completed (success or failure). This closes the timing window entirely: an empty vault can no longer race ahead of the remote pull. D. Empty-vault-vs-cloud confirmation dialog (App.tsx + useAutoSync): When checkRemoteVersion detects local is empty but cloud has data, it pauses and shows a root-level dialog with two options: - "Restore from Cloud" (recommended) — applies the remote payload - "Keep Empty" — starts fresh with an empty vault The dialog blocks the sync flow via a Promise that resolves when the user picks an option. This gives users explicit control over a situation that previously happened silently behind their backs. Also adds en + zh-CN i18n strings for the new dialog and toast messages. Closes #679 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address codex review on PR #683 P1-1: Unified isPayloadEffectivelyEmpty helper covering all synced entity arrays (hosts, keys, snippets, identities, customGroups, snippetPackages, portForwardingRules, knownHosts, groupConfigs). Replaces the three inline checks in syncNow and checkRemoteVersion that only covered hosts/keys/snippets/identities. P1-2: Replaced hand-rolled overlay div with the project's existing Dialog/DialogContent/DialogHeader/DialogFooter components. This adds role="dialog", aria-modal, focus trap, and ESC-key dismiss for free. Used lucide-react AlertTriangle/Download/Trash2 icons instead of inline SVGs. P2-1: Guard against double-resolve in resolveEmptyVaultConflict by nulling the ref immediately on first call. P2-2: Replaced hardcoded "N hosts, N keys, N snippets" with an i18n key using interpolation (cloudSummary) so the count text is properly translated in zh-CN. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address round-2 codex review on PR #683 P1: isPayloadEffectivelyEmpty now also checks the settings object. A vault with only settings (e.g. custom theme, font size) and zero hosts/keys/snippets is no longer treated as empty. P1: Dialog accessibility — use hideCloseButton to remove the non- functional close button, onEscapeKeyDown + onOpenChange prevent dismiss (the user MUST choose an option), and wrap the description in DialogDescription so aria-describedby is properly linked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use single-brace interpolation syntax for cloudSummary i18n key The project's i18n system uses single-brace placeholders ({var}), not double-brace ({{var}}). The double-brace syntax was rendering as raw text instead of being interpolated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
e8b9122270 |
feat: auto-detect network devices from SSH banner and skip stats polling (#680)
* feat: auto-detect network devices from SSH banner and skip stats polling (#674) Fixes rapid AAA session churn reported on Cisco/HPE/similar network devices running Netcatty. The root cause was two separate polls that both open fresh exec channels (each counted as its own AAA session on many network devices): - runDistroDetection() opens a brand new SSH connection every time a host connects to run `cat /etc/os-release || uname -a` - useServerStats polls `conn.exec(statsCommand)` every 5 seconds Both commands fail on non-POSIX CLIs, but the channels still hit AAA. This change avoids both by reading the SSH server identification string that ssh2 already captures during the handshake (`conn._remoteVer`). No extra network round-trips, zero additional AAA entries. ## Changes **sshBridge.cjs** - Store `conn._remoteVer` on the session object at connect time as `session.remoteSshVersion` - New IPC handler `netcatty:ssh:remoteInfo` (`getSessionRemoteInfo`) returning the captured SSH server software string **preload.cjs / global.d.ts / useTerminalBackend.ts** - Thread `getSessionRemoteInfo(sessionId)` through to the renderer **domain/host.ts** - `NETWORK_DEVICE_OPTIONS` constant listing the vendor IDs we can recognize (cisco, juniper, huawei, hpe, mikrotik, fortinet, paloalto, zyxel) - `detectVendorFromSshVersion()` — pure function that parses an SSH server software string and returns a vendor ID or ''. Pattern set is sourced from Nmap nmap-service-probes (authoritative), the ssh-audit software.py reference, and vendor docs; see code comments for the exact matches used. - `classifyDistroId()` returns `linux-like | network-device | other` so features that require a POSIX shell can gate on the result. **createTerminalSessionStarters.ts (runDistroDetection)** - Before running the /etc/os-release probe, call `getSessionRemoteInfo` on the already-connected session and feed the banner into `detectVendorFromSshVersion`. If the vendor maps to a known network device, emit the vendor ID via the existing `onOsDetected` callback and skip the shell probe entirely. For unknown or generic OpenSSH/Dropbear banners the existing behavior is preserved. **Terminal.tsx** - `isSupportedOs` now derives from `classifyDistroId(effectiveDistro)` combined with `host.deviceType !== 'network'`, so neither explicit network-device hosts nor banner-detected ones trigger the stats polling loop. **useServerStats.ts** - Add a consecutive-failure counter. After 3 consecutive failed polls, stop the interval for this session (reset on disconnect / sessionId change / settings toggle). This is the fallback for hosts the banner classifier cannot identify (Juniper JUNOS, Cisco NX-OS, Arista EOS — all present as plain `OpenSSH_*` but do not support the POSIX stats pipeline). **DistroAvatar.tsx / HostDetailsPanel.tsx** - Add 8 network-device vendor icons (Cisco, Juniper, Huawei, HPE, MikroTik, Fortinet, Palo Alto, ZyXEL) alongside the existing Linux distro icons, with brand colors. Icons sourced from Simple Icons (CC0) where available; HPE and ZyXEL use simple abbreviation placeholders. - Network device vendors are added to the manual distro override dropdown so users can pin an icon even if their device has an exotic banner we don't auto-detect. **i18n** - English + Chinese labels for the new vendor options in the Host Details distro selector. Closes #674 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: gate network-device detection on raw host.distro, not manual icon override Per Codex review on PR #680: the stats-polling gate was passing `host` through getEffectiveHostDistro() before classifying, which honors the manual distro override (`distroMode: 'manual'` + `manualDistro`). That meant a user who previously pinned an "ubuntu" icon on a host that later gets banner-detected as Cisco would still be classified as linux-like and keep generating the AAA session flood #674 is meant to eliminate. Separate display from gating: - Display (DistroAvatar, host cards): keeps using getEffectiveHostDistro so users can cosmetically override the icon. - Gating (useServerStats via Terminal.tsx isSupportedOs): reads host.distro directly — the value populated by banner detection — alongside the explicit host.deviceType flag. Manual icon choice can no longer re-enable polling on a detected network device. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: guard distro detection against stale session timers Per Codex review on PR #680: runDistroDetection is scheduled on a 600ms setTimeout after connection and also makes async calls of its own. A quick disconnect + reconnect on the same session slot could fire the old timer against the new session, reading host B's SSH banner via getSessionRemoteInfo and writing host B's vendor onto host A's distro field — wrong icon and wrong stats-polling state. Follow the same pattern already used for the startup-command timer in this file (scheduledSessionId captured at schedule time, checked inside the timer). Capture `id` at schedule time, bail out if ctx.sessionRef.current no longer matches, and re-check after every async await inside runDistroDetection so that a reconnect during the banner fetch or the os-release probe also bails cleanly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address local codex review on PR #680 Addresses three issues found in a local Codex review pass after the remote reviewer gate was flaky: ## P0 — session tokens instead of sessionId for stale-timer guard The previous guard captured `id` returned from startSSHSession and compared against `ctx.sessionRef.current` inside the setTimeout and the async runDistroDetection. But the renderer passes `sessionId: ctx.sessionId` into startSSHSession (see createTerminalSessionStarters.ts:543), meaning a tab reuses the SAME sessionId across disconnect+reconnect. The comparison `T1 === T1` always passed, so the guard was a no-op. Replaced with a module-level Map<sessionId, object> that stores the live "connection token" for each sessionId slot. Each call to startSSH mints a fresh `{}` token and overwrites the entry. Timers and async continuations compare their captured token against the current map value by reference — a reconnect replaces the map entry with a new token, so stale callbacks bail cleanly. ## P1 — run os-release probe on the existing SSH connection The fallback /etc/os-release probe used `execCommand` which creates a brand-new SSHClient() on every call. On network devices that present as plain `OpenSSH_*` and fall through to this step (JUNOS, NX-OS, EOS) it added one extra full-auth AAA session log entry per connect, in addition to the failing stats polls. Added `getSessionDistroInfo(sessionId)` as a new IPC handler that runs the same probe via `session.conn.exec()` — an exec channel on the already-open connection, no new handshake. Plumbed through preload.cjs, global.d.ts, and useTerminalBackend.ts. runDistroDetection uses this instead of execCommand in the fallback path, also removing the unused auth-credentials argument (we are no longer opening a new connection, so no credentials are needed). ## P2.1 — don't re-arm timers after giving up After the consecutive-failure counter trips, useServerStats cleared the interval but a subsequent effect rerun (visibility change, settings tweak, etc.) would schedule a fresh `setTimeout` and `setInterval` that would just call the early-return path forever. The scheduling block now checks `givenUpRef.current` before arming either timer. The flag is still cleared on the normal disconnect / sessionId-change reset path so a reconnect gets a fresh attempt. ## P2.2 — drop the ambiguous IPSSH-* → cisco mapping Nmap's `match ssh m|^SSH-([\d.]+)-IPSSH-` line is labelled as `Cisco/3com IPSSHd` — it cannot identify a specific vendor from the banner alone. Mapping it to `cisco` would risk showing the wrong vendor icon on a 3Com device. Removed the rule entirely and documented why with a code comment; users with such devices can still use the Host Details manual distro override. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address remaining gaps from local codex follow-up review P0 gap — delete connection token on session exit. Previously the map entry lingered after disconnect, so a very late-firing timer could still pass the isConnectionTokenCurrent check even though the session no longer existed. Functionally harmless (the IPC calls would fail) but semantically wrong. Now connectionTokensBySessionId.delete() is called in the onSessionExit handler. P1 new — exec channel leak on timeout in getSessionDistroInfo. The timeout branch resolved the promise but didn't close the stream, so a hanging remote command would leave the exec channel open until the SSH connection itself dropped. Added a settled guard (resolve-once) and stream.close() on timeout. P2.1 gap — givenUpRef not reset on sessionId change. The failure counter reset only happened in the !isConnected branch of the main effect, so a sessionId swap while still connected (rare, but possible if the tab reconnects without toggling connected state) would permanently suppress polling. Added a small dedicated effect that resets both counters when sessionId changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
60071424d0 |
fix: prevent crash when clicking external links with no default browser (#676)
* fix: prevent crash when clicking external links with no default browser (#663) On systems like Tiny11 where no default browser is associated with http/https URLs, shell.openExternal() rejects with Windows error 0x483 ("No application is associated..."). The main process treated that rejection as an unhandledRejection, which the global handler re-throws as fatal, crashing the entire app. Root cause: windowManager.cjs used `void shell?.openExternal?.(url)` inside a try/catch, assuming the try would cover the call. `void` only discards the returned Promise — it does not catch async rejections, so when openExternal rejected, the error escaped as a floating unhandledRejection. The IPC handler in main.cjs (`netcatty:openExternal`) also awaited shell.openExternal() without any try/catch. Electron's ipcMain.handle forwards rejections to the renderer over IPC, but the renderer-side fallback called `window.open()`, which re-entered the same buggy windowManager path — and that is where the process actually died. Changes: - windowManager.cjs: attach an explicit `.catch` on the openExternal Promise in both createExternalOnlyWindowOpenHandler and createAppWindowOpenHandler so rejections cannot propagate. - main.cjs: wrap the IPC handler in try/catch and return a structured { success, error } result instead of throwing. This lets the renderer render an informative message. - global.d.ts: update the openExternal return type to match. - useApplicationBackend.ts: read the structured result and throw on failure so callers can react; drop the now-redundant window.open() fallback for the Electron branch (kept only for non-Electron envs). - SettingsApplicationTab.tsx: show a friendly toast ("No default browser configured — please set one in system settings") when openExternal fails, instead of the previous silent failure. - i18n: add en + zh-CN strings for the toast. Closes #663 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: fall back to in-app browser window when system has no default browser Instead of showing a toast when shell.openExternal() fails (e.g. Tiny11 with no default browser), open the URL in a minimal in-app BrowserWindow so users can still read the linked page. windowManager.cjs now exposes: - openFallbackBrowser(url, opts): creates a stripped-down BrowserWindow that loads the URL. No preload script (remote content must never touch contextBridge), contextIsolation/nodeIntegration/sandbox all set to safe defaults, and an isolated persist:netcatty-fallback-browser session so cookies and storage do not leak into the main app. Basic Alt+Left / Alt+Right / Ctrl-or-Cmd+R shortcuts for navigation and reload. - tryOpenExternalWithFallback(shell, url, opts): tries shell.openExternal first; on rejection, falls back to openFallbackBrowser. Returns { success, fallback?: "in-app-browser" }. All three external-URL call paths now route through this helper: - main.cjs netcatty:openExternal IPC handler - createExternalOnlyWindowOpenHandler (popup blocker for child windows) - createAppWindowOpenHandler (main/settings window window-open handler) The renderer-side toast is retained as a last-resort for the rare case that both system and in-app browsers fail (e.g. BrowserWindow creation error). Copy updated to reflect the new behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: preserve rejection semantics for failed external opens Per Codex review on PR #676: returning { success, error } from bridge.openExternal changed the contract from "reject on failure" to "resolve with a failure object on failure", which silently broke callers that rely on rejection to abort flows. useCloudSync's OAuth path is the clearest example: it wraps bridge.openExternal in a try/catch and rejects browserPromise inside the catch. With the resolved-failure contract, that catch never fires, so Promise.race([callbackPromise, browserPromise]) can hang indefinitely when no browser is available. Revert the contract: - tryOpenExternalWithFallback resolves void on success (system browser or in-app fallback) and throws on total failure - main.cjs IPC handler awaits and lets rejections propagate - global.d.ts openExternal is Promise<void> again - useApplicationBackend just awaits — rejections propagate naturally - SettingsApplicationTab's existing try/catch + toast continues to work as before Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: propagate fallback browser loadURL failures Per Codex P2: openFallbackBrowser swallowed loadURL rejections by attaching a .catch that only logged, so any caller using tryOpenExternalWithFallback as a success signal saw an opened window as success even when the page failed to load. OAuth flows would then wait for the downstream callback timeout instead of canceling early on malformed or unreachable URLs. openFallbackBrowser now returns { window, loaded } where `loaded` is the raw loadURL Promise, and tryOpenExternalWithFallback awaits it in the fallback path. On initial load failure, the broken window is closed and the original shell.openExternal error is re-thrown. The internal popup handler inside the fallback window keeps its fire-and-forget behavior (it must return synchronously) but now explicitly catches the loaded rejection to avoid unhandledRejection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
844c55e99d |
fix: sync built-in editor theme with terminal theme in immersive mode (#623) (#624)
The Monaco editor only synced background color from CSS variables and missed foreground, cursor, selection, line numbers, and widget colors. Additionally, switching between terminal themes of the same type (e.g. two dark themes) did not trigger an editor theme update because the MutationObserver only watched class/style attributes on <html>. - Read 6 CSS variables (bg, fg, primary, card, muted-fg, border) and map them to 14 Monaco theme color tokens - Set data-immersive-theme attribute on <html> when immersive mode applies a theme, so the MutationObserver detects same-type theme switches - Clean up the data attribute when immersive mode is removed Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
6ac36be04b | feat: local shell selection with auto-discovery (#605) | ||
|
|
762255443b |
fix: deduplicate font list when local fonts overlap with built-in fonts (#586) (#603)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
7efb6d2adb |
fix: remove remaining isImmersive reference in useImmersiveMode
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
33f8221d5c |
refactor: remove immersive mode toggle remnants — always enabled
Immersive mode was already hardcoded to true with a no-op setter. Clean up all dead code: - Remove isImmersive param from useImmersiveMode hook - Remove immersiveMode/setImmersiveMode from useSettingsState - Remove toggle from SettingsPage and SettingsAppearanceTab - Remove sync read/write of immersiveMode setting - Remove i18n keys for the removed toggle - Simplify App.tsx conditionals Kept: useImmersiveMode hook (core logic), CSS classes (fade overlay), sync type field (backward compat), storage key. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
2f314c3588 |
feat: group configuration inheritance (#220) (#593)
* feat(i18n): add translations for group config panel * feat(models): add GroupConfig data model, resolution logic, and encryption Add the GroupConfig interface for group-level default settings that hosts inherit. Includes ancestor-chain resolution (A/B/C merges from A, A/B, A/B/C), host-level application logic, storage key, and secure field encryption/decryption for sensitive GroupConfig fields. Part of #220. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(state): add groupConfigs state management with encryption Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(ui): create GroupDetailsPanel with full config editing Side panel for editing group-level default configuration using AsidePanel. Includes General, SSH, Telnet, Advanced, Mosh, and Appearance sections with sub-panel navigation for Proxy, Chain, EnvVars, and Theme selection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(vault): wire GroupDetailsPanel, replace rename dialog with full config panel Replace all group rename dialog triggers with the new GroupDetailsPanel sidebar. The hover edit button, context menu, and tree view edit callbacks now open the full group configuration panel instead of a simple rename dialog. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(connect): apply group config defaults at connection time When connecting to a host, merge group-level default configuration so hosts inherit their group's settings for auth, protocol, appearance, and other inheritable fields. Connection logs still reference the original host's label/hostname. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(sync): include groupConfigs in sync and export payloads Add groupConfigs to SyncPayload, SyncableVaultData, buildSyncPayload, and applySyncPayload so group connection defaults are preserved during cloud sync and data import/export. Also wire groupConfigs into the vault object in SettingsPage so it flows through to the sync payload builder. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(vault): update group configs on move and delete * feat(host-panel): show inherited group defaults as placeholders When editing a host that belongs to a group with configuration, group default values now appear as placeholder text in username, startup command, and charset fields where the host doesn't have its own value. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: clean up unused imports in GroupDetailsPanel Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(group-panel): add/remove protocol sections, editable parent group - SSH and Telnet sections are now add/remove — click "Add Protocol" to enable, "..." menu to remove. Only enabled protocols override hosts. - Parent Group is now editable via Combobox dropdown for quick group moving. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: move SSH-specific fields into SSH protocol section Startup Command, Legacy Algorithms, Proxy, Host Chaining, Environment Variables, and Mosh are all SSH-specific and now only visible when SSH protocol is added. Only Charset remains as a shared field in the Advanced section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: hide charset and appearance when no protocol is added Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: close Add Protocol dropdown after selection Use controlled open state to explicitly close the dropdown when a protocol is selected, preventing residual content from overlapping the newly rendered section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: apply group defaults in TerminalLayer sessionHostsMap Terminal component was re-reading the original host from the hosts array by hostId, bypassing the group defaults applied in handleConnectToHost. Now sessionHostsMap applies resolveGroupDefaults + applyGroupDefaults when building the host object for each session, so Terminal sees the merged credentials/settings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: move Add Protocol to bottom, fix i18n for protocol/font labels - Add Protocol button moved below Appearance section - Added i18n keys: addProtocol, removeProtocol, fontFamily, fontSize - All hardcoded English strings replaced with t() calls Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: replace font family text input with TerminalFontSelect dropdown Use the same font selector component as settings, showing available terminal fonts with preview. Includes "Use Global" reset button. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(group-panel): match HostDetailsPanel key/certificate selection pattern Replace the simple Combobox key selector with the same credential selection flow used in HostDetailsPanel: a popover with Key/Certificate options, inline combobox per type, and proper badge display with certificate icon. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(group-panel): add Local Key File option to credential selection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(group-panel): add identityFilePaths to GroupConfig and Local Key File option - Added identityFilePaths to GroupConfig interface and INHERITABLE_KEYS - GroupDetailsPanel now supports Key, Certificate, and Local Key File credential selection, matching HostDetailsPanel's full credential flow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: prevent local key file input from overflowing panel width Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: constrain local key file input width with w-0 flex-1 Native input elements have a large default min-width. Using w-0 with flex-1 forces the input to shrink within the flex container. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add overflow-hidden to SSH Card to contain local key file input Matches HostDetailsPanel's Card which uses overflow-hidden on the credentials section to prevent long file paths from overflowing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add min-w-0 to key file path row for proper text truncation Flex children need min-w-0 for truncate to work correctly, otherwise the text pushes the container wider. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: force key file path text truncation with inline max-width calc Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use fixed 320px max-width on key file path text to force truncation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add overflow-hidden to AsidePanelContent to prevent content overflow The root cause was the inner div of AsidePanelContent only had overflow-x-hidden which was being overridden by ScrollArea's viewport. Changed to full overflow-hidden with w-full box-border. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: override Radix ScrollArea viewport's display:table in AsidePanel Radix ScrollArea Viewport wraps content in a div with display:table and min-width:100%, causing content to expand beyond the panel width. Override this on AsidePanelContent's ScrollArea to use display:block and min-width:0 instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: critical issues — seed new hosts from group defaults, validate group names, fix empty import - HostDetailsPanel: When groupDefaults has values for port/username/charset, new hosts start with undefined/empty so group defaults take effect via applyGroupDefaults() instead of being blocked by hardcoded values - GroupDetailsPanel: Validate group name in handleSubmit to reject '/' and '\' characters, matching the old rename dialog behavior, with visual error - useVaultState: Check groupConfigs !== undefined instead of truthy so that importing an empty array [] properly clears all group configs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: safe prefix replacement, remove dead code, extract shared resolveEffectiveHost - Replace all .replace(oldPath, newPath) / .replace(sourcePath, newPath) with explicit prefix slicing (newPath + str.slice(oldPath.length)) in handleSaveGroupConfig and moveGroup for more robust path renaming - Remove dead c.path === oldPath branch in finalConfigs mapping since updatedConfigs already contains the config with newPath - Extract resolveEffectiveHost helper in App.tsx to deduplicate group defaults resolution in _handleTrayPanelConnect and handleConnectToHost Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: preserve undefined port on save when group has port default form.port || 22 was forcing port to 22 even when intentionally left undefined for group inheritance. Now uses nullish coalescing and only defaults to 22 when no group port default exists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: SSH-adjacent field detection, chain host defaults, telnet inheritance, theme clear - hasSshFields() now checks proxyConfig, hostChain, startupCommand, legacyAlgorithms, environmentVariables, moshEnabled, moshServerPath, and identityFilePaths so the SSH section auto-opens when editing - Chain hosts in sessionChainHostsMap now get group defaults applied via resolveGroupDefaults + applyGroupDefaults - Added telnetEnabled to GroupConfig interface and INHERITABLE_KEYS; save handler sets telnetEnabled: true when Telnet section is on - Theme/font "Use global" clear now sets override to false instead of undefined, preventing parent group theme from leaking through Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: review round 4 — sync, SFTP, port forwarding, type safety, UX - Scan groupConfigs in encrypted credential guard (P1 security) - Add groupConfigs to auto-sync payload and three-way merge (P1 sync) - Apply group defaults in SFTP connections (P1 SFTP) - Apply group defaults in all port forwarding paths (P1 port forwarding) - Make Host.port optional to fix unsafe type cast (P1 type safety) - Fix port input empty → 0 instead of undefined (P2) - Add port placeholder showing inherited value (P2) - Mutual exclusion of group/host detail panels (P2) - Fix sub-panel width jump 420px → 380px (P2) - Validate duplicate group path on rename/reparent (P2) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: review round 5 — null guard, empty array inheritance, memo comparator, form reset - Guard groupConfigs import against null payload (P1 crash) - Validate duplicate path on moveGroup drag-drop (P2 data corruption) - Clear empty environmentVariables to undefined for group inheritance (P1) - Clear empty hostChain to undefined for group inheritance (P2) - Add groupConfigs to SftpView memo comparator (P1 stale defaults) - Add key={editingGroupPath} to GroupDetailsPanel for form reset (P1) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: review round 6 — copy credentials, protocol dialog use effective host - Apply group defaults in handleCopyCredentials (P2) - Apply group defaults in hasMultipleProtocols check (P2) - Pass effective host to ProtocolSelectDialog (P2) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: serialize protocol:'ssh' marker to persist SSH section in group config - Add protocol:'ssh' as marker field in handleSubmit SSH block - Detect protocol:'ssh' in hasSshFields() to preserve section on reopen - Clean up protocol field in removeSsh() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
c7ae51b952 |
feat: host/group management improvements (#506) (#589)
* feat(models): add pinned and lastConnectedAt fields to Host Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(i18n): add translations for pinned and recently connected sections Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(vault): add pin toggle, lastConnectedAt tracking, and computed sections Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(vault): render Pinned and Recently Connected sections at root level Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(vault): add pin/unpin context menus and hover edit buttons in all views Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(vault): make breadcrumb a drop target for moving groups back to root Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(settings): add toggle for showing recently connected hosts section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: resolve lint warnings for unused vars and unnecessary dependency Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: improve pin performance and add pop-in animation - Use ref for hosts in callbacks to avoid stale closures and unnecessary re-renders when hosts array changes - Add pop-in spring animation on pinned host cards with staggered delay for a satisfying visual effect Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: fix pop-in animation visibility and improve pin responsiveness - Move @keyframes pop-in out of @layer base to global scope so inline styles can reference it - Add translateY to animation for a bouncier, more satisfying feel - Use pinnedAnimKey to force card remount on pin changes so animation replays each time - Wrap onUpdateHosts in startTransition for non-blocking pin updates Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: only animate newly pinned card, increase section spacing - Track lastPinnedId instead of global animKey so only the newly pinned card gets the pop-in animation, not all existing pinned cards - Clear animation state via onAnimationEnd for clean re-trigger - Add mb-4 to Pinned and Recent sections for better visual separation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(vault): show pin indicator icon on pinned host cards Small semi-transparent pin icon in top-right corner of pinned host cards in the Hosts section (grid view only). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: use solid amber/yellow pin indicator icon Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: tilt pin indicator icon 45 degrees Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: replace pin indicator with filled amber star on all pinned cards Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: move lastConnectedAt tracking to App-level handleConnectToHost Previously updating lastConnectedAt in VaultView's handleHostConnect which could be lost during tab switches. Now tracked at the App level where all connections are handled, ensuring the timestamp persists regardless of UI navigation state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address Codex review findings (P2 issues) 1. useStoredBoolean now syncs across same-window components via CustomEvent dispatch, so Settings toggle immediately updates VaultView 2. lastConnectedAt updated after connectToHost succeeds, not before 3. Pinned and Recently Connected sections now respect active search and tag filters Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address second round Codex review findings 1. Track lastConnectedAt on actual 'connected' status instead of session creation - handles via handleSessionStatusChange wrapper 2. Covers tray panel connections since all paths go through updateSessionStatus 3. Pinned/Recent cards now honor multi-select mode with checkbox UI instead of triggering connections Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address third round Codex review findings 1. [P1] Use hostsRef in handleSessionStatusChange to avoid overwriting concurrent host changes with stale snapshot 2. [P2] Exclude pinned/recent hosts from main host list at root level to prevent duplicate cards on screen 3. [P2] Remove Pin action from tree view context menu since tree view has no pinned ordering/indicator support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address fourth round Codex review findings 1. [P1] Remove leftover onToggleHostPinned references in HostTreeView root-level component that were missed in previous cleanup 2. [P2] Add draggable + onDragStart to pinned/recent host cards so drag-and-drop between groups still works 3. [P3] Fix grouped view header count to exclude hosts already shown in pinned/recent sections Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use functional state update for lastConnectedAt, dedupe pinned from recent 1. [P2] Add updateHostLastConnected using setHosts(prev => ...) functional update pattern (same as updateHostDistro) to avoid overwriting concurrent host changes when multiple sessions connect simultaneously 2. [P3] Exclude pinned hosts from Recently Connected section to prevent duplicate cards between the two top sections Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: wire showRecentHosts into settings sync, clear pin on duplicate 1. [P2] Add showRecentHosts to SyncPayload settings so the preference survives cloud sync and settings export/import 2. [P2] Clear pinned and lastConnectedAt on duplicated hosts so copies don't inherit pin/recent status from the original Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|
|
2d8cea2e7d |
fix: remove stale immersive mode sync/rehydration handlers
Address Codex review: remove references to setImmersiveModeState in rehydration, IPC sync, and cross-window storage handlers that would throw after the state setter was removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
b724cfc775 |
feat: enable immersive mode permanently and remove settings toggle
Immersive mode is now always on — the UI chrome automatically adapts to match the active terminal theme. The toggle in Appearance settings has been removed and the TerminalLayer preview logic simplified. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
75ec050c31 |
revert: restore clearSelectionsExcept to clear all tabs except target
Clearing same-side inactive tab selections on tab switch is intentional
UX — stale selections on hidden tabs would be confusing when switching
back. Reverts the "preserve same-side" change from
|
||
|
|
05c48b3d28 |
fix: preserve selections in same-side inactive tabs
clearSelectionsExcept was clearing all tabs including same-side inactive ones, causing users to lose file selections when switching between tabs on the same side. Now only the opposite side's selections are cleared. Also scoped tree selection clearing to only affect opposite-side pane IDs, preventing mounted but hidden SFTP surfaces from losing state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
21daccf6ed |
fix: enforce cross-pane selection mutual exclusivity and improve delete dialog
- Add clearSelectionsExcept to clear all file/tree selections except the target pane, called on focus change, tab switch, tab add, and tab move - Fix SftpFileRow areEqual to include showSelectionHighlight so highlight updates when focus changes between panes - Improve delete confirmation dialog with host/path context and separate single vs multi-delete descriptions - Fix hover style on selected rows to prevent flicker Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
4dd7640452 |
fix: allow auto encoding through same-host fast path
The encoding guard was rejecting "auto" which is the default encoding for nearly all connections, making same-host optimization never trigger. Frontend now allows "auto" through. Backend resolves "auto" to the actual session encoding via resolveEncodingForRequest and only proceeds with exec cp when the resolved encoding is UTF-8. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
0b08521e63 |
perf: optimize same-host SFTP transfer with remote cp command (#564)
* perf: optimize same-host SFTP transfer with remote cp command When both panels are connected to the same remote host, use SSH exec `cp -a` instead of downloading to local temp then re-uploading. This eliminates 2x bandwidth usage and reduces latency for same-host transfers. Closes #561 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * perf: optimize same-host directory transfer with single cp -ra command For same-host directory transfers, use a single `cp -ra` command via SSH exec instead of recursively walking the directory and copying files one by one. This makes directory copies nearly instant on the remote server. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use endpoint cache key for same-host detection and guard non-UTF-8 paths Address two code review issues: 1. Compare per-connection cache keys (hostname+port+protocol+sudo+username) instead of just hostId for same-host detection. This prevents false positives when the same hostId has different session-time overrides. 2. Restrict exec-based cp paths to UTF-8 compatible encodings only. Non-UTF-8 encodings (e.g. gb18030) need encodePathForSession which shell exec cannot use — fall back to download+upload for those cases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: directory cp semantics, cancellation, and auto encoding guard 1. Use `cp -ra source/. target/` instead of `cp -ra source target` to copy directory contents into target, preserving merge semantics when the target directory already exists (avoids extra nesting level). 2. Check cancellation state before and after sameHostCopyDirectory call so cancelled transfers don't finalize as completed. 3. Exclude 'auto' from exec-safe encodings since auto can resolve to non-UTF-8 (e.g. gb18030) at the session level. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: wire cancellation into same-host copy paths 1. Single file cp -a: check transfer.cancelled before and after execSshCommand so cancelled transfers don't proceed as success. 2. Directory cp -ra: accept transferId, register in activeTransfers so cancelTransfer can flag it, and check cancelled state at each async boundary. Cleanup via finally block. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: abort remote cp process on transfer cancellation Add execSshCommandCancellable() that wires the SSH exec stream into transfer.abort, so cancelTransfer can close the stream and kill the remote cp process immediately instead of waiting for it to finish. Used in both single-file (cp -a) and directory (cp -ra) same-host paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: close exec stream immediately if cancelled before callback fires Check transfer.cancelled at the start of the exec callback and close the stream right away, preventing the remote cp from running when cancellation happened between the exec() call and callback delivery. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: fallback to download+upload when remote cp is unavailable On non-POSIX remotes (e.g. Windows SSH servers) where cp is absent, same-host optimization now gracefully falls back to the existing download+upload transfer path instead of failing the transfer. - Single file: try cp -a first, fall back to temp file on non-zero exit - Directory: sameHostCopyDirectory returns { success: false } instead of throwing, frontend falls back to recursive transferDirectory Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * perf: cache cp unavailability to avoid repeated exec failures Track sftpIds where remote cp failed in cpUnavailableSet so subsequent file transfers in the same session skip the exec attempt and go directly to download+upload, avoiding per-file exec round-trip overhead on non-POSIX remotes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: skip transferFile for directories already handled by same-host copy Add !task.isDirectory guard to the else branch so successful sameHostCopyDirectory doesn't also trigger a redundant transferFile call that would duplicate data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: dereference symlinks in same-host copy to match SFTP behavior Use cp -aL instead of cp -a so symlinks are dereferenced (copied as file contents), matching the existing SFTP download+upload flow which always transfers resolved file data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * revert: remove -L flag from same-host cp to avoid recursing symlinked dirs Revert cp -aL back to cp -a. The -L flag dereferences all symlinks including symlinked directories, which can unexpectedly recurse into large unrelated directory trees. Using cp -a preserves symlinks as-is, which is safer and consistent with how the transfer UI treats symlink directories as non-recursive entries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: refine cp unavailability caching and remove dead import 1. Only cache sftpId in cpUnavailableSet on exit code 127 (command not found). Other failures (permission denied, disk full) are transient or path-specific and should not disable cp for the entire session. 2. Check cpUnavailableSet at the top of sameHostCopyDirectory to skip exec attempt on known non-POSIX remotes. Also cache 127 exits from directory copies. 3. Remove unused execSshCommand import from transferBridge (replaced by local execSshCommandCancellable) and revert its export from sftpBridge. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
6a37b8bbc6 | fix: use system browser for OAuth flows (#563) (#565) | ||
|
|
9397a781b5 |
refactor: unify directory download with upload transfer system (#560)
* refactor: unify directory download with upload transfer system Directory downloads previously used a completely separate implementation with custom queue management, progress tracking, and concurrency control (~390 lines in useSftpViewFileOps.ts). This caused the download UI to show only a single aggregate task without child file details, unlike uploads which showed parent + child tasks. Replace the custom download implementation with a new downloadToLocal() method in useSftpTransfers that reuses the existing transferDirectory/ transferFile infrastructure. Downloads now: - Show parent task with child file tasks (same as uploads) - Use the configurable transfer concurrency setting - Support cancellation through the same mechanism - Share progress tracking and conflict detection code Net reduction of ~260 lines. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove dead code from directory download refactor Remove listSftp, mkdirLocal, and RemoteFile imports that were only used by the old custom directory download implementation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: handle symlink directories in transfers and remove dead code - Use isNavigableDirectory() instead of type === "directory" in transferDirectory so symlinks pointing to directories are recursed into correctly (fixes both upload and download paths) - Remove unused deleteLocalFile prop from useSftpViewFileOps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use connection ID for download tasks and cancel child streams - Use pane connection ID (not SFTP session ID) as sourceConnectionId so download tasks are properly associated with the host and visible in filtered transfer views - Cancel all active child transfer streams at the backend when parent is cancelled, not just the parent ID — stops data transfer immediately Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add symlink cycle detection and propagate child failures - Add visitedPaths Set to transferDirectory to detect and skip symlink directory cycles that would cause infinite recursion - Check for failed child tasks after transferDirectory completes and mark parent as failed instead of falsely reporting success Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use depth limit for symlink loops and handle EEXIST on mkdir - Replace visited-paths cycle detection with a depth limit (64), which reliably catches symlink loops that generate new path strings each hop (e.g. /dir/link/link/link...) - Handle EEXIST errors in mkdirLocal gracefully so re-downloading to an existing directory doesn't abort the entire transfer Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: throw on depth limit exceeded and mark downloads non-retryable - Depth limit now throws instead of silently returning, so exceeding it surfaces as a failed transfer rather than an incomplete success - Set retryable: false on downloadToLocal tasks since retryTransfer cannot resolve the synthetic "local" connection ID Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: track symlink depth only and verify EEXIST target is directory - Change depth guard to only count symlink directory hops, not total directory depth, so legitimate deep trees are not rejected - After catching EEXIST on mkdirLocal, stat the path to verify it is actually a directory — throw if a regular file exists at that path Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove dead props from callbacks and surface download failures - Remove mkdirLocal and deleteLocalFile from useSftpViewPaneCallbacks interface and passthrough (fixes TS2353 build error) - Show error toast when downloadToLocal returns "failed" status, not just when it throws Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: track child transfer IDs outside React state for reliable cancel Child transfer IDs were only discoverable via transfersRef.current, which lags behind setTransfers due to React batching. This caused two race conditions: 1. Cancellation: child streams started between setTransfers and render were not cancelled at the backend, continuing to write data. 2. Failure detection: hasFailedChildren checked transfersRef which might not reflect recently-failed children, marking partial downloads as successful. Fix: track active child IDs in activeChildIdsRef (a mutable Map outside React state) for immediate visibility during cancellation. Check child failure status inside setTransfers functional updater where the latest state is guaranteed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: preserve actual progress on partial failure and count symlink dirs - Don't force transferredBytes to totalBytes when some children failed, so the progress bar accurately reflects the partial completion - Use isNavigableDirectory in countDirectoryFiles and estimateDirectoryBytes so symlink directories are included in size/count estimates Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: symlink count, progress on fast downloads, and child cancellation 1. countDirectoryFiles: use isNavigableDirectory so symlink dirs are recursed into, keeping totals consistent with transferDirectory 2. Final status: compute actual completedCount from children instead of relying on totalBytes which may be 0 if the background scan hasn't finished yet 3. Catch block: detect cancellation from error message (not just cancelledTasksRef) so child-initiated cancels don't show as errors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add symlink depth guard to countDirectoryFiles and estimateDirectoryBytes Both helper functions now track symlink depth and stop recursing when MAX_SYMLINK_DEPTH is exceeded, consistent with transferDirectory. Prevents infinite recursion on symlink directory cycles during the background file count/size scan. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: reliable final status and non-retryable child tasks 1. transferDirectory now returns the count of failed child transfers, tracked outside React state. downloadToLocal uses this count directly instead of reading from setTransfers updater (which may be deferred by React batching), ensuring the correct status is returned to the caller for toast messages. 2. Child tasks explicitly inherit retryable from the parent task. For downloadToLocal (retryable: false), this prevents showing retry actions on failed children whose "local" targetConnectionId cannot be resolved by retryTransfer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add ancestor path cycle detection for symlink directories The depth-only guard allowed up to 32 pointless traversals before stopping a symlink cycle (e.g. dir/link -> .). Add an ancestorPaths Set that tracks the current recursion stack — if a directory's source path is already in the set, it's an immediate cycle and is skipped with zero wasted traversals. The depth limit remains as a hard backstop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: don't recurse into symlink directories during transfers Revert to only recursing into real directories (type === "directory") in transferDirectory, countDirectoryFiles, and estimateDirectoryBytes. Symlink directories are now transferred as regular entries instead of being followed, eliminating all symlink cycle risks without needing complex cycle detection that can't reliably work with unresolved remote paths. Also clean up activeChildIdsRef in processTransfer (both success and error paths) to prevent memory leaks from pane-to-pane directory transfers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: filter "." entries and recurse into symlink dirs with depth guard 1. Filter both "." and ".." in all recursive functions — some SFTP servers include "." in readdir, causing infinite self-recursion. 2. Restore symlink directory recursion in transferDirectory with a symlinkDepth counter (max 32). Symlink dirs that exceed the limit are excluded from the dirs list (treated as files). This is needed because startStreamTransfer cannot transfer a directory as a file, so skipping symlink dirs caused child transfer failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add symlink depth guard to count/estimate helpers countDirectoryFiles and estimateDirectoryBytes now track symlinkDepth consistently with transferDirectory, preventing infinite recursion on symlink cycles in the background file count/size estimation. Also fixes: - Remove fragile string-based cancellation detection in downloadToLocal - Clean up cancelledTasksRef in downloadToLocal catch block - Move MAX_SYMLINK_DEPTH before its first use Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use path reconstruction instead of string replace for duplicate conflicts resolveConflict's "duplicate" action used String.replace to swap the filename in the target path, but this replaces the first occurrence which can corrupt the path if the filename also appears in a parent directory name. Use joinPath(getParentPath(...), newName) instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: skip over-depth symlink directories instead of treating as files When symlinkDepth exceeds MAX_SYMLINK_DEPTH, symlink directories were falling through to regularFiles and being passed to transferFile, which cannot transfer directories and would produce confusing errors. Now they are skipped entirely with a warning log. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: count skipped symlinks as errors and process subdirs concurrently 1. Symlink directories skipped at MAX_SYMLINK_DEPTH now increment totalErrors so the parent task is marked failed instead of silently reporting success with incomplete content. 2. Sibling subdirectories are now processed with Promise.all instead of sequential await, restoring cross-directory concurrency that the old download implementation had. Files within each directory still use the configurable worker pool concurrency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: sequential subdirs to prevent SFTP overload and check dir errors in processTransfer 1. Revert subdirectory processing to sequential (for...of await) to prevent unbounded concurrent SFTP requests from nested Promise.all + worker pools across the directory tree. File-level concurrency within each directory is still governed by getTransferConcurrency(). 2. processTransfer now captures transferDirectory's error count return value and marks the parent task as "failed" when child transfers fail, instead of unconditionally marking "completed". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: remove redundant completed state update for directory transfers Directory success path no longer writes "completed" in both the directory-specific block and the generic block. The directory-specific block now only handles the failure case with early return; success falls through to the generic completed block. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: route partial directory failures through shared completion path The early return for directory transfer failures skipped cache invalidation, target pane refresh, and onTransferComplete callbacks (needed by cut/paste to clear clipboard). Now partial failures flow through the same cleanup path as successes — cache is cleared, target is refreshed, and completionHandler is called with the correct "failed" status. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: restrict symlink directory recursion to downloadToLocal only Add followSymlinks parameter (default false) to transferDirectory, countDirectoryFiles, and estimateDirectoryBytes. Only downloadToLocal passes true — uploads and pane-to-pane copies retain their original behavior of treating symlink directories as regular entries. This prevents existing upload/copy flows from expanding symlinked directory trees (which could duplicate content or trigger cycles), while still allowing local downloads to recursively copy through symlink directories with depth protection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: disable retry for partial dir failures and fix symlink file count 1. Mark partially failed directory transfers as retryable: false to prevent retry from replaying the entire directory without conflict checks, which would silently overwrite already-copied files. 2. In countDirectoryFiles and estimateDirectoryBytes, skip over-depth symlink directories entirely instead of counting them as files. This makes the totals consistent with transferDirectory which also skips these entries, preventing impossible progress like "10/11". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
255a4730e7 |
feat: make SFTP folder transfer concurrency configurable (#558)
* feat: make SFTP folder transfer concurrency configurable The number of files transferred in parallel during folder uploads/ downloads was hardcoded to 4. Add a setting (1-16, default 4) in Settings > SFTP so users can tune it for their server and network. The value is read from localStorage at transfer start time, so changes take effect on the next folder transfer without restart. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: sync transfer concurrency setting across windows Add notifySettingsChanged broadcast, IPC onSettingsChanged handler, and storage event listener for the transfer concurrency setting so changes propagate to all open windows immediately. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: move setSftpTransferConcurrency after notifySettingsChanged The useCallback referenced notifySettingsChanged before it was defined (const is not hoisted), causing a ReferenceError on mount. Move the definition after notifySettingsChanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
dd50f95583 |
feat: add workspace focus indicator style setting (dim vs border) (#557)
* feat: add workspace focus indicator style setting (dim vs border) Users can now choose between two focus indicator styles for split terminal panes: - Dim: reduces opacity of unfocused panes (current default) - Border: shows a colored border on the focused pane (old style) The setting is in Settings > Terminal > Workspace Focus Indicator. Implementation uses a CSS data attribute on documentElement to toggle between the two styles, avoiding prop threading. Closes #556 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: sync workspace focus style across windows Add cross-window notification handling for the workspace focus style setting so changes in the Settings window take effect in the main terminal window immediately. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
b7fa6c0405 |
fix: resolve lint errors from recent PRs
- Remove unnecessary eslint-disable directive in useAutoSync.ts - Use localStorageAdapter.remove() instead of bare localStorage in useSftpFileAssociations.ts (no-restricted-globals) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
c8d145f52e |
feat: add default file opener setting for SFTP (#554)
* feat: add default file opener setting for SFTP Add a global default opener that is used as fallback when no per-extension file association exists, eliminating the need to select an editor for every new file type. The default opener is stored as a special "*" key in the existing file associations map, so it syncs and persists automatically. Settings UI provides three options: always ask (current behavior), built-in editor, or a chosen system application. Closes #550 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use reserved key for default opener to avoid extension collision Replace "*" with "__default__" as the default opener storage key to prevent a theoretical collision with files named "foo.*" where getFileExtension would return "*". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: skip built-in editor default for known binary files When the global default opener is set to built-in editor, binary files (zip, png, etc.) should not be opened as text. Fall back to the chooser dialog for known binary formats instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: store default opener in separate localStorage key Move the default opener out of the FileAssociationsMap into its own storage key (STORAGE_KEY_SFTP_DEFAULT_OPENER) to completely eliminate any possibility of key collision with file extensions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
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 |