1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Automatic advance: evaluating the CURRENT guide step's goal against the design
//! and reporting it through `GuideModel.notify`.
//!
//! [`check_progress`] is the one entry point, called wherever the design or its
//! solve state can have changed: the end of `view::refresh_all` (New, Load, Open,
//! an explicit Solve), `view::refresh_editor_panel_stale` (every ordinary edit --
//! the tier form, quick add, inline edits, undo/redo, material and yield applies),
//! the tier-save/material/yield success callbacks themselves, and
//! `GuideModel.step_entered`. The background auto-solve's completion
//! (`auto_solve::apply`) and a matching solid-preview frame
//! (`view::push_solved_preview`) hold only a design snapshot, not the
//! `EditorState`, so they call [`check_design_progress`] -- the same evaluation,
//! one layer down. Every caller runs it AFTER `EditorModel.solve_state`/
//! `status_is_problem` have been updated for the result it is applying, since the
//! `solved_closed` goal reads them.
//!
//! Goals are judged from STATE, never from which button was clicked, so every
//! route to a goal counts (quick add, inline edit, undo/redo, auto-solve), and a
//! failed validation -- which never changes the design -- can never advance.
use crate::;
use Design;
use reached_completion;
use ComponentHandle;
/// Reports `key` to `GuideModel.notify` directly -- for a goal that is an EVENT
/// rather than a state `goal_reached` could read back afterwards (only
/// `NEW_DESIGN_CREATED` today). The Slint side ignores a key that is not the
/// current step's own.
pub
/// Evaluates the current guide step's goal against `state` and reports it to
/// `GuideModel.notify` when reached. A no-op while the guide is closed, on a manual
/// step, or while the current step is already showing "Done".
pub
/// [`check_progress`] for a caller holding only a `Design` (the background
/// auto-solve's completion, whose snapshot is the design it just solved).
pub