fix(sftp): keep browse sessions when switching side-panel tools - #2884
fix(sftp): keep browse sessions when switching side-panel tools#2884netcatty-bot wants to merge 1 commit into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac3993b789
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| tabId={tabId} | ||
| ctx={ctx} | ||
| isVisible={isToolVisible(tabId, 'sftp')} | ||
| ownerPanelOpen={openTabs.has(tabId)} |
There was a problem hiding this comment.
Keep parked SFTP closed when reopening other tools
When an SFTP side panel was closed but kept mounted because a transfer or external edit was still active, the browse sessions either park after the activity finishes or should stay parked while the SFTP UI remains closed. With ownerPanelOpen driven by openTabs.has(tabId), opening History/System for that tab flips the hidden SFTP owner back to interactive even though SFTP is not visible, so useSftpState skips parking after the retained work completes (or restores already-parked browse sessions). This defeats the close-panel lifecycle and can keep/reopen SSH/SFTP browse connections just because a different side-panel tool is open; this should be gated on an actual SFTP tool switch from an open panel rather than any open side-panel tab.
Useful? React with 👍 / 👎.
Summary
Why
Opening File Transfer, then Logs (or another side-panel tool), then switching back remounted the list slowly and sometimes left a blank list. The owner React tree was already kept mounted across tool switches, but
isVisible=falsewas treated as “non-interactive,” which parked browse SFTP sessions and cleared the listing cache. Restore then had to reconnect and re-list — expensive, and race-prone.Changes
isBrowseSessionInteractivegainsownerPanelOpen: keep browse warm while the terminal side panel is still open for that tab.SidePanelSftpSlotpassesownerPanelOpen={sidePanelOpenTabs.has(tabId)}intoSftpSidePanel.SftpView/useSftpStateupdated so parking is described as panel-close behavior, not every hide of the SFTP tool surface.Testing
node --test --import tsx application/state/sftp/browseSessionLifecycle.test.tsnode --test --import tsx components/terminalLayer/sftpPanelLifecycle.test.tsnode --test --import tsx application/state/editorTabSave.test.ts(promoted-editor retain path still green)Fixes #2882
Automation
@codex review(own/bot PRs only)