Clarify Midra mapping and transfer settings action

This commit is contained in:
Dandaedre 2026-11-14 16:44:00 +01:00
parent 0997583ba3
commit 6dc5385eda
5 changed files with 27 additions and 25 deletions

View File

@ -482,13 +482,15 @@ impl Editor {
self.device.open = true;
}
pub(super) fn midra_apply_button(&mut self, ui: &mut egui::Ui) {
if ui.add_enabled(
self.device.online() && self.device.pending.is_none(),
egui::Button::new("Apply changes…"),
)
.on_hover_text("Choose layers, destination links and export settings, then click Send mapped layers.")
.on_disabled_hover_text("Connect to Midra and wait for any transfer to finish.")
.clicked() {
if ui
.add_enabled(
self.device.online() && self.device.pending.is_none(),
egui::Button::new("Midra mapping & transfer…"),
)
.on_hover_text("Configure layer links and send/load options.")
.on_disabled_hover_text("Connect to Midra and wait for any transfer to finish.")
.clicked()
{
self.open_midra_export();
ui.close_menu();
}
@ -595,7 +597,7 @@ impl Editor {
let mut open = true;
let mut imported = false;
let mut send_plan = None;
egui::Window::new(if self.device.prepare_send { "Send layers to Midra" } else { "Import layers from Midra" })
egui::Window::new(if self.device.prepare_send { "Midra mapping & transfer" } else { "Import layers from Midra" })
.enabled(!self.format_draft.as_ref().is_some_and(|d| d.pending(&self.layout)))
.open(&mut open).default_width(660.0).collapsible(false)
.max_height((ctx.screen_rect().height() - 100.0).max(200.0)).vscroll(true)
@ -1326,7 +1328,7 @@ mod tests {
assert!(!app.device.prepare_send);
}
#[test]
fn status_apply_opens_mapping_without_writing_even_when_linked() {
fn status_mapping_opens_settings_without_writing_even_when_linked() {
for linked in [false, true] {
let ctx = egui::Context::default();
let mut app = Editor::default();
@ -1351,12 +1353,14 @@ mod tests {
.shapes
.iter()
.find_map(|s| match &s.shape {
egui::epaint::Shape::Text(t) if t.galley.job.text == "Apply changes…" => {
egui::epaint::Shape::Text(t)
if t.galley.job.text == "Midra mapping & transfer…" =>
{
Some(t.pos + Vec2::new(8.0, 6.0))
}
_ => None,
})
.expect("status apply button");
.expect("status mapping button");
for pressed in [true, false] {
super::super::tests::frame(
&mut app,

View File

@ -224,7 +224,7 @@ impl Editor {
if ui
.add_enabled(
self.device.online(),
egui::Button::new("Configure Midra export…"),
egui::Button::new("Midra mapping & transfer…"),
)
.on_hover_text("Map editor layers, review device changes and send explicitly.")
.on_disabled_hover_text(
@ -242,10 +242,6 @@ impl Editor {
self.midra_apply_button(ui);
self.midra_send_button(ui);
self.midra_load_button(ui);
if ui.button("Configure Midra export…").clicked() {
self.open_midra_export();
ui.close_menu();
}
ui.separator();
if ui.button("Export layers…").clicked() {
self.files.export_open = true;

View File

@ -73,7 +73,7 @@ partial/uncertain outcomes without blind retries or automatic rollback.
Program selection is explicit. The application defaults to Preview and hides Program unless the persisted `allow_sending_to_program` preference is enabled. Turning it off resets the exporter to Preview, including quick Apply. Layer screen/destination links are saved in project version 5. Plans and raw snapshots are not saved in projects or preferences. The device address is saved in [application settings](midra-layout-settings.md), never in projects. Refresh and screen changes preserve saved links. Physical display
validation remains separate from the successful device-field and import round trips.
The status-bar and Export-menu **Apply changes…** actions only open export configuration, even when current layers have valid saved links. They never start a write. The user chooses a transfer scope, mappings, target and sizing, then explicitly clicks **Send mapped layers** for the displayed screen. Empty/unlinked rows are skipped. The load button uses all saved links in the scope, including links to other screens. Busy/offline actions are disabled. **Send all linked layers** remains a separate direct-send action using saved links. No persistent schema changes are involved.
The status-bar and Export-menu **Midra mapping & transfer…** actions only open export configuration, even when current layers have valid saved links. They never start a write. The user chooses a transfer scope, mappings, target and sizing, then explicitly clicks **Send mapped layers** for the displayed screen. Empty/unlinked rows are skipped. The load button uses all saved links in the scope, including links to other screens. Busy/offline actions are disabled. **Send all linked layers** remains a separate direct-send action using saved links. No persistent schema changes are involved.
Snapshot layer lists omit unassigned source slots (`NONE` or empty), before geometry validation. Assigned layers remain available even when OFF.
@ -99,7 +99,7 @@ included in geometry comparisons, because it is a command rather than geometry.
Midra Preview geometry and crop framing into linked editor layers in the shared
transfer scope. The default **All layers** ignores canvas selection; **Only selected
layers** and **Folder: …** explicitly restrict the operation. The load button inside
**Apply changes…** uses that same scope and the saved links. Both actions are read-only
**Midra mapping & transfer…** uses that same scope and the saved links. Both actions are read-only
on the device and always load Preview (independent of the send target). They do
not recall device memories or presets. Loading is one atomic Undo step; links
remain saved. Missing screens/layers, mismatched output resolutions, unsupported

View File

@ -45,7 +45,7 @@ It affects Midra transfers, not clipboard/file import or geometry export scopes.
To prepare several layouts that reuse the same device layers:
1. Put each layout in a folder and configure its saved screen/layer links through
**Apply changes…**. Every row can still be remapped or unlinked.
**Midra mapping & transfer…**. Every row can still be remapped or unlinked.
2. Choose **Folder: …** in the status selector, or right-click a folder and choose
**Use folder for Midra transfers**.
3. Click **Send folder links**. Then click another folder name and send again:
@ -803,7 +803,7 @@ Choose a destination beside each device layer: existing layer, new layer, or ski
Centered crops import visible bounds and framing; unsupported aspect/mask cases
are explained in the review. Imports are one undoable edit.
After connecting, open **Export → Configure Midra export…**. Choose editor layers,
After connecting, open **Export → Midra mapping & transfer…**. Choose editor layers,
map each to a Midra layer, select **Preview** or **Program**, and select a container
strategy: **Output-sized** or **Source aspect**. Expand **Exact device changes** to
review sizes, centers, crop values and aspect, then click **Send mapped layers**.
@ -907,7 +907,7 @@ and disabled in these pickers; choosing layers changes no geometry. Full project
save/load and screen reference images are document-wide operations, so they have
no layer mapping.
**Apply changes…**, beside ONLINE/OFFLINE and in **Export**, opens the Midra export configuration without sending, even when layers already have saved links. Choose layers, destination mappings, Preview/Program and sizing, then click **Send mapped layers** to send. The action is disabled offline or during transfers. Sending writes geometry, pulses the WebRCS preset-update command, and verifies geometry readback. Only applied editor values are sent.
**Midra mapping & transfer…**, beside ONLINE/OFFLINE and in **Export**, opens the Midra export configuration without sending, even when layers already have saved links. Choose layers, destination mappings, Preview/Program and sizing, then click **Send mapped layers** to send. The action is disabled offline or during transfers. Sending writes geometry, pulses the WebRCS preset-update command, and verifies geometry readback. Only applied editor values are sent.
Layer rows use padlock and eye icon buttons for locking and visibility, with tooltips and highlighted locked/hidden states. Double-click a layer name in the right-hand list to rename it. Enter saves, Escape or Cancel discards the edit; names must contain 1–128 characters. Renaming preserves the layer ID and folder and supports Undo.
@ -932,7 +932,7 @@ continue resizing, or hold Alt to temporarily invert snapping. Shift/Ctrl+Shift
Midra layer lists omit unassigned source slots (`NONE` or empty). Assigned inputs remain listed even if the layer is off. The exporter defaults to Preview and hides Program until **Settings → Midra integration → Allow sending to Program** is checked. This preference is saved automatically; turning it off returns the exporter and quick Apply action to Preview.
Destination choices in **Configure Midra export…** now save immediately on the editor layer and support Undo. Save the project JSON to keep links across sessions. Links include screen and layer IDs and survive refreshes and selection changes. Choose the empty destination on the linked screen to unlink. The direct send button is available beside Apply and in Export; in **All layers** scope it includes unselected, hidden and locked linked layers, grouped by screen. Its label changes to **Send selected links** or **Send folder links** in those scopes. Apply changes… opens mapping configuration for the current scope. Preview/Program and sizing still use the current export options.
Destination choices in **Midra mapping & transfer…** now save immediately on the editor layer and support Undo. Save the project JSON to keep links across sessions. Links include screen and layer IDs and survive refreshes and selection changes. Choose the empty destination on the linked screen to unlink. The direct send button is available beside Midra mapping & transfer and in Export; in **All layers** scope it includes unselected, hidden and locked linked layers, grouped by screen. Its label changes to **Send selected links** or **Send folder links** in those scopes. Midra mapping & transfer… opens mapping configuration for the current scope. Preview/Program and sizing still use the current export options.
Every explicit send now includes WebRCS’s preset apply pulse (`xUpdate` false → true). This applies staged geometry when automatic updates are disabled, including a repeat send where WebRCS already shows the desired values.
@ -942,7 +942,7 @@ Every explicit send now includes WebRCS’s preset apply pulse (`xUpdate` false
Midra Preview geometry and crop framing into linked editor layers in the shared
transfer scope. The default **All layers** ignores canvas selection; **Only selected
layers** and **Folder: …** explicitly restrict the operation. The load button inside
**Apply changes…** uses that same scope and the saved links. Both actions are read-only
**Midra mapping & transfer…** uses that same scope and the saved links. Both actions are read-only
on the device and always load Preview (independent of the send target). They do
not recall device memories or presets. Loading is one atomic Undo step; links
remain saved. Missing screens/layers, mismatched output resolutions, unsupported
@ -953,8 +953,8 @@ settings schema changes are involved.
Midra destinations are identified by the pair **screen ID + layer ID**: Screen 1
Layer 1 and Screen 2 Layer 1 are distinct links. Both IDs are already persisted
in project version 5; no schema change is needed. Opening **Apply changes…** or
**Configure Midra export…** restores the first scoped layer's available linked
in project version 5; no schema change is needed. Opening **Midra mapping & transfer…** or
**Midra mapping & transfer…** restores the first scoped layer's available linked
screen. Destination choices display both IDs. Browsing another screen does not
retarget existing links; choosing a destination there explicitly replaces that
layer's saved link. Direct send/load actions use each layer's saved screen,

View File

@ -4,6 +4,8 @@
## Unreleased
- Rename Apply changes and Configure Midra export to “Midra mapping & transfer…” so the action clearly opens layer mapping and send/load settings; actual sending remains a separate button.
- Keep multiple reference images in a purple section of the layer list, with add, eye, remove, settings and Show only actions; references remain fixed and excluded from layer/device operations. Add removal to Import and viewport/reference context menus. Queue multi-file imports in order, composite visible guides in viewport/artwork exports, and save all images in project v10 with tested v1–v9/recovery migration. Corrupt additions or project images preserve existing work.
- Add Paste layer values beside Copy layer values in the layer context menu, using the existing clipboard import and mapping review before applying changes.