Repository navigation
Drawings: drawing.status catches up before it reads, so a reopened drawing's views say current (#4892) - #12573
Merged
bherbruck merged 1 commit intoNov 6, 2026
Conversation
…awing's views say current (tangency-labs#4892) Straight after a drawing opened again, drawing.status said out_of_date for views whose kept lines still show what the model shows, and drawing.update counted them as waiting. The first extract then found them up to date and drew nothing. status read the cache as it was: the kept lines came back and the keep pass ran only inside extract and the drawing step. One function, catch_up, now brings the cache to the drawing open and the world state: the kept lines come back, then each view that shows the same takes the state. extract, step, begin and drawing.status (and so drawing.update) all start there, so each says the same of a view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a drawing was closed and opened again,
drawing.statussaid its views were out of date, anddrawing.updatecounted them as waiting. Yet the first time the sheet was drawn, they were found up to date and nothing was drawn. Now status sayscurrentfor each view whose kept lines still show what the model shows, as the sheet then finds.Part of #4892, into
drawings. It follows #12423 (a view that shows the same keeps its lines), #12449 (deferred drawings) and #11126 (views worked out beside the window), all now indrawings. Claim: #4893.Changes a default: no
No setting changes.
drawing.statusanddrawing.update'swaitingchange after a reopen, from out of date to what the next sheet draw finds.What it does
The kept lines came back, and the pass that lets a view that shows the same keep them ran, only when a sheet was drawn (
extract) or a view was drawn (step,begin).drawing.statusread the cache as it was, so straight after a reopen it found no views.catch_up(s, d, views, state)brings the cache to the drawing open and the world state. The lines kept when the drawing closed come back, then each view that shows the same takes the state.extract,drawable(sostepandbegin) andstanding(sodrawing.statusanddrawing.update) all start there, so they can't disagree about a view.drawable: it gives nothing until a sheet has been drawn, which is the reopened state, and it covers one sheet. Status reports every view of the drawing, so it catches up all of them.drawing.statusnow updates the session's drawing cache (never the document, and nothing that is saved), the way the next sheet draw would. So its reply and the sheet agree.drawing.updateis dropped at close. Before, status said its views were waiting andheld: true. Now a view that shows the same sayscurrent, nothing waits, andheldisn't reported, which is whatdrawing.scenethen shows.standingtakes&mut Session. Its two callers,drawing.statusanddrawing.update, already have one.Cost: status goes over the drawing's view ids once. The shown set is worked out only when a kept view is behind the model, once, and is then kept for the next draw on that state. So a reopen does that work at status, not twice. With every view up to date, status costs what it did.
Validation
Local, Windows,
--profile ci, ondrawingsf50edc1:cargo check --all-targets(engine, then the workspace),cargo fmt --checkandcargo xtask listspass;-D warnings, passes;cargo xtask wasmpasses (14 crates);drawings(ecf75d9), before this change.Test, in
drawing_scene_tests.rs, next toclosing_the_drawing_keeps_its_lines_for_when_it_opens_again:opened_again_its_status_says_the_kept_lines_are_current: draw the sheet, close, open, thendrawing.statussays every view iscurrentwith nothing waiting. The sheet then finds nothing out of date and nothing is projected. Ondrawingsbefore this change it fails, with both viewsout_of_dateandwaiting: 2.Planted faults: 5, each caught by a drawing test, then a clean run that passes:
In the real program, through
solidcraft-clion a 100 × 50 × 20 box with one base view, a deferred drawing. It was updated and drawn, closed and opened again in the same session, thendrawing.statusread before any sheet was drawn:drawing.statusdrawingsf50edc1current, waiting 0current, waiting 0out_of_date, waiting 1, heldcurrent, waiting 0drawing.scene'sout_of_datecurrent, waiting 0current, waiting 0Before, status said the view was waiting and the drawing held, though the sheet then had nothing out of date.
Not covered by a test:
drawing.update's count after a reopen: it reads the same function as status.Screenshots of the behavior
None:
drawing.statusis a command with no UI. The CLI run above shows the reply before and after.Integration status
One commit on
drawingsf50edc1. A trial merge with each open PR intodrawingsthat touches the drawing scene files (#7608, #9421, #9463, #10761, #12356, #12357) adds no conflicting file.Refs #4892, #4893, #860