Skip to content

Drawings: drawing.status catches up before it reads, so a reopened drawing's views say current (#4892) - #12573

Merged
bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:drawing-status-catch-up-4892
Nov 6, 2026
Merged

bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:drawing-status-catch-up-4892

Conversation

@CamWight

@CamWight CamWight commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

When a drawing was closed and opened again, drawing.status said its views were out of date, and drawing.update counted them as waiting. Yet the first time the sheet was drawn, they were found up to date and nothing was drawn. Now status says current for 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 in drawings. Claim: #4893.

Changes a default: no
No setting changes. drawing.status and drawing.update's waiting change 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.status read the cache as it was, so straight after a reopen it found no views.

  • One place says what the cache knows: 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 (so step and begin) and standing (so drawing.status and drawing.update) all start there, so they can't disagree about a view.
  • Why not through 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.status now 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.
  • A deferred drawing opened again holds, as the last drawing.update is dropped at close. Before, status said its views were waiting and held: true. Now a view that shows the same says current, nothing waits, and held isn't reported, which is what drawing.scene then shows.
  • The keep pass takes view ids, the only part of the sheet's views it used.
  • standing takes &mut Session. Its two callers, drawing.status and drawing.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, on drawings f50edc1:

  • cargo check --all-targets (engine, then the workspace), cargo fmt --check and cargo xtask lists pass;
  • clippy over engine, all targets, -D warnings, passes;
  • cargo xtask wasm passes (14 crates);
  • the engine's library tests: 3,712 passed, 11 failed. None of the 11 is a drawing test (fillets, shell, holes, extents, a sketch projection, a mirrored part's meshes and the export command list). The same 11 failed on this PC in an earlier engine run on drawings (ecf75d9), before this change.

Test, in drawing_scene_tests.rs, next to closing_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, then drawing.status says every view is current with nothing waiting. The sheet then finds nothing out of date and nothing is projected. On drawings before this change it fails, with both views out_of_date and waiting: 2.

Planted faults: 5, each caught by a drawing test, then a clean run that passes:

  • status reads the cache without catching up, or catches up only the first view;
  • the kept lines don't come back;
  • the cache isn't marked as the open drawing's, so closing it keeps nothing;
  • a step doesn't catch up.

In the real program, through solidcraft-cli on 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, then drawing.status read before any sheet was drawn:

drawing.status drawings f50edc1 This PR
drawn, before closing current, waiting 0 current, waiting 0
straight after opening again out_of_date, waiting 1, held current, waiting 0
then drawing.scene's out_of_date none none
after that scene current, waiting 0 current, waiting 0

Before, status said the view was waiting and the drawing held, though the sheet then had nothing out of date.

Not covered by a test:

  • a view on a second sheet that was never drawn: the test's drawing has one sheet;
  • drawing.update's count after a reopen: it reads the same function as status.

Screenshots of the behavior

None: drawing.status is a command with no UI. The CLI run above shows the reply before and after.

Integration status

One commit on drawings f50edc1. A trial merge with each open PR into drawings that touches the drawing scene files (#7608, #9421, #9463, #10761, #12356, #12357) adds no conflicting file.

Refs #4892, #4893, #860

…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>
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@bherbruck
bherbruck merged commit e859b77 into tangency-labs:drawings Nov 6, 2026
31 checks passed
@CamWight
CamWight deleted the drawing-status-catch-up-4892 branch November 6, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants