graphic design tool
git clone https://git.lucas.co/cce-designer.git
refactor: the row menu's Value readout uses a programmer's type names
float, integer, vec3, boolean, enum and string where it said number,
whole number, vector, true/false, option and text — by request, the
readout errs on the technical side. Expression and invalid are unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
CLAUDE.md | 5 +++--
src/app.rs | 4 ++--
src/main.rs | 11 ++++++-----
src/param.rs | 24 ++++++++++++------------
4 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index f563251..5d97702 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -719,8 +719,9 @@ and paste still pastes the right path. **Two header rows read the
parameter out** (since 2026-09-28, `param_menu_rows`): `Control:` is the
kind the template gave it (`ParamKind::name` — slider, float3,
attribute…) and `Value:` what its text holds right now
-(`ParamDef::value_type` — number, whole number, vector, true/false,
-option, text, expression, or invalid with the reason). Two lines because
+(`ParamDef::value_type` — float, integer, vec3, boolean, enum, string,
+expression, or invalid with the reason; a programmer's terms, by
+request). Two lines because
they answer different questions, the template's and the instance's, and
they differ exactly when something is off: a slider over an expression is
a row whose slider cannot be drawn, a slider over `invalid (…)` a load that
diff --git a/src/app.rs b/src/app.rs
index 1cb430c..601459a 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -4437,8 +4437,8 @@ impl State {
///
/// The two headers read the parameter out: `Control:` is its kind
/// (`ParamKind::name` — slider, float3, attribute…) and `Value:` what
- /// its text holds right now (`ParamDef::value_type` — number,
- /// expression, invalid…). Two lines rather than one because they
+ /// its text holds right now (`ParamDef::value_type` — float, integer,
+ /// boolean, expression, invalid…). Two lines rather than one because they
/// answer different questions: the first is the template's, the second
/// the instance's, and they differ exactly when something is off — a
/// `Control: slider` over `Value: expression` is a row whose slider
diff --git a/src/main.rs b/src/main.rs
index 0f65108..65a15b1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -7760,9 +7760,10 @@ mod tests {
"nothing copied yet, and the row holds a value"
);
// The two header rows read the parameter out: its control's kind
- // and its value's type. Radius is a slider holding a number.
+ // and its value's type, in a programmer's terms. Radius is a slider
+ // holding a float.
let shown = cce_ui::widget::context_menu::options();
- assert_eq!(&shown[..3], &["Control: slider".to_string(), "Value: number".to_string(), "-".to_string()]);
+ assert_eq!(&shown[..3], &["Control: slider".to_string(), "Value: float".to_string(), "-".to_string()]);
let (_, _, headers) = state.param_menu_rows(sphere, "Radius");
assert_eq!(headers, 2);
// A click on a header runs nothing.
@@ -7806,13 +7807,13 @@ mod tests {
assert!(radius(&state, ball).is_expr());
// …and the menu's readout says so: the control is still a slider,
// the value is now an expression. Method is a choice holding an
- // option, Rows a spinbox holding a whole number.
+ // enum, Rows a spinbox holding an integer.
let (rows, _, _) = state.param_menu_rows(ball, "Radius");
assert_eq!(&rows[..2], &["Control: slider".to_string(), "Value: expression".to_string()]);
let (rows, _, _) = state.param_menu_rows(ball, "Method");
- assert_eq!(&rows[..2], &["Control: choice".to_string(), "Value: option".to_string()]);
+ assert_eq!(&rows[..2], &["Control: choice".to_string(), "Value: enum".to_string()]);
let (rows, _, _) = state.param_menu_rows(ball, "Rows");
- assert_eq!(&rows[..2], &["Control: spinbox".to_string(), "Value: whole number".to_string()]);
+ assert_eq!(&rows[..2], &["Control: spinbox".to_string(), "Value: integer".to_string()]);
// And a reference typed straight into a row (or scripted) becomes one.
state.apply_action(McpAction::SetParam { slot: ball, name: "Rows".into(), value: "chi(\"../sphere1/Rows\") * 2".into() }, &mut redraw).unwrap();
diff --git a/src/param.rs b/src/param.rs
index decb5a3..94a45ba 100644
--- a/src/param.rs
+++ b/src/param.rs
@@ -398,20 +398,20 @@ impl ParamDef {
self.slot == ParamSlot::Expr
}
- /// What the parameter HOLDS right now, in words — the row menu's
- /// `Value:` readout: the parsed value's type (`number`, `whole number`,
- /// `vector`, `true/false`, `option`, `text`), `expression` for one
- /// still to be evaluated, or `invalid` with the reason. The control's
- /// kind is [`ParamKind::name`]; the two differ exactly when the text
- /// is not a value of the kind, which is what the pair is for.
+ /// What the parameter HOLDS right now — the row menu's `Value:`
+ /// readout: the parsed value's type in a programmer's terms (`float`,
+ /// `integer`, `vec3`, `boolean`, `enum`, `string`), `expression` for
+ /// one still to be evaluated, or `invalid` with the reason. The
+ /// control's kind is [`ParamKind::name`]; the two differ exactly when
+ /// the text is not a value of the kind, which is what the pair is for.
pub fn value_type(&self) -> String {
match &self.slot {
- ParamSlot::Value(ParamValue::Number(_)) => "number".to_string(),
- ParamSlot::Value(ParamValue::Int(_)) => "whole number".to_string(),
- ParamSlot::Value(ParamValue::Vec3(_)) => "vector".to_string(),
- ParamSlot::Value(ParamValue::Bool(_)) => "true/false".to_string(),
- ParamSlot::Value(ParamValue::Choice(_)) => "option".to_string(),
- ParamSlot::Value(ParamValue::Text(_)) => "text".to_string(),
+ ParamSlot::Value(ParamValue::Number(_)) => "float".to_string(),
+ ParamSlot::Value(ParamValue::Int(_)) => "integer".to_string(),
+ ParamSlot::Value(ParamValue::Vec3(_)) => "vec3".to_string(),
+ ParamSlot::Value(ParamValue::Bool(_)) => "boolean".to_string(),
+ ParamSlot::Value(ParamValue::Choice(_)) => "enum".to_string(),
+ ParamSlot::Value(ParamValue::Text(_)) => "string".to_string(),
ParamSlot::Expr => "expression".to_string(),
ParamSlot::Invalid(why) => format!("invalid ({why})"),
}