Skip to content

Drawings: a deferred drawing keeps its lines until it is updated (#4892) - #12449

Merged
bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:drawing-deferred-updates-4892
Nov 6, 2026
Merged

bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:drawing-deferred-updates-4892

Conversation

@CamWight

@CamWight CamWight commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

A drawing can now wait for you before it draws a model change. Set updates: deferred on it, and its views keep the lines they have until drawing.update. Meanwhile every command that reads the sheet reads what the page shows, and lists what is out of date. A drawing that follows the model, the default, works as before.

Part of #4892, into drawings. It builds on #12423 (a view draws again only when what it shows changes), now in drawings. The sheet page and its ribbon are @Nathan-Dane's UI; the ribbon's Update button stays planned here, and nothing in the sheet page changes.

Changes a default: no
Automatic stays the default, and only a deferred drawing is saved differently.

What it does

  • The setting: Drawing.updates is automatic (the default) or deferred. It is saved only when deferred, with one pending format note. drawing.set takes updates? (one undo step), and drawing.inspect shows it.
  • The hold: one rule, Cache::holds, decides it: a deferred drawing holds while the model has moved on from its last update. step draws nothing while held, and drawing.status says held. The hold is session state beside the scene cache, never saved.
  • drawing.update: lets the open drawing draw from the model as it is now, until that moves on again. It changes no document, so it is not an undo step. On a drawing that follows the model it does nothing. Its label is in a pending locale file (drawing-update.json), with a tests/kernel-cases/EXEMPT line (it makes no geometry).
  • What the page shows: the commands that read a sheet (the scene, the hit test, drawing.scene.line and the export) go through one function, as_shown. For an automatic drawing, that is the same build as before. For a deferred one, it is the provider's lines, and the reply lists out_of_date (views and dimensions). So export draws what the page shows.
  • One bounded settle: Drawings: which line of a view is under a point, and drawing.scene.line (#4816) #12396's loop that steps the sheet until nothing waits becomes one settle, bounded by the views and dimensions on the sheet.
  • The planned button: the ribbon's placeholder is renamed drawing.update.planned, as drawing.export.planned is beside drawing.export. A real command can't keep a pending artwork row, and wiring the button is the sheet page's step.

Cost: an automatic drawing's commands do the same work as before. A held one reads the provider's cache and projects nothing.

Validation

Local, Windows, --profile ci, on the tree of drawings b4242e9:

  • the commit builds on its own (cargo check --all-targets);
  • cargo xtask lists, i18n, kernel-cases --coverage, the format-pending check, icons and assets pass;
  • the workspace check (all targets), clippy on doc, engine and ui-egui (-D warnings) and the wasm build pass;
  • the engine library: all drawing tests pass. The only failures are the 11 kernel tests that fail on drawings itself on this PC (chord_and_variable_fillets, fillet_fit_taper_closes_to_a_point, shell_tangent_chain…, and the like). None is in the drawing code;
  • the doc library: the only failures are 2 tap-marking cost tests that fail on main on this PC too;
  • ui-egui's drawing, workspace, icon and command-help tests and icon_audit pass.

Tests first: with the hold switched off, a_deferred_drawing_keeps_its_lines_until_it_is_updated fails on "nothing is drawn before an update"; with it, all pass.

  • a_deferred_drawing_keeps_its_lines_until_it_is_updated:
    • nothing is drawn before an update;
    • after a model change made while the drawing is closed, and a view's scale changed, it shows its last lines with both views out of date;
    • drawing.status, the scene and the export list them, and nothing is projected;
    • an update draws them as the built scene does;
    • an edit taken back after that waits again.
  • a_drawings_updates_are_automatic_or_deferred: the setting, its undo step, and its save (automatic isn't saved).
  • updating_an_automatic_drawing_changes_nothing.

Planted faults: 12, each caught, then a clean run that passes. They cover:

  • the hold in step and in holds;
  • an update standing for later states;
  • automatic holding too;
  • the scene and the export reading the model instead of the page;
  • out_of_date and held left out;
  • the setting ignored by drawing.set, by inspect, or saved when automatic;
  • a settle that stops after one step.

Not covered on screen: nothing on screen can show the hold until the sheet page has its Update button. Instead, a CLI run (solidcraft-cli run, --param-check strict), in two parts so the second opens the saved file:

  • part 1: a 100 x 50 x 20 block, a drawing with its base view at 1:2, drawing.set {updates: deferred}, saved;
  • part 2, opened from the file:
    • drawing.status: held: true, waiting: 1, and the scene draws no view and lists it out of date;
    • drawing.update: the view is drawn, nothing is out of date;
    • the drawing closed, the block made 40 tall, opened again: still held, its last lines drawn, the view out of date;
    • drawing.update: drawn again, waiting: 0, not held.

Nearby:

Screenshots of the behavior

None: see "Not covered on screen" above.

Integration status

One commit on drawings b4242e9. It builds on its own.

…gency-labs#4892 U2)

A drawing's views follow the model automatically, or, when deferred, only on
drawing.update, which lets them draw from the model as it is now, for this
session only. The next model change holds again, and a close drops the update,
so a reopened deferred drawing waits. While it waits, its views show their last
lines, out of date.

drawing.set and drawing.inspect take and say `updates`, saved only when
deferred (a drawing-format pending note). drawing.scene, its hit and line
commands and drawing.export read what the page shows and list what is out of
date; drawing.status says held.

The ribbon's Update Drawing button stays planned as drawing.update.planned with
its art awaiting review, as Export does; the command itself takes the existing
update icon.

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

@github-actions github-actions Bot added area:doc timeline, components, parameters, naming area:ui desktop/web front end, dialogs, viewport labels Nov 6, 2026
@bherbruck
bherbruck merged commit 855ce28 into tangency-labs:drawings Nov 6, 2026
30 checks passed
@CamWight
CamWight deleted the drawing-deferred-updates-4892 branch November 6, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:doc timeline, components, parameters, naming area:ui desktop/web front end, dialogs, viewport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants