Skip to content

Banner for remote server disconnect#11565

Merged
kevinyang372 merged 7 commits into
masterfrom
kevin/banner-for-remote-server-disonnects
May 25, 2026
Merged

Banner for remote server disconnect#11565
kevinyang372 merged 7 commits into
masterfrom
kevin/banner-for-remote-server-disonnects

Conversation

@kevinyang372
Copy link
Copy Markdown
Member

@kevinyang372 kevinyang372 commented May 22, 2026

Summary

When a remote SSH session disconnects while a code editor or file notebook pane is open, the pane silently becomes stale — save fails, auto-reload stops, and there is no visual indication. This PR adds a disconnection banner and save guard.

Changes

  • Disconnection banner — Shows "Remote host disconnected. You will not be able to see updates and save changes." above the editor/notebook content when the remote host loses connection. The banner auto-dismisses on reconnection.
  • Save guardsave_local() immediately returns ImmediateSaveError::RemoteDisconnected when the host is disconnected, with a specific toast message ("Cannot save — remote session disconnected.").
  • On-the-fly state derivation — No stored boolean; is_remote_disconnected() checks RemoteServerManager::client_for_host() each render, so it is always in sync.
  • File notebook supportFileNotebookView subscribes to HostDisconnected/HostConnected events to trigger re-renders.
  • Loaded-only gating — Banner only appears if the file was successfully loaded; error/loading states handle the "never loaded" case.

Files Changed

  • app/src/code/mod.rs — Added ImmediateSaveError::RemoteDisconnected variant
  • app/src/code/local_code_editor.rsis_remote_disconnected(), save guard, render banner, render_remote_disconnected_banner()
  • app/src/code/view.rs — Specific toast + error handling for RemoteDisconnected
  • app/src/notebooks/file/mod.rsis_remote_disconnected(), render banner, subscribe to RemoteServerManager events

Conversation

https://staging.warp.dev/conversation/bab4762c-633a-40a3-9258-4a0752b608e1

Plan

https://staging.warp.dev/drive/notebook/VqsXi9GmQ7EW1TnCJ9jlOp

Demo

https://www.loom.com/share/f0bab2f11c4047609bf1b318827af0ec

@cla-bot cla-bot Bot added the cla-signed label May 22, 2026
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kevinyang372 kevinyang372 marked this pull request as ready for review May 22, 2026 22:29
@kevinyang372 kevinyang372 requested a review from moirahuang May 22, 2026 22:29
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 22, 2026

@kevinyang372

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds remote-disconnect detection, a banner, and a save failure toast for remote code editor and file notebook panes.

Concerns

  • The file notebook change contains a Rust move-out-of-borrow compile error in the new loaded-state check.
  • The code editor banner is derived at render time, but the view is not subscribed to remote host connection events, so the banner may not appear or disappear when the remote connection state changes.
  • No security findings. No approved spec context was available for this PR.

Verdict

Found: 1 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/notebooks/file/mod.rs Outdated
Comment thread app/src/code/local_code_editor.rs
@kevinyang372 kevinyang372 enabled auto-merge (squash) May 25, 2026 04:51
@kevinyang372 kevinyang372 merged commit 0b737e2 into master May 25, 2026
26 checks passed
@kevinyang372 kevinyang372 deleted the kevin/banner-for-remote-server-disonnects branch May 25, 2026 05:13
ErshovDmitry pushed a commit to ErshovDmitry/warp-i18n that referenced this pull request May 25, 2026
## Summary
When a remote SSH session disconnects while a code editor or file
notebook pane is open, the pane silently becomes stale — save fails,
auto-reload stops, and there is no visual indication. This PR adds a
disconnection banner and save guard.

## Changes
- **Disconnection banner** — Shows "Remote host disconnected. You will
not be able to see updates and save changes." above the editor/notebook
content when the remote host loses connection. The banner auto-dismisses
on reconnection.
- **Save guard** — `save_local()` immediately returns
`ImmediateSaveError::RemoteDisconnected` when the host is disconnected,
with a specific toast message ("Cannot save — remote session
disconnected.").
- **On-the-fly state derivation** — No stored boolean;
`is_remote_disconnected()` checks
`RemoteServerManager::client_for_host()` each render, so it is always in
sync.
- **File notebook support** — `FileNotebookView` subscribes to
`HostDisconnected`/`HostConnected` events to trigger re-renders.
- **Loaded-only gating** — Banner only appears if the file was
successfully loaded; error/loading states handle the "never loaded"
case.

## Files Changed
- `app/src/code/mod.rs` — Added `ImmediateSaveError::RemoteDisconnected`
variant
- `app/src/code/local_code_editor.rs` — `is_remote_disconnected()`, save
guard, render banner, `render_remote_disconnected_banner()`
- `app/src/code/view.rs` — Specific toast + error handling for
`RemoteDisconnected`
- `app/src/notebooks/file/mod.rs` — `is_remote_disconnected()`, render
banner, subscribe to `RemoteServerManager` events

## Conversation

https://staging.warp.dev/conversation/bab4762c-633a-40a3-9258-4a0752b608e1

## Plan
https://staging.warp.dev/drive/notebook/VqsXi9GmQ7EW1TnCJ9jlOp

## Demo
https://www.loom.com/share/f0bab2f11c4047609bf1b318827af0ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants