Repository navigation
Open and Place: a file read in the background waits for a busy tool only during a drag - #3791
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 1
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
…nly during a drag A file opened or placed off the UI thread waited while the active tool reported busy. The Dimension tool also reports busy between its clicks, so after one click a ready file stayed queued with its spinner until the dimension was finished or canceled. Files also waited between the clicks of the Blend tool. The session now records whether the pointer button is held. A file waits for a busy tool only while the button is held. A file that opens between a tool's clicks resets the tool, as a switch of documents does; a file placed in the active document leaves the tool's clicks in place. Files still wait while a dialog is open, a drag is under way or a preview is open, and a tool's preview between its clicks counts as one (the Flare tool after its center drag, the Dimension tool's line once the pointer moves after its second click).
df3deaf to
2db1ada
Compare
|
Merged, thanks @dotCooCoo! |
What and why
This change follows #3740.
On
main, a file opened or placed off the UI thread waits while the active tool reports busy. The Dimension tool alsoreports busy between its clicks. To see it, choose the Dimension tool, click once on the canvas, and open a file with
File › Open: the status bar shows "Opening" with its spinner until two more clicks place the dimension or Escape
cancels it. A file placed with File › Place waits the same way, and files also wait between the clicks of the Blend
tool.
The session now records whether the pointer button is held, and a file waits for a busy tool only while the button is
held. A file that opens between a tool's clicks becomes the active document and the tool starts afresh, as when the
user switches documents. A file placed in the active document leaves the tool's clicks in place. Files still wait
while a dialog is open, while a drag is under way and while a preview is open, a slider's or a tool's between its
clicks (the Flare tool after its center drag, the Dimension tool's line once the pointer moves after its second click).
How it was tested
opening::tests::a_file_ready_between_a_tools_clicks_opensopens a file after one Dimension click, and again aftertwo clicks, and checks that the tool starts afresh and makes no dimension.
opening::tests::a_file_ready_during_a_preview_waits_for_it_to_endchecks that a file still waits for a slider'spreview, with the Selection tool idle and with the Dimension tool between clicks, and for the Dimension tool's line.
placing::tests::a_file_read_between_a_tools_clicks_is_placedplaces a file after one Dimension click, in the samedocument (the tool keeps its point) and from another document.
tests::the_pointer_is_held_from_a_press_until_a_release_or_a_move(engine) checks the held state.The two between-clicks tests fail on
main's code (the file stays queued).On Windows 11 (x86-64) with rustc 1.99.0, on top of
mainat 4a7cba0:CRAFT_FONTS_DIR=<craft-fonts checkout> cargo xtask cipasses its 10 steps: 9,641 tests passed, 0 failed, 14 ignored.git merge-treereports no conflicts withmainat 4a7cba0.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.Summary by CodeRabbit