Storm Sewer: fix prompt flow — collect typed values before the click

The structure/pipe commands took a viewport interaction first and then asked
for typed values. But a point-pick result (NeedPoint) does not re-focus the
command line, so after the click the typed digits went nowhere and Enter hit
on_enter -> Cancel ("Command cancelled.").

Reorder both commands to the OFFSET-style flow: collect typed values first
(command line focused at dispatch and kept focused through text input), then
take the viewport click last and commit from it.

- PlaceStructure: enter invert/rim/area/C, then click the location.
- PlacePipe: enter diameter/n, then click START and END structures; commit
  from the second pick using the click points (connectivity stays exact via
  structure handles).
- Dispatch arms focus the command line so the first prompt is typeable.
- Reverts the update.rs inject_picked_entity allow-list change (the pt-based
  pipe no longer needs the picked entity).

15 module tests updated and green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Michael Flynn 2026-06-09 08:42:47 -04:00
commit 057de504b2
4 changed files with 95 additions and 124 deletions

View file

@ -68,11 +68,14 @@ impl OpenCADStudio {
};
self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd));
// Focus the command line so the first typed value is captured.
return self.focus_cmd_input();
}
"SS_PIPE" => {
let cmd = crate::modules::storm_sewer::structures::PlacePipe::new();
self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd));
return self.focus_cmd_input();
}
"SS_PROFILE" => {
use crate::modules::storm_sewer::analysis as ss;

View file

@ -2812,7 +2812,7 @@ impl OpenCADStudio {
.map(|c| {
matches!(
c.name(),
"DIMTEDIT" | "MLEADERADD" | "MLEADERREMOVE" | "SS_PIPE"
"DIMTEDIT" | "MLEADERADD" | "MLEADERREMOVE"
)
})
.unwrap_or(false);