mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-10-06 16:02:05 +00:00
style: cargo fmt
This commit is contained in:
@@ -24,7 +24,7 @@ use std::sync::mpsc::{self, Receiver};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use crate::daemon::pane::DaemonPane;
|
||||
use crate::daemon::protocol::{ClientMsg, DaemonMsg, DaemonVersion, RemoteKind, PROTOCOL_VERSION};
|
||||
use crate::daemon::protocol::{ClientMsg, DaemonMsg, DaemonVersion, PROTOCOL_VERSION, RemoteKind};
|
||||
use crate::daemon::ssh::SshConnection;
|
||||
use crate::daemon::transport::{self, Stream};
|
||||
|
||||
|
||||
+7
-3
@@ -58,8 +58,7 @@ pub struct MismatchedDaemon {
|
||||
pub version: Option<DaemonVersion>,
|
||||
}
|
||||
|
||||
static MISMATCHED_DAEMON: std::sync::Mutex<Option<MismatchedDaemon>> =
|
||||
std::sync::Mutex::new(None);
|
||||
static MISMATCHED_DAEMON: std::sync::Mutex<Option<MismatchedDaemon>> = std::sync::Mutex::new(None);
|
||||
|
||||
/// The protocol mismatch recorded by [`ensure_running`] this launch, if any.
|
||||
/// Take-semantics so the prompt fires once per launch, not per window.
|
||||
@@ -187,7 +186,12 @@ fn query_daemon_version(stream: &mut transport::Stream) -> VersionProbe {
|
||||
}
|
||||
match DaemonMsg::read(stream) {
|
||||
Ok(DaemonMsg::Version(v)) => VersionProbe::Speaks(v),
|
||||
Err(e) if matches!(e.kind(), io::ErrorKind::TimedOut | io::ErrorKind::WouldBlock) => {
|
||||
Err(e)
|
||||
if matches!(
|
||||
e.kind(),
|
||||
io::ErrorKind::TimedOut | io::ErrorKind::WouldBlock
|
||||
) =>
|
||||
{
|
||||
VersionProbe::Unresponsive
|
||||
}
|
||||
// EOF/reset (the pre-versioning hangup) — and, conservatively, any
|
||||
|
||||
@@ -2488,8 +2488,9 @@ impl TerminalView {
|
||||
// Landing through `update_global` wakes the sidebar's
|
||||
// `observe_global`, so every pane in the repo repaints — not
|
||||
// just this one.
|
||||
let rerun = cx
|
||||
.update_global::<GitStatusCache, _>(|cache, _| cache.finish_probe(&cwd, result));
|
||||
let rerun = cx.update_global::<GitStatusCache, _>(|cache, _| {
|
||||
cache.finish_probe(&cwd, result)
|
||||
});
|
||||
// A trigger arrived while we flew; go once more so its state
|
||||
// is observed — unless this pane has since left that cwd.
|
||||
if rerun && view.git_status_cwd.as_deref() == Some(&cwd) {
|
||||
|
||||
+3
-3
@@ -446,8 +446,8 @@ impl Tty7App {
|
||||
// sidebar's branch/diff lines read from it, and the probing pane's own
|
||||
// notify wouldn't re-render rows belonging to *other* panes.
|
||||
cx.default_global::<crate::terminal::git_status::GitStatusCache>();
|
||||
let git_status_watch = cx
|
||||
.observe_global::<crate::terminal::git_status::GitStatusCache>(|_, cx| cx.notify());
|
||||
let git_status_watch =
|
||||
cx.observe_global::<crate::terminal::git_status::GitStatusCache>(|_, cx| cx.notify());
|
||||
// Any real keypress means "chord, not a bare hold": cancel the held-⌘
|
||||
// tab badges and whatever reveal is pending (see `ui::hints`).
|
||||
let this = cx.weak_entity();
|
||||
@@ -2867,7 +2867,7 @@ impl Tty7App {
|
||||
} else {
|
||||
match phase {
|
||||
SshPhase::Connecting | SshPhase::Authenticating => 0xF59E0B, // amber: in flight
|
||||
SshPhase::Connected => 0x22C55E, // green: link up
|
||||
SshPhase::Connected => 0x22C55E, // green: link up
|
||||
SshPhase::Failed { .. } => 0xEF4444, // red: never made it
|
||||
}
|
||||
};
|
||||
|
||||
+3
-1
@@ -269,7 +269,9 @@ impl Tty7App {
|
||||
// SSH connection phase as a corner status dot — the same
|
||||
// element as an agent's, not a border ring around the badge
|
||||
// (a ring read as a second, differently-shaped avatar style).
|
||||
.when_some(ssh, |b, rgb| b.child(Self::status_dot(rgb, false, size, cx)))
|
||||
.when_some(ssh, |b, rgb| {
|
||||
b.child(Self::status_dot(rgb, false, size, cx))
|
||||
})
|
||||
.into_any_element(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user