Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

fix(properties): links to other panels open them when panel docking is on (#736)

aionggf60699278264
diff --git a/ROADMAP.md b/ROADMAP.md
index 8a0f82071..9f768db16 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -129,6 +129,7 @@ list) · [roadmap.md](docs/roadmap.md) (milestones, plan) · [parity-checklist.m
Newest first.
+- **2026-10-13** · Path edits (`path.setAnchor`, `path.moveAnchors`, `path.appendAnchor`, `path.reverse`, `path.close`, anchor add/delete/convert, Erase, Smooth and Scissors) refuse a path that is locked, sits in a locked group or on a locked layer (#735). Properties links to the Stroke, Character, Paragraph, Effects, Text Wrap and Info panels open them in a customized panel layout too (#736). No readiness percentage change.
- **2026-10-12** · macOS Dock Quit uses the same unsaved-document prompts as window and menu Quit. Repeated requests keep the current answers; Cancel retains every tab and unsaved recovery checkpoint, and completed Save/Don't Save answers exit through the ordinary event loop. No readiness percentage change.
- **2026-10-12** · Orderly native exit writes the latest recovery state after finalizing current quit approvals; incomplete or stale plans keep their documents, and Undo to the saved state clears stale recovery. Unavailable or failed recovery is reported. Cancelable macOS Dock Quit remains open (#544). No readiness percentage change.
- **2026-10-12** · Recovered documents keep a checkpoint until saved, closed or reverted, including a second crash before autosave. Restarted document IDs and explicit recovery folders preserve other snapshots; failed republishing retains the original. No readiness percentage change.
diff --git a/crates/ui-egui/src/panel_docking_tests.rs b/crates/ui-egui/src/panel_docking_tests.rs
index de08e3cf5..65879b1a0 100644
--- a/crates/ui-egui/src/panel_docking_tests.rs
+++ b/crates/ui-egui/src/panel_docking_tests.rs
@@ -301,6 +301,33 @@ fn populated_canvas_keeps_a_real_stroke_edit_after_floating_and_redocking() {
}
}
+#[test]
+fn properties_stroke_link_opens_the_stroke_panel_in_a_custom_workspace() {
+ let mut app = app();
+ app.run("file.new", json!({"width":480,"height":360})).unwrap();
+ app.run("frame.create", json!({"rect":[80,70,330,230],"content":"none"})).unwrap();
+ app.run("window.panel.float", json!({"panel":"layers"})).unwrap();
+ assert!(!app.ui.docking.as_ref().unwrap().contains(&"stroke".into()));
+ let mut h = Harness::builder().with_size(vec2(1280.0, 800.0)).build_ui_state(
+ |ui, app: &mut DesignApp| {
+ app.logic(ui.ctx());
+ app.ui(ui);
+ },
+ app,
+ );
+ h.run_steps(5);
+ let at = h.get_by_role_and_label(egui::accesskit::Role::Link, "Stroke").rect().center();
+ h.hover_at(at);
+ h.run_steps(1);
+ for pressed in [true, false] {
+ h.event(Event::PointerButton { pos: at, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE });
+ h.run_steps(1);
+ }
+ h.run_steps(2);
+ assert!(h.state().ui.docking.as_ref().unwrap().contains(&"stroke".into()));
+ assert_eq!(h.state().ui.docking_opened.as_deref(), Some("stroke"));
+}
+
#[test]
fn changing_workspace_during_a_drag_cancels_the_stale_gesture() {
let mut app = app();
diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs
index d9c74e40d..f5acd8665 100644
--- a/crates/ui-egui/src/panels/properties.rs
+++ b/crates/ui-egui/src/panels/properties.rs
@@ -16,6 +16,14 @@ use crate::widgets::{
};
use crate::{DesignApp, icons};
+/// A link to another panel. `window.panel` shows it in the docked layout or as a flyout; it
+/// toggles the flyout, so a flyout that is already open is left as it is.
+fn show_panel(app: &mut DesignApp, panel: &str) {
+ if app.ui.open_panel.as_deref() != Some(panel) {
+ let _ = app.run("window.panel", json!({"panel": panel}));
+ }
+}
+
fn units(app: &DesignApp) -> Unit {
app.session.active().map(|d| d.doc.settings.horizontal_units).unwrap_or(Unit::Picas)
}
@@ -467,7 +475,7 @@ fn transform_section(app: &mut DesignApp, ui: &mut Ui, i: &SelInfo) {
}
transform_angles(app, ui, rp);
if more_options(ui, &app.ui.language).clicked() {
- app.ui.open_panel = Some("info".into());
+ show_panel(app, "info");
}
}
@@ -654,7 +662,7 @@ fn appearance_section(app: &mut DesignApp, ui: &mut Ui, i: &SelInfo) {
let _ = app.run("object.stroke", json!({"swatch": n}));
});
if place(ui, sub(b, 34.0, 0.0, 56.0, FIELD_H), |ui| link_label(ui, crate::i18n::tr(&app.ui.language, "Stroke"), 56.0)).clicked() {
- app.ui.open_panel = Some("stroke".into());
+ show_panel(app, "stroke");
}
const WEIGHTS: &[f64] = &[0.0, 0.25, 0.5, 0.75, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 20.0, 30.0, 40.0, 50.0, 100.0];
if let Some(v) = place(ui, sub(b, 96.0, 0.0, 69.0, FIELD_H), |ui| {
@@ -695,7 +703,7 @@ fn appearance_section(app: &mut DesignApp, ui: &mut Ui, i: &SelInfo) {
let b = block(ui, FIELD_H);
icons::paint(ui.painter(), sub(b, 3.0, 1.0, 19.0, 19.0), "opacity", t.icon);
if place(ui, sub(b, 34.0, 0.0, 56.0, FIELD_H), |ui| link_label(ui, crate::i18n::tr(&app.ui.language, "Opacity"), 56.0)).clicked() {
- app.ui.open_panel = Some("effects".into());
+ show_panel(app, "effects");
}
if let Some(v) = place(ui, sub(b, 96.0, 0.0, 51.0, FIELD_H), |ui| {
NumField::number("opacity", Some((i.opacity * 100.0).round()), "%", 0).width(51.0).range(0.0, 100.0).show(ui)
@@ -707,13 +715,13 @@ fn appearance_section(app: &mut DesignApp, ui: &mut Ui, i: &SelInfo) {
ui.painter().rect(more, 0.0, if mresp.hovered() { t.hover } else { t.input }, Stroke::new(1.0, t.field_border), StrokeKind::Inside);
icons::paint(ui.painter(), more.shrink(4.0), "chevron-right", t.icon);
if mresp.clicked() {
- app.ui.open_panel = Some("effects".into());
+ show_panel(app, "effects");
}
ui.add_space(6.0);
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 10.0;
if icon_toggle(ui, "frame-dashed", false, crate::i18n::tr(&app.ui.language, "Frame Fitting")).clicked() {
- app.ui.open_panel = Some("textWrap".into());
+ show_panel(app, "textWrap");
}
if icon_toggle(ui, "fx", i.shadow, crate::i18n::tr(&app.ui.language, "Effects: Drop Shadow")).clicked() {
let _ = app.run("object.dropShadow", json!({"on": !i.shadow}));
@@ -801,7 +809,7 @@ fn wrap_section(app: &mut DesignApp, ui: &mut Ui, i: &SelInfo) {
}
});
if more_options(ui, &app.ui.language).clicked() {
- app.ui.open_panel = Some("textWrap".into());
+ show_panel(app, "textWrap");
}
}
@@ -1018,7 +1026,7 @@ fn text_appearance_section(app: &mut DesignApp, ui: &mut Ui) {
);
} else {
if place(ui, sub(b, 34.0, 0.0, 56.0, FIELD_H), |ui| link_label(ui, crate::i18n::tr(&app.ui.language, label), 56.0)).clicked() {
- app.ui.open_panel = Some("stroke".into());
+ show_panel(app, "stroke");
}
const WEIGHTS: &[f64] = &[0.0, 0.25, 0.5, 0.75, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0];
if let Some(v) = place(ui, sub(b, 96.0, 0.0, 69.0, FIELD_H), |ui| {
@@ -1125,7 +1133,7 @@ fn character_section(app: &mut DesignApp, ui: &mut Ui) {
egui::ScrollArea::vertical().max_height(320.0).show(ui, |ui| language_menu(app, ui, &lang));
});
if more_options(ui, &app.ui.language).clicked() {
- app.ui.open_panel = Some("character".into());
+ show_panel(app, "character");
}
}
@@ -1157,7 +1165,7 @@ fn paragraph_section(app: &mut DesignApp, ui: &mut Ui) {
}
});
if more_options(ui, &app.ui.language).clicked() {
- app.ui.open_panel = Some("paragraph".into());
+ show_panel(app, "paragraph");
}
}
@@ -1175,7 +1183,7 @@ fn bullets_section(app: &mut DesignApp, ui: &mut Ui) {
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
ui.add_space(8.0);
if outline_button(ui, crate::i18n::tr(&app.ui.language, "Options"), 66.0).clicked() {
- app.ui.open_panel = Some("paragraph".into());
+ show_panel(app, "paragraph");
}
});
});
diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs
index bcb27ddf9..af5a7b46c 100644
--- a/crates/ui-egui/src/widgets.rs
+++ b/crates/ui-egui/src/widgets.rs
@@ -364,6 +364,7 @@ pub fn link_label(ui: &mut Ui, text: &str, width: f32) -> Response {
ui.painter().galley(pos, g, t.text);
let y = r.center().y + 6.5;
ui.painter().line_segment([pos2(r.min.x, y), pos2(r.min.x + w, y)], Stroke::new(1.0, if resp.hovered() { t.text_strong } else { t.text_dim }));
+ resp.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Link, true, text));
resp.on_hover_cursor(egui::CursorIcon::PointingHand)
}