Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
433 changes: 433 additions & 0 deletions assets/locales/pending/drawing-export-window.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions crates/engine/src/cmd/drawing_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const CONTRACT: TypedContract<ExportParams> = TypedContract::new();
const MAX_PATH_BYTES: usize = 4096;

pub static COMMANDS: &[CommandSpec] = &[CommandSpec::new(CMD, "Export Sheet", crate::checked!("drawing.export", export))
.at("DRAWING REVIEW", "OUTPUT")
.icon("export")
.in_drawing()
.noundo()
Expand Down
11 changes: 6 additions & 5 deletions crates/engine/src/cmd/drawing_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//!
//! These entries reserve discoverable homes while the owning Drawing contracts land.
//! JSON execution always refuses; the UI may show reviewed option layouts separately.
//! `drawing.export.planned` keeps the disabled UI action separate from `drawing.export`
//! (the sheet export provider). View previews likewise use `.planned` ids so the
//! real base-view and projected-view providers keep their executable contracts.
//! View previews use `.planned` ids so the real base-view and projected-view providers keep
//! their executable contracts. Export has arrived: `drawing.export` holds its ribbon place, and
//! its button opens the Export window.

use super::CommandSpec;

Expand Down Expand Up @@ -84,7 +84,6 @@ pub static COMMANDS: &[CommandSpec] = &[
planned!("drawing.update.planned", "Update Drawing", "4892").at("DRAWING REVIEW", "CHANGES").icon("drawing_update"),
planned!("drawing.check.planned", "Check Drawing", "4894").at("DRAWING REVIEW", "CHANGES").icon("drawing_check"),
planned!("drawing.revision", "Add Drawing Revision", "4894").at("DRAWING REVIEW", "REVISION").icon("drawing_revision"),
planned!("drawing.export.planned", "Export Drawing", "4890").at("DRAWING REVIEW", "OUTPUT").icon("export"),
planned!("drawing.print", "Print Drawing", "4890").at("DRAWING REVIEW", "OUTPUT").icon("drawing_print"),
planned!("drawing.view.break", "Break View", "7578").at("DRAWING LAYOUT", "VIEWS").icon("drawing_view_break"),
planned!("drawing.view.auxiliary.planned", "Auxiliary View", "13044").at("DRAWING LAYOUT", "VIEWS").icon("drawing_view_auxiliary"),
Expand Down Expand Up @@ -120,7 +119,9 @@ mod tests {
for id in ["drawing.export", "drawing.view.base", "drawing.view.projected", "drawing.view.section", "drawing.view.auxiliary"] {
assert!(crate::find_command(id).unwrap().planned.is_none(), "the executable provider {id} stays registered");
}
assert!(crate::find_command("drawing.export.planned").unwrap().planned.is_some(), "the scaffold export stays disabled");
assert!(crate::find_command("drawing.export.planned").is_none(), "the real export holds its ribbon place");
let export = crate::find_command("drawing.export").unwrap();
assert_eq!((export.tab, export.panel), ("DRAWING REVIEW", "OUTPUT"));
for command in super::COMMANDS {
assert!(command.planned.is_some(), "{}", command.id);
assert!(!command.info(&session).enabled, "{}", command.id);
Expand Down
7 changes: 7 additions & 0 deletions crates/engine/src/drawing_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,13 @@ pub(crate) fn update(s: &mut Session) {
s.drawing_scenes.updated = s.world_state().ok();
}

/// Moves each time a view or a reading of dimensions is kept, or the cache turns to another
/// drawing: with the session's revision, it says when [`standing`] (`drawing.status`) may read
/// differently, so a window that shows it reads it again only then. Read-only and cheap.
pub fn drawn(s: &Session) -> (Option<u64>, u64) {
(s.drawing_scenes.drawing, s.drawing_scenes.serial)
}

/// `d`, the drawing open, is deferred and the model has moved on from its last [`update`].
pub(crate) fn held(s: &Session, d: &Drawing) -> bool {
s.world_state().is_ok_and(|state| s.drawing_scenes.holds(d, &state))
Expand Down
1 change: 1 addition & 0 deletions crates/ui-egui/src/command_help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub const DOCUMENTED: &[&str] = &[
"contact.list",
"document.inspect",
"document.units",
"drawing.export",
"drawing.table.edit",
"edit.checkpoint",
"edit.restore_checkpoint",
Expand Down
Loading
Loading