diff --git a/crates/op-editor-ui/src/widgets/git_panel_remotes.rs b/crates/op-editor-ui/src/widgets/git_panel_remotes.rs index 87db1db43..284863418 100644 --- a/crates/op-editor-ui/src/widgets/git_panel_remotes.rs +++ b/crates/op-editor-ui/src/widgets/git_panel_remotes.rs @@ -176,7 +176,17 @@ impl GitPanel<'_> { self.theme.muted_foreground, ); } else { - let line = if focused { + // Blink the caret on the same 530 ms cadence as the commit + // box (shared `commit_caret_anchor_ms`), rather than a static + // `|`. The host wakes the loop while these inputs are focused + // so the toggle actually animates. + let caret = focused + && jian_core::anim::blink_visible( + self.now_ms, + self.state.commit_caret_anchor_ms, + 530, + ); + let line = if caret { format!("{shown}|") } else { shown.to_string() diff --git a/crates/op-host-native/src/widget_host.rs b/crates/op-host-native/src/widget_host.rs index 41c69af67..db777c9dc 100644 --- a/crates/op-host-native/src/widget_host.rs +++ b/crates/op-host-native/src/widget_host.rs @@ -718,6 +718,18 @@ impl WidgetHostNative { 530, )); } + // Remote-settings inputs (remote URL + HTTPS username:token) share + // the same caret cadence; without this wake their caret stays + // static while focused. + if self.editor_state.editor_ui.git_panel.remote_focused + || self.editor_state.editor_ui.git_panel.https_focused + { + return Some(jian_core::anim::next_blink_flip_ms( + self.now_ms, + self.editor_state.editor_ui.git_panel.commit_caret_anchor_ms, + 530, + )); + } // Clone-wizard field caret, and while a `git clone` runs — keep // the loop ticking so the caret blinks and `poll_git_clone_job` // drains the worker's result on a later frame. diff --git a/crates/op-host-native/src/widget_host/git_press.rs b/crates/op-host-native/src/widget_host/git_press.rs index 7c15cdc23..a3f95c8ee 100644 --- a/crates/op-host-native/src/widget_host/git_press.rs +++ b/crates/op-host-native/src/widget_host/git_press.rs @@ -62,11 +62,14 @@ impl WidgetHostNative { panel.remote_focused = true; panel.commit_focused = false; panel.https_focused = false; + // Seed the shared caret anchor so it starts solid, then blinks. + panel.commit_caret_anchor_ms = now; } Some(GitPanelHit::HttpsInput) => { panel.https_focused = true; panel.commit_focused = false; panel.remote_focused = false; + panel.commit_caret_anchor_ms = now; } Some(GitPanelHit::SetRemote) => { if !panel.remote_draft.trim().is_empty() {