From c4f926940926acaa58aa246febef3ed7b854a559 Mon Sep 17 00:00:00 2001 From: austin62jake Date: Sat, 31 Oct 2026 09:16:04 +0000 Subject: [PATCH] Report a bug: the window can be dragged by its title (#9916) (#9934) * Claim #9916 Co-Authored-By: Claude Opus 5.5 * Report a bug: the window can be dragged by its title (#9916) The window was pinned at the top middle of the screen (ui_kit::Window anchor), over the model, in a sketch or not. It now starts there and can be moved (`placed`), as the file-load card can. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude --- crates/ui-egui/src/issue_report.rs | 26 +++++++++++++++++++++++++ crates/ui-egui/src/issue_report/form.rs | 4 +++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/issue_report.rs b/crates/ui-egui/src/issue_report.rs index 7af85281f..69344ed8c 100644 --- a/crates/ui-egui/src/issue_report.rs +++ b/crates/ui-egui/src/issue_report.rs @@ -1532,6 +1532,32 @@ mod tests { } } + /// #9916: the window opens at the top middle, and dragging its title band moves it off the + /// model, in a sketch too. + #[test] + fn issue_report_window_moves_by_its_title() { + for sketch in [false, true] { + let mut h = crate::scenario::Harness::new(); + h.app.home.open = false; + h.call("ui.resize", json!({"width":1400,"height":800})); + if sketch { + h.app.run("sketch.create", json!({"plane": "XY"})).unwrap(); + } + h.app.issue_report.draft = Some(draft_for(&h.app, None, None)); + h.frames(10); + let rect = |h: &crate::scenario::Harness| egui::containers::AreaState::load(&h.ctx, egui::Id::new("sc_issue_report")).unwrap().rect(); + let at = rect(&h); + assert!((at.center().x - h.ctx.content_rect().center().x).abs() < 1.0, "sketch={sketch}: it opens at the top middle: {at:?}"); + // On the title, clear of the close button. + let grip = at.left_top() + egui::vec2(140.0, 18.0); + h.call("ui.drag", json!({"x0": grip.x, "y0": grip.y, "x1": grip.x - 250.0, "y1": grip.y, "steps": 20})); + h.frames(4); + let moved = rect(&h); + assert!((moved.min.x - (at.min.x - 250.0)).abs() < 2.0 && (moved.min.y - at.min.y).abs() < 2.0, "sketch={sketch}: {at:?} -> {moved:?}"); + assert!(h.app.issue_report.draft.is_some(), "still open"); + } + } + /// Save screenshot… writes the PNG where the picker says, the way the web app's other saves /// write (#7192), and a failure reads as plain words, not a Rust value. #[test] diff --git a/crates/ui-egui/src/issue_report/form.rs b/crates/ui-egui/src/issue_report/form.rs index a2b86f490..3cb0ff5c4 100644 --- a/crates/ui-egui/src/issue_report/form.rs +++ b/crates/ui-egui/src/issue_report/form.rs @@ -120,7 +120,9 @@ pub(super) fn show(app: &mut SolveApp, draft: &mut Draft, ctx: &egui::Context) - let close_label = if compact { "" } else { "Close draft" }; let (closed, mut action) = ui_kit::Window::new(Id::new("sc_issue_report"), "bug_report", tr_label("Report a bug")) .cards(cards) - .anchor(egui::Align2::CENTER_TOP, vec2(0.0, t.space_16)) + // Opens at the top middle, and its title band drags it off what the report is about + // (#9916). + .placed(egui::Align2::CENTER_TOP, egui::pos2(screen.center().x, screen.top() + t.space_16)) .fields() .keep_open_on_escape() .actions(tr_label(open_label), tr_label(close_label), Some(tr_label("Copy report")))