Skip to content
Merged
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
1 change: 1 addition & 0 deletions crates/data/src/raster/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ pub(super) fn read_with_nodata(
let mut r = Raster::new(name, w, h, vec![data], gt, crs, nodata, ColorHint::Gray, "Float32")?;
r.lost.extend(super::planetary::note_of(crs));
if assumed {
r.crs_assumed = true;
r.lost.push(super::assumed_wgs84_note(
crs_issue.unwrap_or("it doesn't say its coordinate system (a .prj file next to an ASCII grid does)"),
));
Expand Down
1 change: 1 addition & 0 deletions crates/data/src/raster/geotiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,7 @@ pub(super) fn read_limited_with_nodata(
r.copyright = copyright.filter(|c| !c.is_empty());
r.lost.extend(copyright_lost);
r.lost.extend(super::planetary::note_of(crs));
r.crs_assumed = assumed.is_some();
r.lost.extend(assumed);
r.lost.extend(turned);
r.lost.extend(table_lost);
Expand Down
7 changes: 7 additions & 0 deletions crates/data/src/raster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,11 @@ pub struct Raster {
/// `false` for a scan (a TIFF with no GeoTIFF tags, a PNG, a JPEG): `transform` is then only
/// a stand-in until the picture is placed or georeferenced, and says nothing about the ground.
pub georeferenced: bool,
/// Whether `crs` is WGS 84 assumed for a file that doesn't say its system, its coordinates
/// looking like degrees (an ASCII grid without a `.prj`, a GeoTIFF without one), or says only
/// that it is in degrees (a GeoTIFF's geographic model with no EPSG code, its datum unread):
/// it names no system to give (a project taking its system from the first layer added).
pub crs_assumed: bool,
/// What reading it left out or cut (a colour table, names), one line a kind with a count,
/// for whoever adds it to the map to say (AGENTS.md, Never silent). Empty when nothing was
/// left out.
Expand Down Expand Up @@ -922,6 +927,7 @@ impl Raster {
step: 1,
posts: false,
georeferenced: true,
crs_assumed: false,
lost: Vec::new(),
rounded: Vec::new(),
rounded_some: Vec::new(),
Expand Down Expand Up @@ -1544,6 +1550,7 @@ pub fn read_converted(path: &Path, c: &gdal::Converted) -> Result<Raster> {
// assumed as if it had been the file's own): said with the raster's other losses, whichever way
// it is read, as a reload says them again.
if c.assumed_lonlat {
r.crs_assumed = true;
r.lost.push(format!("{} (give \"crs\" if not)", assumed_wgs84_note("it doesn't say its coordinate system")));
}
if !c.others.is_empty() {
Expand Down
3 changes: 3 additions & 0 deletions crates/data/src/raster/zarr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2070,8 +2070,10 @@ pub fn assemble(store: &Store, plan: &Plan, chunks: &HashMap<String, Vec<u8>>, n
// Unread proj: values stay visible beside the system used, or in the error below.
let found = crs_of(store, a);
let unread = if found.is_none() { unread_proj(a) } else { None };
let mut crs_assumed = false;
let (crs, crs_notes): (Option<Crs>, Vec<String>) = if lonlat {
let assumed = lonlat_assumption(found.as_ref().map(|(c, _)| *c), crs);
crs_assumed = assumed.is_some();
let (actual, note) = found.unwrap_or((Crs::LonLat, None));
(Some(if actual.is_geographic() { actual } else { Crs::LonLat }), note.into_iter().chain(assumed).collect())
} else {
Expand Down Expand Up @@ -2117,6 +2119,7 @@ pub fn assemble(store: &Store, plan: &Plan, chunks: &HashMap<String, Vec<u8>>, n
if rounded > 0 {
r.rounded = vec![rounded];
}
r.crs_assumed = crs_assumed;
r.lost.extend(crs_notes);
r.lost.extend(unread);
// A transform the coordinates stood in for is said, not dropped without a word.
Expand Down
2 changes: 2 additions & 0 deletions crates/engine/src/cmd/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ fn build_package(s: &mut Session, p: &Value, notes: &mut Vec<String>) -> Result<
}
let mut project = crate::project::Project::new(area.clone());
project.field_origin = origin;
// New layers made in the field are held in the home project's system, as at home.
(project.coordinate_system, project.crs_from_first_layer) = (s.project.coordinate_system, s.project.crs_from_first_layer);
// The package has no home offline areas and carries its association in field_origin.
map.offline_area_id = None;
let mut copied = Vec::new();
Expand Down
10 changes: 9 additions & 1 deletion crates/engine/src/cmd/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,15 @@ fn layer_template(s: &mut Session, p: &Value) -> CmdResult {
o => return Err(format!("unknown layer template '{o}'")),
};
let name = ps(p, "name").map(str::trim).filter(|n| !n.is_empty()).unwrap_or(title);
let id = super::layer::add_dataset(s, Dataset::new(name, gt, fields));
let mut ds = Dataset::new(name, gt, fields);
// Held in the project's coordinate system, when it has one (#2032 C3a).
// One that doesn't convert to longitude/latitude, which the map draws through, is said.
if let Some(crs) = s.project.coordinate_system
&& let Err(e) = ds.hold_as(crs, Some(crs))
{
s.notify(format!("Layer '{name}' is held in longitude/latitude, not the project's coordinate system: {e}"), false);
}
let id = super::layer::add_dataset(s, ds);
if let Some(l) = s.map_mut().layer_mut(id) {
l.labels.default.field = "name".into();
}
Expand Down
35 changes: 35 additions & 0 deletions crates/engine/src/cmd/navigate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,13 +1247,48 @@ fn new_map(s: &mut Session, p: &Value) -> CmdResult {
}
let mut m = Map::new(name.clone());
(m.basemap, m.paper) = (s.map().basemap, s.map().paper);
// Drawn in the project's coordinate system, where the active map is looking; one a map can't
// be drawn in is said, and the map starts in Web Mercator as without one.
if let Some(crs) = s.project.coordinate_system {
match map_projection_for(crs) {
Ok(projection) => {
(m.projection, m.camera) = (s.map().projection.clone(), s.map().camera);
m.camera.bearing = 0.0;
m.camera.pitch = 0.0;
m.set_projection(projection);
}
Err(why) => s.notify(format!("New map '{name}' is drawn in Web Mercator: {why}"), false),
}
}
s.project.maps.push(m);
s.project.active_map = s.project.maps.len() - 1;
s.active_layer = None;
s.table_layer = None;
Ok(json!({"name": name}))
}

/// The map projection for a coordinate system, or why a map can't be drawn in it: a map is
/// drawn in Web Mercator, a world projection or a projected system with an EPSG or ESRI code.
pub fn map_projection_for(crs: rustgis_data::raster::Crs) -> Result<Projection, String> {
use rustgis_data::raster::Crs;
match crs {
Crs::WebMercator => Ok(Projection::WebMercator),
c if c.is_geographic() => {
Err(format!("the project's coordinate system, {}, is in degrees, and a map is drawn in a projected one", c.label()))
}
// An ESRI system is a custom one named by its code.
c => {
let code = match c {
Crs::Epsg(_) => c.code(),
_ => Some(c.label()).filter(|l| l.starts_with("ESRI:")).ok_or_else(|| {
format!("a map is drawn in a system with an EPSG or ESRI code, and the project's, {}, has none", c.label())
})?,
};
Projection::from_code(&code).map_err(|e| format!("a map can't be drawn in the project's coordinate system, {}: {e}", c.label()))
}
}
}

/// Uses the strict map selector for operations that accept map names or null.
fn map_inputs(input: &super::InputContext<'_>, p: &Value) -> Result<super::Inputs, String> {
let s = input;
Expand Down
152 changes: 152 additions & 0 deletions crates/engine/src/cmd/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub fn commands() -> Vec<C> {
C::new("project.save", "Save Project", "Project", save).inputs(save_inputs).roles(&[]).effects(crate::policy::Effects::NONE.with(crate::policy::Effect::Files)).key("Mod+S").view().params(r#"{"path"?: string}"#),
C::new("project.saveAs", "Save Project As", "Project", save_as).inputs(save_as_inputs).roles(&[]).effects(crate::policy::Effects::NONE.with(crate::policy::Effect::Files)).key("Mod+Shift+S").view().params(r#"{"path": string}"#),
C::new("project.rename", "Rename Project", "Project", rename).roles(&[]).effects(crate::policy::Effects::NONE).params(r#"{"name": string}"#),
C::new("project.coordinateSystem", "Project Coordinate System", "Project", coordinate_system).roles(&[]).effects(crate::policy::Effects::NONE)
.params(r#"{"crs"?: the system new maps are drawn in and new empty layers are held in: EPSG:<code>, ESRI:<code>, WKT or a PROJ string ("" or null: none, as a project starts; omitted: kept), "fromFirstLayer"?: bool (while the project has none, the first layer added with a coordinate system gives it; omitted: kept)}"#),
C::new("edit.undo", "Undo", "Quick Access Toolbar", |s, _| if s.undo() { Ok(Value::Null) } else { Err("nothing to undo".into()) }).roles(&[]).effects(crate::policy::Effects::NONE.with(crate::policy::Effect::History))
.key("Mod+Z")
.view()
Expand Down Expand Up @@ -822,6 +824,155 @@ fn rename(s: &mut Session, p: &Value) -> CmdResult {
Ok(Value::Null)
}

/// Sets the project's coordinate system and whether the first layer added gives it one. Maps
/// and layers already in the project keep their own systems: it is what new ones start in.
fn coordinate_system(s: &mut Session, p: &Value) -> CmdResult {
let given = p.get("crs");
let from_first = p.get("fromFirstLayer").filter(|v| !v.is_null());
if given.is_none() && from_first.is_none() {
return Err("give crs, fromFirstLayer or both".into());
}
let crs = match given {
None => s.project.coordinate_system,
Some(Value::Null) => None,
Some(Value::String(t)) if t.trim().is_empty() => None,
Some(Value::String(t)) => {
Some(rustgis_data::raster::Crs::parse(super::within("crs", "a coordinate system", t, 64 * 1024)?.as_str())?)
}
Some(_) => return Err("crs is a coordinate system's code, WKT or PROJ string, or null".into()),
};
let from_first = match from_first {
None => s.project.crs_from_first_layer,
Some(v) => v.as_bool().ok_or("fromFirstLayer is true or false")?,
};
s.project.coordinate_system = crs;
s.project.crs_from_first_layer = from_first;
// A system chosen, or the option off: rasters waiting for their pixels were added before it,
// and give none later (cleared again, or the option on again).
if crs.is_some() || !from_first {
s.project.first_layer.settle();
}
Ok(project_crs_json(&s.project))
}

/// Text `crs` reads back as the same system: an EPSG or ESRI code, else a custom system's WKT when
/// it was given one (its PROJ definition alone can leave out what places points, such as angles in
/// grads), else its PROJ definition.
pub fn crs_text(crs: rustgis_data::raster::Crs) -> String {
let label = crs.label();
if label.starts_with("ESRI:") { label } else { crs.definition_text() }
}

/// The project's coordinate system as commands give it: text that `crs` reads back as the same
/// system ([`crs_text`]), its name, whether a map can be drawn in it, and whether the first layer
/// added gives it one.
pub(crate) fn project_crs_json(project: &crate::project::Project) -> Value {
let crs = project.coordinate_system;
json!({
"crs": crs.map(crs_text),
"label": crs.map(|c| c.label()),
"mapsCanUse": crs.map(|c| super::navigate::map_projection_for(c).is_ok()),
"fromFirstLayer": project.crs_from_first_layer,
})
}

/// Commands that add data from outside the project without being under Home › Add.
const ADDS_DATA: &[&str] = &["map.import", "layer.paste", "offline.open"];

/// The layers in the project before a step that adds data (a command of Home › Add: a file, a
/// URL, a service, a database; or [`ADDS_DATA`]), when the project is to take its coordinate
/// system from the first layer added ([`Project::crs_from_first_layer`]) and has none yet; else
/// `None`, and nothing is looked at. A tool's output isn't a layer added: a raster made from one
/// whose system was assumed would name WGS 84 as if it had been given. Undo and Redo change
/// nothing (they are views of history), and a project opened or started brings its own setting.
/// A raster added with its pixels still to come (read in place, or from a server) says no system
/// until they land: [`take_first_layer_system`] keeps it waiting, and any later step that changes
/// the project, not only one adding data, looks at those waiting.
///
/// [`Project::crs_from_first_layer`]: crate::project::Project::crs_from_first_layer
pub(crate) fn first_layer_watch(s: &Session, spec: &crate::CommandSpec) -> Option<FirstLayerWatch> {
let p = &s.project;
if !spec.mutates || !p.crs_from_first_layer || p.coordinate_system.is_some() {
return None;
}
let adds_data = spec.location.starts_with("Home › Add") || ADDS_DATA.contains(&spec.id);
if !adds_data && p.first_layer.pending.is_empty() {
return None;
}
let waiting = &p.first_layer.pending;
let before =
p.maps.iter().flat_map(|m| m.layers.iter()).map(rustgis_map::Layer::instance_id).filter(|id| !waiting.contains(id)).collect();
Some(FirstLayerWatch { opened: s.opened, before, adds_data })
}

/// What [`first_layer_watch`] saw before a step, for [`take_first_layer_system`] after it.
pub(crate) struct FirstLayerWatch {
opened: u64,
before: std::collections::HashSet<u64>,
/// The step adds data: the layers it added are looked at, besides the rasters waiting.
adds_data: bool,
}

/// The coordinate system a layer says it is in: a raster's, or the one a feature layer was read
/// in. `None` for a layer whose file named none: a feature layer taken for longitude/latitude, a
/// raster read as WGS 84 because its coordinates look like degrees, a scan not yet placed.
pub fn layer_system(l: &rustgis_map::Layer) -> Option<rustgis_data::raster::Crs> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A raster that names no coordinate system can give the project WGS 84. layer_system returns the raster's crs, but a reader that finds no georeferencing assumes WGS 84 and still stores Crs::LonLat (e.g. crates/data/src/raster/ascii.rs:98-100, and the GDAL path with assumed_lonlat in gdal.rs). The assumption is only recorded in r.lost as a note. So with "take it from the first layer" on, adding an ASCII grid with no .prj sets the project to EPSG:4326 and the notice in take_first_layer_system reads as if the layer named it. The docs in this PR say "a layer that names no system … gives none", so this contradicts them.

Suggested fix: carry an "assumed" flag on the raster data (or check for the assumed note) and return None from layer_system when the system was assumed. Add a test next to a_layer_without_a_system_of_its_own_gives_none with an ASCII grid that has no .prj inside lon/lat bounds: the project stays None, and the clean case with a .prj still gives the system. Please also check unreferenced rasters (crates/data/src/raster/mod.rs:1175 area) for the same default.

Confidence: high for the ASCII path, medium for the other readers.

Category: bug

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in dd5dba8: rasters record when their system was assumed (Raster::crs_assumed, set by the ASCII, GeoTIFF, GDAL-converted, JPEG 2000 and Zarr readers), and layer_system gives none for those and for unplaced scans. Test: a_raster_read_as_wgs84_by_assumption_gives_none_and_one_that_names_its_system_gives_it (an ASCII grid without a .prj gives none; with an LV95 .prj it gives LV95).

match &l.raster {
Some(r) => r.data.as_ref().filter(|d| d.georeferenced && !d.crs_assumed).map(|d| d.crs),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A raster derived from an assumed-WGS 84 raster names WGS 84 as if the file had. layer_system trusts crs_assumed, but the tool outputs don't carry it. crates/analysis/src/rasterops.rs:40 (derive) and :53 (derive_hillshade) build the output with r.crs and Raster::new, which defaults crs_assumed to false. So a DEM with no .prj (coordinates look like degrees, so WGS 84 is assumed and the project stays unset) gives the project WGS 84 once a tool such as hillshade adds its output: the notice reads "from layer 'Hillshade'" and never mentions the assumption. The PR docs say a layer that names no system gives none, so this contradicts them.

Suggested fix: in derive and derive_hillshade, copy the flag from the source (out.crs_assumed = r.crs_assumed; before returning). Check the other Raster::new(..., r.crs, ...) derivations in crates/analysis too. Regression test next to a_raster_read_as_wgs84_by_assumption_gives_none_and_one_that_names_its_system_gives_it: a grid with no .prj, then a derived output, leaves the project at None.

Category: bug

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 45c1eae, differently from the suggestion: tools build rasters in many places and their outputs often come back as GeoTIFF bytes that name EPSG:4326, so the flag wouldn't survive. Instead only steps that add data (Home › Add, Import Map, Paste Layers, Open Offline Map) look at new layers; a tool's output gives no system. Docs say so. Test: a_tool_output_gives_no_system_only_data_added_does.

None => l.dataset.crs,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A feature layer that names WGS 84 never gives the project its system, against the docs. For features, layer_system returns l.dataset.crs, but readers set that only for a system other than longitude/latitude: SourceInfo::coordinate_system() filters Crs::LonLat out (crates/data/src/source/mod.rs, Crs::parse(&self.crs).ok().filter(|c| *c != Crs::LonLat)), and the GeoPackage edit path does the same with is_lonlat(). EPSG:4326 is Crs::LonLat (crs.rs, 4326 => Some(Crs::LonLat)). So a Shapefile or GeoPackage whose .prj says WGS 84 gives None.

The docs in this PR say the opposite. docs/user-guide/maps.md says a layer "that names WGS 84 or another system in degrees gives that". Rasters follow that rule, because RasterLayer data keeps Crs::LonLat for a named WGS 84 grid.

Failure scenario: option on, no project system. Add cities.shp with a WGS 84 .prj. Nothing is adopted and no notice is given. Add parcels.gpkg in EPSG:2056, and the project takes LV95 "from layer 'parcels'". The first layer's stated system should have settled the project, so the later layer should not have changed it.

Fix either side. Make the feature path keep a named WGS 84 (for example, carry "named LonLat" separately from "no system"), or correct the docs and the "takes it from the first layer" wording to say features naming WGS 84 give none. Add a test next to a_layer_without_a_system_of_its_own_gives_none with a WGS 84 feature layer.

Category: bug

}
}

/// After a step: the project takes the coordinate system of the first layer it added that has
/// one, in the maps' order, and says so ([`first_layer_watch`]). Each layer is looked at once, by
/// the innermost step that added it, so a step around it (a script and its lines) doesn't take it
/// again; rasters whose pixels are still to come wait. What was looked at is kept with the project
/// ([`crate::project::FirstLayerSeen`]), so Undo and a rolled-back command restore it.
pub(crate) fn take_first_layer_system(s: &mut Session, FirstLayerWatch { opened, before, adds_data }: &FirstLayerWatch) {
if s.opened != *opened || !s.project.crs_from_first_layer || s.project.coordinate_system.is_some() {
return;
}
let p = &mut s.project;
let (mut found, mut waiting) = (None, Vec::new());
for l in p.maps.iter().flat_map(|m| m.layers.iter()) {
let id = l.instance_id();
let candidate = if *adds_data { !before.contains(&id) } else { p.first_layer.pending.contains(&id) };
if !candidate || p.first_layer.considered.contains(&id) {
continue;
}
if l.raster.as_ref().is_some_and(|r| r.data.is_none()) {
waiting.push(id);
continue;
}
p.first_layer.considered.insert(id);
if found.is_none() {
found = layer_system(l).map(|crs| (crs, l.name.clone()));
}
}
// Waiting: those still to come, and only layers still in the project (Undo restores the list
// with a layer it brings back).
let present: std::collections::HashSet<u64> =
p.maps.iter().flat_map(|m| m.layers.iter()).map(rustgis_map::Layer::instance_id).collect();
let considered = &p.first_layer.considered;
p.first_layer.pending.retain(|id| present.contains(id) && !considered.contains(id));
for id in waiting {
if !p.first_layer.pending.contains(&id) {
p.first_layer.pending.push(id);
}
}
if let Some((crs, name)) = found {
p.coordinate_system = Some(crs);
p.first_layer.settle();
s.notify(
format!(
"The project's coordinate system is now {}, from layer '{name}': new maps are drawn in it and new layers held in it",
crs.label()
),
false,
);
}
}

/// Picks the map tool: a Create tool needs a layer of its kind selected, and the tools that
/// change features (Edit Vertices, Cut Polygon, Reshape) need editing on.
fn set_tool(s: &mut Session, p: &Value) -> CmdResult {
Expand Down Expand Up @@ -953,6 +1104,7 @@ fn info(s: &mut Session, p: &Value) -> CmdResult {
Ok(json!({
"name": s.project.name,
"path": s.path.as_ref().map(|p| p.display().to_string()),
"coordinateSystem": project_crs_json(&s.project),
"unsaved": s.dirty(),
"maps": s.project.maps.iter().map(|m| m.name.clone()).collect::<Vec<_>>(),
"activeMap": m.name,
Expand Down
4 changes: 3 additions & 1 deletion crates/engine/src/cmd/raster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,9 @@ fn add_jpeg2000_bytes(s: &mut Session, p: &Value, name: &str, bytes: Vec<u8>, zo
let c = raster::gdal::convert_jpeg2000(bytes, crs, MAX_UPLOAD_BYTES as u64).map_err(|e| format!("{name}: {e}"))?;
let stem = Path::new(name).file_stem().and_then(|s| s.to_str()).unwrap_or("raster");
let file_name = format!("{stem}.tif");
let r = raster::read_bytes(&file_name, &c.tif).map_err(|e| format!("{name}: {e}"))?;
let mut r = raster::read_bytes(&file_name, &c.tif).map_err(|e| format!("{name}: {e}"))?;
// The GeoTIFF GDAL made names the WGS 84 it assumed, as if the file had.
r.crs_assumed |= c.assumed_lonlat;
if c.assumed_lonlat {
s.notify(format!("{name} doesn't say its coordinate system; its coordinates look like longitude/latitude, so it's read as WGS 84 (give \"crs\" if not)"), false);
}
Expand Down
1 change: 1 addition & 0 deletions crates/engine/src/cmd/workflows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ fn check_prepared_prefix(s: &Session, lines: &[(usize, String, Value)]) -> Resul
/// A line that makes rows of its own (a layer edit, a layer from a selection) isn't one. Table edits are the
/// exception: their rows are recorded and taken, so later tools retain their shared input.
pub(crate) const ON_A_COPY: &[&str] = &[
"project.coordinateSystem",
"edit.enable",
"edit.setValue",
"edit.addFeature",
Expand Down
10 changes: 10 additions & 0 deletions crates/engine/src/policy/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -989,11 +989,21 @@ impl Session {
result
})
};
// Each step that adds data, however it lands (a read ahead, a download, a URL
// read in place, a line of a script or task), may add the layer the project takes
// its system from, and any step that changes the project may find a raster added
// earlier whose pixels have landed: taken then, so the steps after it (a new map)
// start in it, and inside the transaction that made it, so Undo and a failure take
// it back and the project is unsaved ([`crate::cmd::project::first_layer_watch`]).
let first_layer = crate::cmd::project::first_layer_watch(self, &spec);
let result = match txn {
Txn::Own => self.guarded(spec.label, spec.mutates, run),
Txn::Shared if spec.id == "edit.applyShapeConversion" => self.shared_step(&spec, |s| s.savepoint(spec.label, run)),
Txn::Shared => self.shared_step(&spec, run),
};
if let (Ok(_), Some(before)) = (&result, first_layer) {
crate::cmd::project::take_first_layer_system(self, &before);
}
self.url_completion_landed(spec.id, &params, &result);
if result.is_ok() && (spec.mutates || spec.effects.contains(crate::policy::Effect::History)) && spec.id != "data.similar" {
// Edits and history moves can replace selections without select::set. History
Expand Down
Loading
Loading