TUT1.1: restore the Typography workspace panel groups

This commit is contained in:
moppeeer
2026-10-15 19:07:12 +02:00
parent a930276fd7
commit 4ea23d4ccd
3 changed files with 53 additions and 5 deletions
+3
View File
@@ -343,6 +343,9 @@ list) · [roadmap.md](docs/roadmap.md) (milestones, plan) · [parity-checklist.m
## Progress log
- **2026-10-15** · Typography uses named panel groups with the Control panel and restores that
arrangement on Reset Workspace, leaving the page clear until a panel is opened.
- **2026-10-13** · Switching between document and parent pages refreshes the canvas immediately, preventing black parent pages and stale document objects when the zoom stays the same. Ordinary edits retain partial repainting. No readiness percentage change.
Newest first.
+43 -5
View File
@@ -844,6 +844,17 @@ pub const CLASSIC_GROUPS: &[&[&str]] = &[
&["gradient"],
];
/// The Typography preset's available panels in the order observed in InDesign's workspace.
/// CC Libraries and the separate Story panel have no corresponding DesignCraft panel.
pub const TYPOGRAPHY_GROUPS: &[&[&str]] = &[
&["pages", "layers", "swatches"],
&["glyphs", "textWrap"],
&["stroke", "gradient"],
&["hyperlinks", "effects"],
&["paragraph", "paragraphStyles"],
&["character", "characterStyles"],
];
pub fn ui_label(id: &str) -> Option<(&'static str, Option<&'static str>)> {
UI_COMMANDS.iter().find(|c| c.0 == id).map(|c| (c.1, c.2))
}
@@ -1627,11 +1638,14 @@ fn run_ui_inner(app: &mut DesignApp, id: &str, p: &Value) -> Option<Result<Value
app.ui.control_bar = matches!(name, "Advanced" | "Typography" | "Printing and Proofing" | "Book" | "Essentials Classic");
// Essentials Classic: the Control panel and an icon column of grouped panels, no
// Properties stack.
let classic = name == "Essentials Classic";
app.ui.icon_groups = classic.then(|| CLASSIC_GROUPS.iter().map(|g| g.iter().map(|p| p.to_string()).collect()).collect());
app.ui.dock_expanded = !classic;
let groups = match name {
"Essentials Classic" => Some(CLASSIC_GROUPS),
"Typography" => Some(TYPOGRAPHY_GROUPS),
_ => None,
};
app.ui.icon_groups = groups.map(|groups| groups.iter().map(|g| g.iter().map(|p| p.to_string()).collect()).collect());
app.ui.dock_expanded = groups.is_none();
let dock_tab = match name {
"Typography" => Some("properties"),
"Interactive for PDF" | "Digital Publishing" => Some("pages"),
_ => None,
};
@@ -1640,7 +1654,6 @@ fn run_ui_inner(app: &mut DesignApp, id: &str, p: &Value) -> Option<Result<Value
app.ui.dock_expanded = true;
}
app.ui.open_panel = match name {
"Typography" => Some("paragraphStyles".into()),
"Printing and Proofing" => Some("swatches".into()),
"Interactive for PDF" => Some("buttons".into()),
"Digital Publishing" => Some("liquid".into()),
@@ -3956,6 +3969,31 @@ mod tests {
assert_eq!(app.ui.icon_groups, Some(groups));
}
#[test]
fn typography_workspace_opens_its_panels_from_named_icon_groups_and_resets() {
let mut app = crate::DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
run_ui(&mut app, "window.workspace", &json!({"name":"Typography"})).unwrap().unwrap();
assert!(app.ui.control_bar);
assert!(!app.ui.dock_expanded);
assert!(app.ui.open_panel.is_none());
let groups = app.ui.icon_groups.clone().unwrap();
assert_eq!(groups[0], ["pages", "layers", "swatches"]);
assert_eq!(groups[4], ["paragraph", "paragraphStyles"]);
assert_eq!(groups[5], ["character", "characterStyles"]);
for panel in ["pages", "paragraphStyles", "characterStyles"] {
run_ui(&mut app, "window.panel", &json!({"panel":panel})).unwrap().unwrap();
assert_eq!(app.ui.open_panel.as_deref(), Some(panel));
assert!(!app.ui.dock_expanded);
}
run_ui(&mut app, "window.resetWorkspace", &json!({})).unwrap().unwrap();
assert_eq!(app.ui.icon_groups, Some(groups));
assert!(app.ui.open_panel.is_none());
assert!(!app.ui.dock_expanded);
run_ui(&mut app, "window.workspace", &json!({"name":"Essentials"})).unwrap().unwrap();
assert!(app.ui.icon_groups.is_none());
assert!(app.ui.dock_expanded);
}
#[test]
fn the_window_menu_is_in_indesigns_order_and_reaches_every_panel() {
let window = menu_tree().into_iter().find(|(m, _)| *m == "Window").unwrap().1;
+7
View File
@@ -61,6 +61,13 @@ context menus, typing at a caret) are things a layout artist does every minute,
## Remaining effort
Typography now starts and resets with the Control panel and named panel groups along the right
edge, including Paragraph/Paragraph Styles and Character/Character Styles. It does not open
Properties or a Styles flyout over the new page. This matches the available panels at 0:05–0:15
in [Jessica Garrity's styles tutorial](https://www.youtube.com/watch?v=pG9JkAPLgs8).
CC Libraries and a separate Story panel are absent; these are not needed for the tutorial's
style operations. The flyout tabs and detailed controls remain separate UI parity work.
| Work | Opus 5.5 h |
|---|---|
| Copy/paste, context menus, threading clicks, caret formatting on every platform, with control-channel regression tests | 30–50 |