fix(vcs): open comparisons in independently resizable native windows (#818)

Compare with Local, Compare Versions and the other revision comparisons open in a separate window that belongs to their project window. The window can be moved outside the main window, resized from its edges and corners, and shows the full diff. Edits made there and in the project window are mirrored both ways.

Root cause of #798: the comparison was an in-window dialog with a fixed size.

Settings and comparison windows now share one auxiliary-window mechanism (`AuxKind`, `open_auxiliary_window`). It handles labels, the title bar, placement over the parent, event forwarding, document-edit mirroring, menu routing, closing together with the parent, and remembered geometry per kind.

Co-authored-by: xdpan1234 <[email protected]>
Цей коміт міститься в:
xdpan1234таxdpan1234 authored and GitHub committed 2026-11-04 12:27:45 +08:00
1 джерело 268cf01a86
коміт 0a70b0af01
26 files changed
+918 -198

No files matched your search

+29
Переглянути файл
@@ -635,8 +635,37 @@ pub async fn remote_invoke(
}
}
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
struct DocumentEdit {
doc: ide_core::DocId,
base_version: u32,
changes: ide_core::ChangeSet,
}
let mirrored = if cmd == "doc_edit" {
let peers = crate::events::document_edit_peers(window.app_handle(), window.label());
if peers.is_empty() {
None
} else {
serde_json::from_value::<DocumentEdit>(args.clone()).ok().map(|edit| (peers, edit))
}
} else {
None
};
let call = Invoke { window: label, cmd, args };
let result: Value = c.peer.request("invoke", call, None).await.map_err(ide_host::rpc::error_from_reply)?;
if let (Some((peers, edit)), Some(version)) =
(mirrored, result.as_u64().and_then(|version| u32::try_from(version).ok()))
{
crate::events::emit_document_edit(
window.app_handle(),
peers,
edit.doc,
edit.base_version,
version,
edit.changes.changes,
);
}
Ok(result.to_string())
}