mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-13 12:10:38 +00:00
a0c1a67220
* ui: spacing, radius and type tokens, per-tab accents, agent and on-accent tokens * ui: per-tab accent behaviour and a larger application bar with a Start page button * icons: silhouette master and flat assistant and agent link icons (open for review) * icons: apply review notes (sparkle assistant, refined plug, silhouette halo) * icons: wire the silhouette master to inspect.silhouette; record the accepted icons * ui: application bar to the design: separators, Save, house, assistant icon, readable hovers * ui: ribbon structure: Model to View tabs, contextual Sketch and Sheet Metal, migrated pins * ui: ribbon painting to the compact design * ui: smaller icon button highlight and assistant mark on the bubble corner * ui: short ribbon labels that wrap at spaces * ui: ribbon buttons fit their labels and Finish Sketch shows its full name * ui: constraint gallery, workspace menu, section list headings and richer tooltips * ui: lighter selected tab label, ribbon surface and dimmer bar separators match the dark design * ui: document tabs as rounded chips with a dimmer inactive label * ui: document tabs fit their names and show close only when active or hovered * icons: close and plus masters for the document tabs (open for review) * ui: centre the new-tab plus and overflow button on the bar * ui: a quiet rule under the ribbon tabs on non-contextual tabs * ui: the application bar mark separates its faces with the bar colour, not white * ui: open ribbon section label uses the selected tint and a chevron * ui: dim the tab close and plus icons until hovered * ui: every ribbon dropdown uses the chevron, the workspace card included * ui: the active document tab uses the design's surface colour * ui: the bug button's right padding mirrors its icon side * ui: square constraint cells and a rule before the grid * ui: constraint cells back to their earlier size, keeping the rule * ui: smaller constraint cells and icons, centred in the section * ui: constraint cells fit the height of the large buttons' icon and label * ui: sketch Create titles share the other labels' line * ui: format the application bar and ribbon changes * ui: active tab surface token and the colour and hover tests that follow the redesign * tests: the merged parameter and narrow toolbar tests follow the compact ribbon * i18n: the Malay Gap label has an English source and its Japanese and Chinese translations * apply_off_thread tests: the evaluation lingers in tests, so still computing never depends on machine speed --------- Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
33 lines
1.4 KiB
Rust
33 lines
1.4 KiB
Rust
//! The Parameters dialog's ▲ / ▼ buttons reorder user parameters (#1187).
|
|
use serde_json::json;
|
|
use solidcraft_ui_egui::scenario::Harness;
|
|
|
|
fn order(h: &mut Harness) -> Vec<String> {
|
|
let v = h.app.session.execute("parameters.list", &json!({"filter": "user"})).unwrap();
|
|
v["parameters"].as_array().unwrap().iter().map(|r| r["name"].as_str().unwrap().to_string()).collect()
|
|
}
|
|
|
|
#[test]
|
|
fn arrows_move_user_parameters_up_and_down() {
|
|
let mut h = Harness::new();
|
|
for (n, e) in [("a", "1 mm"), ("b", "2 mm"), ("c", "3 mm")] {
|
|
h.app.session.execute("parameters.add", &json!({"name": n, "expression": e})).unwrap();
|
|
}
|
|
// The Browser's Parameters row starts this command; the ribbon shows only the active tab.
|
|
h.call("ui.start", json!({"command":"parameters.change"}));
|
|
h.frames(3);
|
|
assert!(h.app.params.is_some());
|
|
h.frames(3);
|
|
h.run(&json!([{"click":{"handle":"param:after:a"}}])).unwrap();
|
|
h.frames(2);
|
|
assert_eq!(order(&mut h), ["b", "a", "c"]);
|
|
h.run(&json!([{"click":{"handle":"param:before:c"}}])).unwrap();
|
|
h.frames(2);
|
|
assert_eq!(order(&mut h), ["b", "c", "a"]);
|
|
// The first row cannot move up, the last cannot move down.
|
|
h.run(&json!([{"click":{"handle":"param:before:b"}}, {"click":{"handle":"param:after:a"}}])).unwrap();
|
|
h.frames(2);
|
|
assert_eq!(order(&mut h), ["b", "c", "a"]);
|
|
assert!(h.app.params.as_ref().unwrap().error.is_none());
|
|
}
|