ui: neutral wording in code and help text; keywords first in the command menu

Comments and the Options help text describe the behaviour of commercial
solutions without naming any product. The command menu puts the command's
keywords directly under Enter / Cancel, with Recent Input and Snap
Overrides below them, so the choices that change from step to step are the
closest to the pointer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
PanosandClaude Opus 5 committed 2026-09-17 12:05:15 +03:00
1 parent 02cd98e790
commit 0fbb5bcb4f
35 files changed
+83 -81

No files matched your search

+5 -5
View File
@@ -411,9 +411,9 @@ impl CadCommand for ArcCSECommand {
}
}
// ── ARC: AutoCAD prompt flow ──────────────────────────────────────────────
// ── ARC: compatible prompt flow ───────────────────────────────────────────
//
// The plain ARC command follows AutoCAD's prompts, so every keyword a user
// The plain ARC command follows the prompts of commercial solutions, so every keyword a user
// knows is there at the same step:
// Specify start point of arc or [Center]
// Specify second point of arc or [Center/End]
@@ -620,7 +620,7 @@ impl CadCommand for ArcCommand {
CmdResult::NeedPoint
}
ArcStep::EndSC { s, c } => self.commit(self.sc_end(s, c, pt)),
// At a typed prompt a pick reads as AutoCAD does: the cursor's
// At a typed prompt a pick reads as commercial solutions do: the cursor's
// direction from the centre (angle) or its distance (length,
// radius), the cursor itself for a direction / sagitta.
ArcStep::AngleSC { s, c } => {
@@ -726,7 +726,7 @@ impl CadCommand for ArcCommand {
fn on_enter(&mut self) -> CmdResult {
match self.step {
// Enter at the start prompt: continue tangent from the last
// line or arc, as AutoCAD does.
// line or arc, as commercial solutions do.
ArcStep::Start => CmdResult::Dispatch("ARC_CONT".into()),
_ => CmdResult::Cancel,
}
@@ -1997,7 +1997,7 @@ mod acad_flow_tests {
}
#[test]
fn prompts_follow_autocad_keywords() {
fn prompts_follow_compatible_keywords() {
let mut cmd = ArcCommand::new();
assert_eq!(keywords(&cmd), ["C"]);
cmd.on_point(p(0.0, 0.0));
+2 -2
View File
@@ -73,7 +73,7 @@ impl CadCommand for LineCommand {
fn options(&self) -> Vec<crate::command::CmdOption> {
use crate::command::CmdOption;
// Mirrors AutoCAD's LINE prompt: Undo once a point is placed, Close
// Covers the LINE prompt of commercial solutions: Undo once a point is placed, Close
// once a closing segment is possible, eXit always.
match self.points.len() {
0 => Vec::new(),
@@ -201,7 +201,7 @@ impl CadCommand for LineCommand {
}
}
// eXit: end the command keeping every segment drawn so far
// (AutoCAD LINE's third keyword).
// (the third LINE keyword of commercial solutions).
"X" | "EXIT" => Some(CmdResult::Cancel),
"U" | "UNDO" => {
if self.points.len() >= 2 {
+8 -8
View File
@@ -1,7 +1,7 @@
// Polyline tool — ribbon definition + interactive command.
//
// Command: PLINE (PL)
// Each click adds a vertex. Keywords follow AutoCAD:
// Each click adds a vertex. Keywords match commercial solutions:
// Line mode: Arc / Close / Halfwidth / Length / Undo / Width
// Arc mode: Angle / CEnter / CLose / Direction / Halfwidth / Line /
// Radius / Second pt / Undo / Width
@@ -42,7 +42,7 @@ enum SegMode {
Arc,
}
/// A keyword sub-step inside PLINE (AutoCAD's option prompts). `None` is the
/// A keyword sub-step inside PLINE (the option prompts of commercial solutions). `None` is the
/// regular "specify next point" step for the current segment mode. Every
/// sub-step returns to `None` once it has produced a vertex, or when Undo /
/// Enter / Escape backs out of it.
@@ -114,7 +114,7 @@ pub struct PlineCommand {
/// `(start, end)` width for segment i → i+1, parallel to `bulges`.
widths: Vec<(f64, f64)>,
/// Width pair applied to the next segment. After a segment lands its end
/// width becomes the next start width, as in AutoCAD.
/// width becomes the next start width, as in commercial solutions.
cur_width: (f64, f64),
mode: SegMode,
sub: Sub,
@@ -696,7 +696,7 @@ pub(crate) fn arc_sample_points(a: Vec3, bulge: f64, b: Vec3, n: usize) -> Vec<[
impl PlineCommand {
/// Close the polyline: in Arc mode the closing segment is an arc tangent
/// to the last segment (AutoCAD's CLose), in Line mode a straight one.
/// to the last segment (CLose in commercial solutions), in Line mode a straight one.
fn close(&mut self) -> CmdResult {
if self.vertices.len() < 2 {
return CmdResult::NeedPoint;
@@ -779,7 +779,7 @@ impl CadCommand for PlineCommand {
let can_close = self.vertices.len() >= 3
|| (self.vertices.len() == 2 && matches!(self.mode, SegMode::Arc));
match self.sub {
// AutoCAD's keyword sets, in AutoCAD's order.
// The keyword sets of commercial solutions, in their order.
Sub::None => match self.mode {
SegMode::Line => {
let mut opts = vec![CmdOption::new("Arc", "A")];
@@ -849,7 +849,7 @@ impl CadCommand for PlineCommand {
match self.sub {
Sub::None => {}
// A picked point at a typed-value prompt reads as the distance
// (or angle) from the last vertex, as AutoCAD allows.
// (or angle) from the last vertex, as commercial solutions allow.
sub if sub.is_scalar() => {
let value = if sub.is_angle() {
(p - a).y.atan2((p - a).x).to_degrees()
@@ -1068,7 +1068,7 @@ impl CadCommand for PlineCommand {
self.sub = Sub::ArcCenter;
Some(CmdResult::NeedPoint)
}
// AutoCAD wants CL in arc mode; a bare C is accepted as well.
// Commercial solutions want CL in arc mode; a bare C is accepted as well.
(SegMode::Arc, "CL" | "C" | "CLOSE") => Some(self.close()),
(SegMode::Arc, "D" | "DIRECTION") => {
self.sub = Sub::ArcDirection;
@@ -1272,7 +1272,7 @@ mod tests {
}
#[test]
fn options_per_mode_match_autocad_keywords() {
fn options_per_mode_match_compatible_keywords() {
let mut cmd = pl(&[(0.0, 0.0), (10.0, 0.0)]);
assert_eq!(keywords(&cmd), ["A", "H", "L", "U", "W", ""]);
cmd.on_point(DVec3::new(10.0, 5.0, 0.0));
+2 -2
View File
@@ -4,7 +4,7 @@
// Requires at least one entity selected before starting.
// Step 1: pick base point, or D = type the displacement vector directly
// Step 2: pick destination → translates all selected entities by (dest - base);
// Enter uses the base point as the displacement (AutoCAD).
// Enter uses the base point as the displacement (commercial solutions).
use acadrust::Handle;
use glam::DVec3;
@@ -119,7 +119,7 @@ impl CadCommand for MoveCommand {
fn on_enter(&mut self) -> CmdResult {
match self.step {
// AutoCAD: Enter at the second point uses the base point as the
// Commercial solutions: Enter at the second point uses the base point as the
// displacement from the origin.
Step::Target(base) => CmdResult::TransformSelected(
self.handles.clone(),