Skip to content

Add the native Drawing workspace UI scaffold - #5349

Merged
bherbruck merged 5 commits into
tangency-labs:drawingsfrom
Nathan-Dane:codex/drawing-workspace-ui
Nov 2, 2026
Merged

bherbruck merged 5 commits into
tangency-labs:drawingsfrom
Nathan-Dane:codex/drawing-workspace-ui

Conversation

@Nathan-Dane

@Nathan-Dane Nathan-Dane commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

The Drawing workspace needs a native visual anchor while its document and rendering providers are developed. This adds the agreed UI scaffold using the existing shell, ribbon pins and section lists, a compact draggable sheet strip, and resizable left/right settings and operation panels.

Existing source BOM, properties and flat-pattern services use their current implementations. Planned Drawing tools are faded; only the four settled option layouts open, with execution disabled. No drawing file, sheet renderer, view generation or annotation behavior is added. The 22 original icon drafts remain Open for human review and use runtime placeholders.

This UI-only slice is coordinated with the existing W16/W23 claim in #4895; that PR retains the full milestone. The implementation roadmap records the three commits and later provider boundaries. Base branch: drawings.

Current maintenance validation (2026-11-02):

  • Full bounded cargo xtask ci passed on the published source: 10,562 native tests passed, including Drawing provider isolation, scaffold UI and runtime icon-audit checks.
  • Repository gates, workspace Clippy, WebAssembly and doc checks passed. Browser offline testing was skipped because Chrome is absent.
  • The native screenshots below are original scaffold evidence; this maintenance pass does not claim a new native visual review.

To review: Workspace → Drawing (UI preview); unfold a ribbon section; inspect Base View options; use the sheet-strip gear for Sheet Settings; resize/dock that panel; drag the strip to top, bottom or beneath Browser. Switch back to Design to check preserved source state.

Native Drawing workspace and Base View options

Native Sheet Settings

Changes a default: no

Integration update, 2026-11-02: rebased onto the actual drawings target at 85be50d, preserving newer Drawing providers. Scaffold export, base-view and projected-view previews use separate .planned IDs and cannot shadow executable providers. All 102 scaffold strings are supplied in each of eight locales through a pending catalog, and the 22 original icon attributions use the pending attribution file. The PR remains ready while current-head remote CI runs. Maintainers control queue admission; no pushes will be made once queued.

@CamWight

Copy link
Copy Markdown
Contributor

Hi @Nathan-Dane, a heads-up on the view window, so it fits your scaffold. We'll build it with the UI kit, and we'd love you to review it and adjust it to the workspace's style once it's up.

How it opens:

  • double-clicking a view's boundary on the sheet;
  • Enter on a selected view;
  • right-click › Edit View;
  • double-clicking the view in the Drawing browser.

All of them do ui.start {command: "drawing.view.edit", params: {view}}, the path #1297 uses for Drive Joints. We'd make it a panel kind in your operation-panel host, holding a view id. Does that suit the host?

What it reads and writes:

  • drawing.view.inspect {view} returns every setting, where its value comes from (set here, the parent view, the drawing or the default) and the choices.
  • drawing.view.edit {view, set: {…}} writes the changes. OK is one undo step.

Buttons: Apply, OK and an X at the top right. The X closes without applying.

First fields:

  • display style;
  • reference parts (their own style, and whether they hide the model);
  • the reference margin;
  • scale (presets, a typed ratio, or follow the parent);
  • Link view;
  • Aligned to parent.

The picture resolution is a sheet setting, so it isn't here.

On the sheet:

  • A view's boundary shows when the pointer is near its edge.
  • A view is dragged only by that edge: inside it, clicks pick lines, parts, features or assemblies by selection mode.
  • Boundaries are screen-only; the prepared scene will carry them as per-object hit data, as your canvas spec asks.

The plan is on #4894 and #860 (W17c). Anything in your host or spec we should build around?

matthias037 added a commit to matthias037/node-cad that referenced this pull request Oct 26, 2026
…teur

La coquille de Nathan Dane (tangency-labs/solidcraft#5349 : ruban à quatre
onglets, barre des feuilles, réglages de la feuille) reçoit le moteur de mise
en plan de NØDE CAD :
- Vue de base, Mettre à jour la mise en plan et Exporter deviennent de vraies
  commandes (drawing.view.base, drawing.update, drawing.export), à leurs places ;
  les outils pas encore faits restent prévus, désactivés.
- La feuille s'affiche dans la zone de dessin, telle qu'elle s'imprime ; la
  barre des feuilles et le navigateur la nomment, avec ses vues et ses cotes.
- Réglages de la feuille : cartouche, format, orientation, échelle,
  projection, traits cachés ; Vue de base : les vues ; Exporter : PDF, SVG, DXF.
- Une nouvelle mise en plan (clic, script ou NØDE IA) ouvre l'espace ; la
  fenêtre flottante ne sert plus que si l'espace ne peut pas s'ouvrir.
- L'espace passe de « Prévu » à disponible, avec ses onglets ; tout est en
  français (la coquille n'avait pas de français).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PaddleStroke

Copy link
Copy Markdown
Contributor

FYI I have an open PR to freecad to make a 'new page' tool. Imo its UI is quite nice :
image

@CamWight

Copy link
Copy Markdown
Contributor

Hi @Nathan-Dane, thank you again for the workspace scaffold. We’re now aiming at a first usable drawing, and #5349 is where it lives, so we’d love to line up with you.

What the first usable drawing needs from the workspace:

The Drawing workspace in the switch: your scaffold already does this. It opens a design’s drawing (drawings now live inside the design’s .sc, #7490).
A sheet page in the centre: the sheet drawn at its size, with pan and zoom, and a choice of sheet from your sheet strip.
Picking on the sheet: select a view, a dimension, the parts list or a balloon, then move or delete it.
The operation panels: our view window, the dimension tool and a small parts-list editor would each be a panel kind in your host.
The ribbon: Base View, Projected View, Dimension, Parts List, Balloon, Revision Table and Export become active as each command lands. The rest stay faded.

Two questions:

Could #5349 go up for review into drawings as it is? Everything above builds on it, and we’d rather add to your scaffold than work around it.
Would you like to build the sheet page itself, or shall we build it on your scaffold and ask you to review its look? We’re happy either way, and we’ll keep to the UI kit and your layout.

Thanks!

@Nathan-Dane

Copy link
Copy Markdown
Contributor Author

@CamWight I'd love to build the drawing UI. If I can get some specifications of what features it needs and reference to some PRs with features that need to be compatible, I can certainly make a more final design.
I've marked this PR as open and ready.

@CamWight

CamWight commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

@Nathan-Dane, thank you, that's great news. Here is what the first release of drawings needs from the UI, which commands each part calls, where those commands are and how far along they are, and what has to stay compatible. The engine side (records, commands, the paper scene, exports) stays with us, so everything you build calls commands. Where a command you need doesn't exist yet, tell us and we'll add it.

How the UI talks to the engine

  • Drawings live inside the design's file (Drawings saved inside the design's file, in both forms (#3890) #7490). A design can have several drawings. A drawing is opened with drawing.open and closed with drawing.close. While one is open, the drawing commands change it and the model's commands are refused. The refusal says why: "a drawing is open: close it to change the model". So entering the Drawing workspace is drawing.open (or drawing.create when there's none), and leaving it is drawing.close.
  • Undo: each drawing has its own undo history. Every change to a drawing is one undo step of that drawing and evaluates nothing in the model. Making and deleting a drawing are undo steps of the model.
  • Enabled rules: every drawing command carries its rule in the engine. drawing.create, drawing.list, drawing.open, drawing.close and drawing.delete work any time. Every other drawing command needs an open drawing. The UI asks CommandSpec::info(session).enabled, as your scaffold's test does, and never repeats a rule.
  • Command shapes: every command is JSON in and JSON out, and the newer ones have typed contracts (input and output JSON schemas). solidcraft-cli commands lists each command's parameters. ui.start {command, params} opens a command's window or tool, and engine.execute runs it with no window, as CLAUDE.md says.
  • Your planned entries (crates/engine/src/cmd/drawing_ui.rs): when a real command lands, it takes your entry's place, its id, and its ribbon tab and section (.at(…)), as your roadmap says. A few of the ids differ from our plans; see question 1.
  • Screen-only things never reach the files: sheet colour, the shadow, selection, hover, view boundaries, out-of-date marks, pan and zoom, and the active sheet. Exports of the same sheet are byte-identical whatever the screen shows. Pan, zoom, the active sheet and the selection are never undo steps and never mark the design as changed.

The data you read

What Record (Rust) Read with
A drawing: name, units, projection (first or third angle), content language, properties, sources, sheets, views crates/doc/src/drawing.rs (Drawing, Sheet, Source, Units, Excluded) drawing.inspect, drawing.list, drawing.properties
A view: kind (base or projected), parent and side, place (at a point, or lined up with its parent), settings that follow the parent until set crates/doc/src/drawing/view.rs, crates/doc/src/drawing_view.rs (ViewSettings) drawing.view.inspect
A sheet's paper: sizes, orientation, the ISO 5457 border and its marks crates/geom/src/drawing_sheet.rs drawing.inspect (each sheet's size_mm, orientation, dpi, documents, excluded)
A title block's cells and fields crates/geom/src/title_block.rs, crates/geom/src/cell.rs (S2, #3877, in drawings) the sheet's scene (see the canvas, below)
What is drawn on paper crates/geom/src/paper.rs: a Scene of Group {object, kind, items}. Kinds are sheet border, drawing border, title block, parts list, revision table and view. Items are strokes and fills, in millimetres from the sheet's lower-left corner, with y up drawing.view.snapshot {scene: true} for one view now; a whole sheet's scene is planned (see the canvas)
Bill of materials rows crates/doc/src/bom.rs assembly.bom

The engine's own schemas are in crates/engine/src/schema/drawing_sheet.rs and crates/engine/src/schema/drawing_view.rs.

Each part of the UI

1. The sheet page (pan and zoom)

  • Shows the active sheet's scene: paper, border, title block, views and tables, drawn true to paper. Line widths are paper widths, and never thinner than one pixel.
  • Navigation: the shared navigation with orbit off, as your scaffold does: pan, zoom to the cursor, Fit Sheet. 100 % is the true size at any UI scale.
  • Calls: drawing.inspect (the sheets), and the sheet's scene once it exists.
  • The canvas provider: not built yet. The plan is a Rust call, drawing_scene::extract(session, drawing, sheet) -> Arc<Scene>, which returns what was last worked out and never computes on the window thread. A drawing.scene command returns the same scene as JSON for scripts. Each group has its object id, its kind and its bounds, and the scene has a generation number, so the page redraws its cache only when that number changes. One view's scene exists now (drawing.view.snapshot {scene: true}, the W07 PR, today). The border and title block groups come with the sheet slices on Drawing W18: sheets, borders, title blocks and drawing templates #3875. We build the provider: tell us what you need from it (question 4).
  • Sheet colour (decided by @CamWight): a preference with White, Warm, Dark and Auto (theme). It changes the screen only, and print and export are always white.

2. The sheet strip

  • Shows the drawing's sheets in order, with add, rename, settings, reorder and delete.

  • Calls:

    • drawing.inspect for the list;
    • drawing.sheet.add {after?, name?, size?, orientation?, dpi?, documents?, excluded?};
    • drawing.sheet.set {sheet, …}: a change of paper replies with outside, the views that now leave the drawing border. None is moved, so the UI can show them;
    • drawing.sheet.reorder {sheets};
    • drawing.sheet.delete {sheet}, which refuses the last sheet.

    Each is one undo step, and none when nothing changes.

  • Where: the sheet commands are built and checked. Their PR into drawings opens today as part of the sheet slices on Drawing W18: sheets, borders, title blocks and drawing templates #3875, and I'll post the number.

  • Sheet Settings panel: reads the same drawing.inspect fields and writes drawing.sheet.set. The title block's and border's choices and the templates are S3 on Drawing W18: sheets, borders, title blocks and drawing templates #3875, still to come.

3. Picking and selection

  • Decided by @CamWight:
  • Calls:
    • drawing.view.inspect {view} → boundary_mm (on the sheet);
    • drawing.view.snapshot → each line's source: occurrence path, body, and the edge or silhouette face that drew it (the W07 PR, today);
    • selection is select.set and select.clear. Selected drawing objects (Sel::Drawing {drawing, object}) are engine work, ours: tell us when you need them.
  • Not decided: how a click inside a view finds its line (question 2).

4. Move and delete

5. The view window

  • Opened by double-clicking a view, by Enter on a selected view, from the Browser, or with ui.start {command: "drawing.view.edit", params: {view}}.

  • Reads drawing.view.inspect {view} → settings (scale, display_style, reference_style, reference_hides_model, tangent_edges). Each setting comes as {value, from: this | parent | default, parent?, set}, so the window can show "from the parent view". It also gives reference_margin_mm, direction, place, linked and choices (the display styles and scales to offer).

  • Writes drawing.view.edit {view, set: {…}}. A setting set to null follows the parent again. linked: true makes a projected view take all its display settings from its parent. The reply lists what changed and the followers that changed with it.

  • Buttons (decided by @CamWight): Apply, OK, and an X at the top right, with no Cancel:

    • each Apply that changes something is one undo step;
    • X drops only what wasn't applied, and closes;
    • OK applies what's pending, then closes.

    The window shows a live preview.

  • Where: built and checked, Drawing views: inspect and edit a saved view (#4816, W17c) #7614 (a draft into drawings, on Drawing views in the drawing record: base and projected views, and the projection (#4816) #7613). @0xlillith is writing an event, state and undo acceptance matrix for this window.

6. The dimension tool

7. The parts-list editor

8. The ribbon

Your four tabs (Layout, Annotate, Parts & Tables, Review) are the homes. What each planned entry becomes, and who builds it:

Your entry Becomes Who, and where
Base View, Projected View drawing.view.base {sheet, source?, position_mm, …settings} and drawing.view.projected {parent, side, position_mm?, …} us, #4816 (the next view slices; the record they write is built)
Section View, Detail View drawing.view.section, drawing.view.detail later W17 slices
Align Views lining up is drawing.view.edit {set: {place: {aligned: n}}} today us, #4816
Insert Image pictures in the paper scene us, #5624 (#7590, #7591, drafts)
Drawing Line sheet sketches, W38a @0xlillith
Browse Drawing Resources templates, title blocks and borders, S3 us, #3875
Drawing Dimension the W19d commands above (question 1) us, #4896
Hole Callout W29a @Gleinkaa, #7605
Note, Leader Note W19e us, #4896
Datum W28a @armin0411, #7257
Centre Mark W20d, W20e us, #4896
Parts List, Balloon, Edit Table, Revision Table P8, P11, P9's commands, W31 us, #3874
Update Drawing, Check Drawing W14 (drawing.update), W32 (drawing.check) us, #4892
Add Drawing Revision W31 (the hand-filled table first) us, #3874
Export Drawing, Print W21 and W22 (SVG now, PNG #7429, dashes #7430; PDF writer by @0xlillith) us, #4890

9. The Browser (decided by @CamWight)

  • The drawing, its resources, then each sheet with its border, title block, revision table, parts list and views.
  • Views made from another view (projected, section, detail) nest under the view they come from.
  • Each view lists its source's tree (components, folders), so a part can be hidden in that one view. That is drawing.view.snapshot's hide today, and the saved view's hide next.
  • A mark in the tree on each view that needs an update, with words on hover.
  • Double-clicking a view opens its window. Framing it moves to the right-click menu.
  • No right-hand panel: status lives in the tree, and dimensions are edited on the sheet.

What must stay compatible

Questions for you

  1. Command ids. Your planned drawing.dimension is one entry. Our plan has drawing.dimension.add, .edit, .inspect and .delete (the <area>.<thing>.<verb> shape the sheet and view commands use). Suggestion: the ribbon entry becomes drawing.dimension.add, and ui.start on it opens the tool. The same question applies to drawing.parts_list, drawing.balloon and drawing.revision_table. Is that all right with you, or would you rather the entry kept its id?
  2. Picking inside a view. Today the scene's strokes carry only the view's id, and each line's source is in the snapshot's lines, in the same paper millimetres. Would you rather have each stroke carry its line's source in the scene, or pick against lines?
  3. The drawing chooser. A design can have several drawings. Where would you like to choose one: in the sheet strip, in the Browser, or in a menu on entering the workspace?
  4. The canvas provider. Is extract(session, drawing, sheet) -> Arc<Scene>, with a generation number and per-group bounds, what you need? Do you also want a "computing" state while a sheet's views are being worked out?
  5. Selection. For selected drawing objects, would select.set {items: [{type: "drawing", drawing, object}]} suit your hit testing, with sub-objects for a line inside a view?
  6. Delete. Would you rather have one selection.delete that takes drawing objects too, or a delete command for each kind of object?

Thanks again! Tell us whenever something you need is missing, and we'll add it on the engine side.

@selun3

selun3 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

@Nathan-Dane @CamWight — W38a #7608 now connects sheet sketches to the canonical drawing.scene / drawing.export and cached provider at db86dcf8bd8d13f7041a6b3b3cc5c20afc37482d, tested tree 6ae4542a20085b2480ace1b0896f28159312c390. The new reproduction uses actual commands, the settled provider and shared writers, with real design-container save/reopen. Supported SVG/PNG bytes agree across reopening; the complete mixed scene retains exact geometry and both writers propagate the existing A3b refusal. The image is writer output. Native/browser canvas and editor acceptance remain unfinished.

All 46 scene/provider/export/schema cases passed (11 new). Strict workspace Clippy, all 12 wasm crates and doc-tests passed. Complete engine tests passed (3,239 library + 38 integration), as did all 583 document and 219 IO tests. The standard offline launcher/cache harness passed; it does not establish Drawing canvas acceptance.

Full cargo xtask ci: FAILED: 10,725 passed / 19 failed / 69 existing skips; all 10,744 ordinary tests ran across 83 binaries. Failures: 18 solidcraft-gpu, 1 solidcraft-ui-egui. Their cause remains unqualified; this is not a gate waiver.

The editor still uses drawing.sketch.create {owner: exact_sheet_id} / drawing.sketch.edit {sketch: exact_sketch_id}, admitted existing sketch.* tools, drawing.sketch.inspect, and sketch.finish / sketch.cancel. Coordinates are physical paper millimetres from the sheet's lower-left corner, x right/y up. Inspection gives points and curve ids, not complete curve primitives. Pan, zoom and active-sheet presentation remain with the UI host; shared selection composition awaits #11047. The current K/store/session path, canonical model/sheet Cancel and drawing-local history remain the command boundary.

drawing_scene::extract(session, sheet) now returns sorted sketches results (SketchStatus::Drawn | Failed(reason)) and stale_sketches, separately from unchanged view-only views / stale. It does no solve or expression/model evaluation. Schedule one step(session) per tick: it processes at most one stale view projection or one sketch solve/conversion; false can mean the final work item just completed. Unchanged extraction reuses the Scene Arc and generation. Valid numeric view moves reuse sketch solves. Source definitions/units, ownership and drawing admission changes mark sketches stale; failures stay cached until their inputs change. Sketch groups paint after views, before future tables/title blocks, without view transforms.

We will extend #11047's SheetObject seam after coordinated composition; this slice adds no duplicate object envelope or local point/curve provenance. Nathan retains canvas, navigation, panels and the pointer host. W38b/c/e and other scene owners retain their scopes. The exact sheet schema includes cubic/conic/Bézier records even while SVG/PNG's shared grid refuses unsupported families until A3b. Failed sketches and downstream SVG writer refusals leave export destinations untouched; PNG command support is unchanged.

The two earlier handoff questions still apply:

  1. Should the provisional Drawing Line slot start the existing sketch.line after sheet-sketch entry, keeping one executable tool id?
  2. What minimal local curve/point records does the pointer host need alongside Drawings WE3-WE5: commands report where each object sits on a sheet, and select and delete views, dimensions and balloons (#4894) #11047's whole-object bounds for picking and point dragging?

This stays draft and unmerged; W38a/M2/M3 and native/browser editor acceptance are not complete. Earlier receipts remain bound to their recorded source revisions.

DevonHope added a commit to DevonHope/solidcraft that referenced this pull request Oct 29, 2026
…s (Refs tangency-labs#5866)

`drawing.view.base`, `drawing.view.projected`, `drawing.view.set`,
`drawing.view.delete` and `drawing.title_block.set` write the records this
morning's change added, and `drawing.inspect` now reports each sheet's views and
title block and the drawing's projection, which `drawing.set` takes. Each
command has a contract and an output schema, and each evaluates nothing: what a
view draws is worked out when it is drawn, so placing one is a document edit and
one undo step of the drawing.

The plan asked for `drawing.delete` to delete a view, but that id deletes a
*drawing*, so this is `drawing.view.delete`. It takes the views projected from a
base view with it, because the record will not keep a projection whose base view
is gone. The other ids were checked against tangency-labs#5349, which reserves
`drawing.view.base` and `drawing.view.projected` and nothing for setting or
deleting.

A projected view moves by `offset_mm`, one number along its own side, not by
`position_mm`: it shares a coordinate with the view it comes from, so a pair
would carry a number that means nothing and a sideways move would do nothing.
Each command refuses the other's parameter rather than ignoring it. Moving a
base view moves its projections by the same delta, so they stay lined up and
keep their spacing, and `drawing.view.set {clear: [...]}` gives a style field
back to what the view follows, which `present`'s refusal of null left no way to
say. Changing the drawing's projection while projected views stand is refused:
the other angle puts each of them on the other side of its parent, so they would
quietly show other sides of the model where they stand.

The tests tie the default projection to what a user would see: the view placed
above the front comes back named `bottom` in first angle and `top` in third,
which is ISO 5456-2 through `projected_basis`, the record and the reply.

Every registered command needs a catalog label, and every catalog in `COMPLETE`
must carry it. That list is ar, he, ja, vi and zh (`ui-egui/src/i18n.rs:449`),
not the "en, ja, zh, de and ko" the ui-text skill still says, so the five labels
go in one pending file in eight locales, following the house terms and the
standards' words for a title block (JIS 表題欄, DIN Schriftfeld, TCVN khung
tên). The Hebrew and Vietnamese wordings want a native speaker's eye.

Measured while checking that: the inherited
`every_complete_catalog_carries_every_english_message` failure is three
catalogs, not one. ar, he and vi are each missing the same 11 upstream
`cmd.drawing_*` ids; the test stops at the first one, which is why only Arabic
was named yesterday. PROGRESS.md §8.6 now says so. This change does not add to
it.

The component a view draws is checked by the command, because the record never
sees the design and so cannot: a view of a component the design hasn't got is
refused rather than saved. The three new ideas also take their glossary terms,
which `docs/book/src/reference/glossary.md` asks of any change that adds one.

Verified: `cargo fmt --all --check` clean, `cargo clippy -p solidcraft-engine
--all-targets` silent, `cargo xtask lists` ok (the pending locale file folds
cleanly), and the engine tests matching `drawing` pass (`--lib`) — among them
the schema key checks for all four new contracts and 14 new strict-mode cases
that hold the contract and the handler to the same message for the same mistake,
and `hostile_drawing_params_never_panic`, which now sends hostile values at the
11 new parameter names as well.

Three things were deliberately NOT run, on a machine whose ten cores were busy
with the owner's own Fusion render: `cargo xtask ci` (free disk 35 GB, under the
60 GB a workspace-wide build needs here), the engine-wide
`hostile_params_never_panic` (one thread per core, about ten minutes), and the
ui-egui label tests (the heaviest link in the repository). The two checks those
label tests make were verified against the catalog files directly instead: every
new id is in `en` with the label its spec carries, and in all five `COMPLETE`
catalogs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
DevonHope added a commit to DevonHope/solidcraft that referenced this pull request Oct 29, 2026
…gency-labs#4890)

`drawing.sheet.paper` returns a sheet's marks in the paper format the SVG, DXF,
PDF and PNG writers read: the sheet border, the drawing border with its grid and
marks, the title block, then one group per view with its hidden lines under its
visible ones. It saves nothing, and it is the heaviest drawing command, because
every view's hidden lines are worked out.

The new piece under it is `drawing_view::drawn`, which turns a sheet's records
into frames and lines and which the freshness item will want as well. Base views
are worked out first, because a projection is lined up with its parent's frame;
two passes suffice, since the record keeps a projection's parent a base view of
the same sheet. A view with no scale of its own is fitted to the drawing area
around where it sits, by the rule `drawing.view.snapshot` already used — now one
function rather than two copies of it.

A projected view takes no scale of its own, and geom is what decides that:
`ViewFrame::aligned` draws a projection at its parent's scale, because a frame
cannot be both at another scale and lined up with one at a different scale. So
`drawing.view.projected` and `drawing.view.set` refuse `style.scale` on a
projection and `drawn` refuses a file that carries one, in the same words. A
scaled view of part of a drawing is a detail view, which tangency-labs#5349 reserves an id
for.

Hidden lines are drawn only where a view's style asks for them. The shaded
styles and `tangent_edges: show` are refused in the words the snapshot uses,
because the same two things are missing (tangency-labs#5624, tangency-labs#5866), and a sheet with no
drawing border is refused because there is no layout to lay marks out in.

The chain is proven rather than assumed:
`the_scene_a_sheet_gives_is_one_the_svg_writer_draws` takes the command's scene
through `Scene::prepare` into io's `paper_svg`, asserts an SVG document with at
least seven paths and the A3 size in it, and then does it again and compares
bytes. That is the phase's done-when — "the SVG is correct ... two runs give
identical bytes" — bar `drawing.export`, which is now only the file writing.

One assumption was measured and turned out false: a plain box seen square on has
no hidden lines at all, because its back edges project exactly onto its front
ones. The hidden-line test asserted the opposite and failed; it now looks from
an isometric corner, where a box does hide three edges, and asserts the square-on
case too.

Verified on a quiet machine: fmt clean, clippy silent on the engine, `cargo
xtask lists` ok, and 55 engine tests matching `drawing` pass (`--lib`), five of
them new. The seven labels this work has added are each in `en` with no other id
carrying the same text and in all five complete catalogs; the non-European
wordings still want a native speaker's eye. `cargo xtask ci` was not run: free
disk is 30 GB against the 60 GB it needs here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@CamWight

CamWight commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Hi @Nathan-Dane, a short update to the list from 30 Oct: three small things for the drawing UI. Nothing here needs an answer.

  1. The view's window: how much of the reference parts a view shows. A control from 0% to 100% on reference_shown_percent. At 0% (the default) the view's box fits the model alone; at 100% it grows to hold every reference part, each side on its own. The engine side is already on drawings (Drawing views: a view shows its reference parts by percent (#5866, V5c) #10713): drawing.view.base, drawing.view.projected and drawing.view.set all take it, and drawing.view.inspect returns it. So the UI needs just the one control, a slider or a number field, whichever suits the window.
  2. The export window: two paper choices. Beside the usual white, "Blueprint" and "Prussian Blue (Historical)", both with light lines and text on blue paper, in SVG and PNG. It's drawing.export {paper: white | blueprint | prussian_blue}, white by default (Drawing export: a sheet can be exported on Blueprint or Prussian Blue paper (#10679) #10681, nearly ready). It's an export option only, not a sheet colour, and it isn't tied to the theme.
  3. A heads-up on one name. Following @SiroArt's proposal on Proposal: display style, section views and material display as their own saved settings #5307, a view's display_style setting is being renamed to visual_style, in one small PR on drawings. The values stay the same (visible, visible_hidden, shaded, shaded_visible, shaded_visible_hidden). If any of your work reads display_style, it only needs the new name once that PR lands. We'll link it here.

Thank you, and as before, the look and placement of all of these are yours.

@CamWight

CamWight commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Hi @Nathan-Dane, two more small UI choices from @CamWight. As always, the look is yours:

  1. A tab for each drawing. A preference, on by default: each open drawing shows as its own tab in the strip. Turning it off goes back to one tab per file, with the workspace switch and chooser picking the drawing.
  2. The blue export papers and the blueprint themes. On screen, the sheet's colour follows the theme. When a blueprint theme is on, the export window's paper choice starts on the matching blue paper (Blueprint or Prussian Blue) rather than white. With every other theme it starts on white. The engine stays explicit: drawing.export {paper} is white unless the call names another, so this is only the window's starting choice.

@Loohi

Loohi commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Hi @CamWight, @Nathan-Dane - I'd like to help with the drawing UI. Would it be OK if I took the sheet page (section 1.3 of the 30 Oct list): drawing the sheet from drawing_scene::extract in the Drawing workspace, with pan and zoom, Fit Sheet, true size at 100% and the sheet colour preference? Nathan-Dane, if you already have this underway, I'll leave it and pick something else. If it's free, should I open a child issue of #4894 for it?

@CamWight

CamWight commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Hi @Loohi, thank you for offering, help on the drawing UI is very welcome. The drawing UI is @Nathan-Dane's area: he took it on here on 27 Oct, and this PR is his scaffold. So the sheet page is his call.

@Nathan-Dane, have you started the sheet page (section 1.3: drawing the sheet from drawing_scene::extract, pan and zoom, Fit Sheet, true size at 100%, the sheet colour)? If you haven't, would you be happy for @Loohi to take it?

The engine side is ready for whoever builds it. drawing_scene::extract gives the sheet's groups each frame, and drawing_jobs::tick runs a view's lines and its shaded picture beside the window. Right now nothing in the app calls either of them on drawings. We're looking to complete our side of the drawing work in the next few days, so the sheet page is the piece that makes it usable. If it goes ahead, a child issue of #4894 is the right place, as you suggest.

@Benny1496

Benny1496 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Hi @Nathan-Dane,

CamWight suggested that I reach out to you directly to coordinate the next steps for the 2D Drawing UI.

Over the past few days, we’ve run several extensive tests covering automatic 2D drawing updates after changes to a 3D model, updates to existing dimensions, and detection of invalid dimension references.

Tests #92, #93 and #95 passed and showed that these features are already working well at the engine level.

In test #94, we focused specifically on the graphical interface. It confirmed that the Drawing workspace is not yet fully connected to the engine: the sheet is still a placeholder, the dimension tools cannot be used yet, and warnings for invalid references are not visible to the user.

CamWight mentioned that you’re coordinating the Drawing UI and that @Loohi has offered to work on the sheet page.

I’d be happy to contribute to the remaining UI work, particularly showing lost or out-of-date dimensions in the interface. Ideally, users should be able to see which dimension is affected, why its reference is no longer valid, and what repair options are available.

Alternatively, I could help with the interactive dimension tools if that would be more useful.

Before starting any development, I’d like to check with you which parts are already being worked on and where I could help without duplicating anyone’s efforts or creating conflicting changes.

My main focus so far has been reliable 3D-to-2D updates, so it would be great to contribute to the user-facing side of that workflow as well. We could also use our existing tests as acceptance checks once the UI is connected.

What would you recommend? Is there a specific part of the Drawing UI that I could take on?

Thanks for your time and best regards,
Benny

@Nathan-Dane

Copy link
Copy Markdown
Contributor Author

Hi @CamWight, @Loohi and @Benny1496, thanks for the offers and for the test results, Benny. They are the first ones that show what's missing from the GUI.

I haven't started the sheet page, so Loohi, it's yours if you'd like it: the sheet drawn from drawing_scene::extract, pan and zoom, Fit Sheet, true size at 100% and the sheet colour. A child issue of #4894 is the right place.

Benny, I'd love your help with the lost and out-of-date dimensions: which one is affected, why its reference is gone, and how to repair it. I'll take the interactive dimension tools afterwards, unless you'd rather do them.

I've written the UI design down in #13159 (draft, into drawings), with a picture per screen and a log of what's decided, so we all build the same thing. Please have a look before you start, and say in your PR which pictures you followed and where you had to differ.

Cam, your notes from 3 Nov are all in it: the reference-parts slider, visual_style, the export paper choice and a tab per drawing. Three things I'd like you to check: the third-angle symbol and the parts list above the title block (ISO 7573), whether the view window can pick a face of the part, and what "Standard views" should place.

I'll take the Sheets section, the ribbon's real commands and the tool panels, and open the child issues once #13159 is in.

@Benny1496

Copy link
Copy Markdown
Contributor

Hi @Nathan-Dane,

Thank you for your reply and for giving me the opportunity to contribute to the Drawing UI.

I'd be very happy to take on the lost and out-of-date dimensions.

It's especially important to me that users can immediately see when a dimension is no longer current after a 3D model change, or when its reference has been lost. Alongside a clear warning, the UI should explain the reason and, where possible, show the available repair options.

I've had a look at your new design PR #13159. The proposed status indicator and the different dimension states fit very well with what I had in mind for this feature.

I'll follow the design guidelines and make sure our work fits alongside the other Drawing UI components.

I'm happy for you to take the interactive dimension tools as you suggested. That gives us a clear division of work.

We can also use our existing tests later to verify that these features work reliably in the actual user interface.

I'd prefer to wait until your design PR has been integrated and the work has been split into child issues, so we can build on the same foundation.

Thanks again for your support. I'm looking forward to working together!

Best regards,
Benny

@Nathan-Dane

Copy link
Copy Markdown
Contributor Author

Thanks Benny, that's great, and I'm glad the status pill and the states fit what you had in mind. The lost and out-of-date dimensions are yours. I'll open a child issue of #4894 for it once #13159 is in, with the status card board and the decisions it follows (D07 and D26), and I'll take the interactive dimension tools after. Cam's plan for Check Drawing in #13054 (findings as data, plus a separate coverage list) may be a useful source for what the card shows.

@Loohi

Loohi commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

@Nathan-Dane while #13211 is in review, could I take the Export window next (D24, review-export.png)? Or is it part of the ribbon commands and tool panels you're taking? I'd wire the ribbon's Export button to a right-hand panel that calls drawing.export: SVG and PNG for now, PDF and DXF greyed out as planned, plus the paper choice Cam asked for. Happy to leave it if you've already started.

@Nathan-Dane

Copy link
Copy Markdown
Contributor Author

@Loohi you can feel free to take that! Just ping me again when you're done and continue writing down what's different in the implementation to the design. The description of #13211 is good!

I'll just pick up all the differences to the design and do that final round of polish for each feature, also ensuring it properly uses the UI components.
For now that includes integrating the sheet controls into the navigation bar.

matthias037 added a commit to matthias037/node-cad that referenced this pull request Dec 1, 2026
…teur

La coquille de Nathan Dane (tangency-labs/solidcraft#5349 : ruban à quatre
onglets, barre des feuilles, réglages de la feuille) reçoit le moteur de mise
en plan de NØDE CAD :
- Vue de base, Mettre à jour la mise en plan et Exporter deviennent de vraies
  commandes (drawing.view.base, drawing.update, drawing.export), à leurs places ;
  les outils pas encore faits restent prévus, désactivés.
- La feuille s'affiche dans la zone de dessin, telle qu'elle s'imprime ; la
  barre des feuilles et le navigateur la nomment, avec ses vues et ses cotes.
- Réglages de la feuille : cartouche, format, orientation, échelle,
  projection, traits cachés ; Vue de base : les vues ; Exporter : PDF, SVG, DXF.
- Une nouvelle mise en plan (clic, script ou NØDE IA) ouvre l'espace ; la
  fenêtre flottante ne sert plus que si l'espace ne peut pas s'ouvrir.
- L'espace passe de « Prévu » à disponible, avec ses onglets ; tout est en
  français (la coquille n'avait pas de français).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:infra CI, tooling, repo, docs area:ui desktop/web front end, dialogs, viewport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants