Skip to content

Drawings WE2: a new Drawing Status command says which views and dimensions are current, out of date or failed, and why (#4894) - #11352

Merged
bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:drawing-status-4894
Nov 3, 2026
Merged

bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:drawing-status-4894

Conversation

@CamWight

@CamWight CamWight commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

This PR is for drawings: the paper sheets that show a design's views with dimensions and balloons. It adds a Drawing Status command (drawing.status) for scripts, agents and the drawing page. Until now nothing could say whether a view's lines are up to date, or why a view shows no lines. The new command says, for each view, whether it is current, out of date, a placeholder or failed. For a placeholder or a failed view, it also gives the reason. It does the same for each dimension. The command only reads: it draws nothing and changes nothing in the design.

Part of #4894 (WE2), into drawings: where a drawing stands: drawing.status in one read. One commit on drawings eb0b427, now that #11047 and #11350 have merged.

Changes a default: no

What it does

drawing.status says, for the drawing open, each view's status and its sheet: current,
out_of_date (not drawn yet, or drawn from another model or with other settings than it has
now), placeholder or failed, with why for the last two. current means drawn, from the
model and with the settings the view has now. A view that drew but didn't fit its sheet's scene
is failed, as that scene left it, while that scene is still its sheet's: the same sheet, the
same views on it, none drawn again since. drawing.scene reuses a scene by the same rule
(Cache::inputs). Balloons aren't listed; drawing.balloon.inspect reads each one. waiting
counts the views out of date. Each dimension's status uses the words drawing.inspect uses,
reading each body once for the call. It reads what the sheet page last drew: nothing is drawn
and nothing changes.

The new command has input and output schemas (DrawingStatusResult) and isn't on the
ribbon. The planned drawing.check entry in drawing_ui.rs (DRAWING REVIEW, CHANGES) is
its planned home; this PR leaves that entry as it is, so @Nathan-Dane's page can point it
at drawing.status. No planned entry is added or replaced. Nothing in crates/geom/ or
crates/ui-egui/ changes.

Pictures

Nothing new shows on screen at this commit: the command has no button yet. The real-program
check below reads the replies instead.

Tests

  • status_says_which_views_are_out_of_date
  • status_says_why_a_view_has_no_lines
  • status_takes_what_the_last_scene_left_out_until_a_view_draws_again
  • status_says_where_each_dimension_stands
  • status_takes_a_scene_only_for_its_sheet_as_it_is: a view the scene left out, moved to another sheet, and a view left on the sheet when the other goes, each read their own drawing again

Planted faults: 12 faults planted in the new code: each status word, each reason, the sheet, waiting, a scene that is no longer its sheet's, a dimension's word, and for the shared rule, a sheet's views or a view's serial left out of the comparison and a drawn view reading drawn. Each was caught by a test above, and each file was put back after. An earlier run missed three (a view that didn't fit, an old scene trusted, the sheet's id), which the third test and a sheet check in the second now cover.

What no test reaches

  • The drawn, placeholder and failed states in the real program. At this base nothing in the app
    steps the sheet provider yet (drawing_scene::step has no caller outside the tests; the sheet
    page will call it on its tick), so in the app every view reads out_of_date and waiting
    counts them all, which is what the provider holds. The tests step the provider by hand for
    the other states.

Validation

Updated 3 Nov (head 477fcaf97), on drawings eb0b427 after #11047 and #11350 merged; it also merges cleanly with drawings as it is now (112e0a3). A review of the code found that a view moved off the sheet whose scene left it out kept that scene's failed and its advice ("put it on another sheet"): the status trusted the last scene on its serial alone. It now trusts it only while it is still its sheet's scene, by the same check drawing.scene uses, with the test above written first (it failed before the fix). Status::reason now gives a view's reason for both drawing.scene and drawing.status, and the params doc says what current means and where balloons are read. On this head: fmt, clippy with -D warnings (geom, doc, engine, all targets), the engine's drawing (199) and command (55) tests, lists, layers and i18n --check pass, and all 12 planted faults are caught (clean run passes). The lines below are from before this update.

  • The full gate on this commit (371495d23): fmt, assets, icons, licences, lists, layers, ui-containers, both clippy runs, wasm and the web offline test pass. The tests ran as 80 binaries at once. Three tests failed under that load, and each passes when run alone: killed_mid_save_the_old_file_survives (9 s), pattern_of_512_hole_cuts_finishes_in_reasonable_time (138 s) and many_faces_are_classified_quickly (0.06 s). They test saving, patterns and the preview, not drawings. The GPU library's test binary stopped inside the graphics driver (0xC0000005), as it does on this PC. No rendering code changes here.
  • Slice checks on this commit: the geom (346), doc (558) and engine (3132) tests, clippy, lists, layers, cargo xtask i18n --check and the app build pass.
  • The real program: the same plain test design as WE1 (three views, one dimension). drawing.status gave each view's status and sheet, and waiting counted the views out of date. The dimension read ok. The reply was the same after a move to another sheet, its Undo and a model change. As said above, every view reads out_of_date at this base, because nothing in the app draws the sheet yet. The reply didn't change the design. The app wrote no crash reports.

Rules checked

  • New commands, each with input and output schemas: drawing.status.
  • Strings in assets/locales/pending/drawing-status.json, with en, ar, de, he, ja, ko, vi and zh; cargo xtask i18n --check passes.

Integration status

Based on drawings eb0b427, and merges cleanly with 112e0a3. Waits for nothing. It conflicts with three open drafts, #10987, #10926 and #10469; whichever lands second rebases.

Refs #4894, #860

@github-actions github-actions Bot added area:doc timeline, components, parameters, naming area:kernel B-rep kernel, booleans, blends, STEP/IGES area:ui desktop/web front end, dialogs, viewport labels Nov 2, 2026
@CamWight
CamWight marked this pull request as ready for review November 2, 2026 21:25
@CamWight
CamWight marked this pull request as draft November 2, 2026 21:27
@CamWight
CamWight marked this pull request as ready for review November 2, 2026 21:44
@CamWight
CamWight force-pushed the drawing-status-4894 branch from 371495d to 53ec0b7 Compare November 3, 2026 05:52
…WE2)

drawing.status says each view's status (current, out of date, placeholder or
failed, with why) from what the sheet page last drew, and each dimension's in the
words inspect uses, reading each body once for the call. Nothing is drawn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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:kernel B-rep kernel, booleans, blends, STEP/IGES area:ui desktop/web front end, dialogs, viewport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants