diff --git a/crates/op-editor-core/src/color_picker.rs b/crates/op-editor-core/src/color_picker.rs index d914c8fb4..54fbf412a 100644 --- a/crates/op-editor-core/src/color_picker.rs +++ b/crates/op-editor-core/src/color_picker.rs @@ -294,10 +294,7 @@ fn scalar_as_hex(s: &jian_ops_schema::variable::VariableScalar) -> Option Option { +fn gradient_stop_hex(node: &jian_ops_schema::node::PenNode, index: usize) -> Option { use jian_ops_schema::style::PenFill; let fills = crate::fills::node_fills(node)?; let first = fills.first()?; diff --git a/crates/op-editor-core/src/mutators.rs b/crates/op-editor-core/src/mutators.rs index e6934bbf6..20ada4f65 100644 --- a/crates/op-editor-core/src/mutators.rs +++ b/crates/op-editor-core/src/mutators.rs @@ -465,11 +465,7 @@ impl EditorState { } PropertyFocus::GradientStopOffset(index) => { // Percent → fraction. Clamp happens inside the setter. - let _ = crate::fills::set_primary_gradient_stop_offset( - node, - index, - value / 100.0, - ); + let _ = crate::fills::set_primary_gradient_stop_offset(node, index, value / 100.0); } // Hex focuses route through the dedicated colour setters // (a typed-in hex is parsed by the host before commit), so diff --git a/crates/op-editor-core/src/render_backend.rs b/crates/op-editor-core/src/render_backend.rs index 046e6fda8..0ee08df00 100644 --- a/crates/op-editor-core/src/render_backend.rs +++ b/crates/op-editor-core/src/render_backend.rs @@ -370,6 +370,7 @@ pub trait RenderBackend { /// /// Default impl falls back to a solid first-stop fill, same as /// the linear variant. + #[allow(clippy::too_many_arguments)] fn fill_round_rect_radial_gradient( &mut self, rect: Rect, diff --git a/crates/op-editor-core/src/ui_draft.rs b/crates/op-editor-core/src/ui_draft.rs index bfb852a7f..f941072b0 100644 --- a/crates/op-editor-core/src/ui_draft.rs +++ b/crates/op-editor-core/src/ui_draft.rs @@ -60,9 +60,7 @@ impl PropertyFocus { pub fn is_hex(self) -> bool { matches!( self, - PropertyFocus::FillHex - | PropertyFocus::StrokeHex - | PropertyFocus::GradientStopHex(_) + PropertyFocus::FillHex | PropertyFocus::StrokeHex | PropertyFocus::GradientStopHex(_) ) } diff --git a/crates/op-editor-ui/src/widgets/property_panel.rs b/crates/op-editor-ui/src/widgets/property_panel.rs index 5ff4f2cc8..786635808 100644 --- a/crates/op-editor-ui/src/widgets/property_panel.rs +++ b/crates/op-editor-ui/src/widgets/property_panel.rs @@ -307,9 +307,7 @@ impl NodeSnapshot { /// fills — the Fill section uses that to hide the angle row. fn gradient_angle_of(node: &PenNode) -> Option { use jian_ops_schema::style::PenFill; - match op_editor_core::fills::node_fills(node) - .and_then(|f| f.first())? - { + match op_editor_core::fills::node_fills(node).and_then(|f| f.first())? { PenFill::LinearGradient(body) => Some(body.angle.unwrap_or(0.0)), _ => None, } diff --git a/crates/op-editor-ui/src/widgets/property_panel_fill.rs b/crates/op-editor-ui/src/widgets/property_panel_fill.rs index 76f4c45ac..e5ba4aa00 100644 --- a/crates/op-editor-ui/src/widgets/property_panel_fill.rs +++ b/crates/op-editor-ui/src/widgets/property_panel_fill.rs @@ -523,8 +523,10 @@ fn paint_fill_gradient_body( Point2D::new(0.0, 0.0), ); let hex_text_x = hex_rect.origin.x + 30.0; - cx.backend - .draw_text(&hex_layout, Point2D::new(hex_text_x, hex_rect.origin.y + 19.0)); + cx.backend.draw_text( + &hex_layout, + Point2D::new(hex_text_x, hex_rect.origin.y + 19.0), + ); if let Some(pos) = edit.caret_at(hex_focus) { let w = cx .backend diff --git a/crates/op-host-desktop/src/chat_orchestrator.rs b/crates/op-host-desktop/src/chat_orchestrator.rs index 1ed170163..922358bd5 100644 --- a/crates/op-host-desktop/src/chat_orchestrator.rs +++ b/crates/op-host-desktop/src/chat_orchestrator.rs @@ -186,11 +186,12 @@ pub async fn run_design_request( model, provider: provider_id, design_md: state.doc.design_md.clone(), - // S3b-2 / S3b-4 / S3c additions — host 暂无路由,统一保守值。 + // S3b-2 / S3b-4 / S3c / S4 additions — host 暂无路由,统一保守值。 // 真实接线在 task #27 走 chat_runtime intent gate 时定。 append_context: None, concurrency: 1, validation_enabled: false, + visual_ref_enabled: false, }; let mut sink = DesktopDocSink::new(state); // Stub validation providers — production-visible, no-op. Host can diff --git a/crates/op-host-native/src/widget_host/press_helpers.rs b/crates/op-host-native/src/widget_host/press_helpers.rs index eacf3c601..719a2bab6 100644 --- a/crates/op-host-native/src/widget_host/press_helpers.rs +++ b/crates/op-host-native/src/widget_host/press_helpers.rs @@ -172,9 +172,7 @@ pub(in crate::widget_host) fn property_focus_initial( .get(i) // Strip alpha so the input pill matches what paint shows. // Per-stop transparency rides through commit invisibly. - .map(|s| { - op_editor_ui::widgets::property_panel_fill::stop_hex_rgb_only(&s.hex) - }) + .map(|s| op_editor_ui::widgets::property_panel_fill::stop_hex_rgb_only(&s.hex)) .unwrap_or_else(|| "#000000".to_string()), F::GradientStopOffset(i) => panel .snapshot diff --git a/crates/op-pen-loader/src/adapter_tests.rs b/crates/op-pen-loader/src/adapter_tests.rs index 59ba1da81..261538505 100644 --- a/crates/op-pen-loader/src/adapter_tests.rs +++ b/crates/op-pen-loader/src/adapter_tests.rs @@ -329,9 +329,7 @@ fn radial_gradient_payload_uses_authored_centre_and_radius() { let n = &r.payload.pages[0].children[0]; let gradient = n.gradient.as_ref().expect("gradient must populate"); match gradient { - crate::payload::GradientPayload::Radial { - cx, cy, radius, .. - } => { + crate::payload::GradientPayload::Radial { cx, cy, radius, .. } => { assert!((cx - 0.25).abs() < 0.01); assert!((cy - 0.75).abs() < 0.01); assert!((radius - 0.6).abs() < 0.01); @@ -350,7 +348,10 @@ fn solid_fill_leaves_gradient_payload_unset() { }"##; let r = load(src); let n = &r.payload.pages[0].children[0]; - assert!(n.gradient.is_none(), "solid fill must not populate gradient"); + assert!( + n.gradient.is_none(), + "solid fill must not populate gradient" + ); } #[test] diff --git a/crates/op-pen-loader/src/layout_scene.rs b/crates/op-pen-loader/src/layout_scene.rs index d95579650..fc82a18f0 100644 --- a/crates/op-pen-loader/src/layout_scene.rs +++ b/crates/op-pen-loader/src/layout_scene.rs @@ -23,14 +23,15 @@ use op_editor_ui::layout_scene::NodeKind; use op_editor_ui::layout_scene::{ - LayoutScene, SceneFillType, SceneGradient, SceneGradientStop, SceneNode, ScenePage, - SceneStroke, + LayoutScene, SceneFillType, SceneGradient, SceneGradientStop, SceneNode, ScenePage, SceneStroke, }; use op_editor_ui::scene_vars::VariableTable; use op_editor_ui::Color; use crate::editor_state_var_table; -use crate::payload::{DocPayload, GradientPayload, GradientStopPayload, NodePayload, StrokePayload}; +use crate::payload::{ + DocPayload, GradientPayload, GradientStopPayload, NodePayload, StrokePayload, +}; /// Build a paint-only [`LayoutScene`] from an editor state. ///