From 07e1101eb0aa61373299aa4065ec419d53e73148 Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Sat, 20 Jun 2026 09:06:06 +0800 Subject: [PATCH] refactor(editor): sink MCP + System settings cards to jian Card agent_settings_mcp client-config card (card fill, r8) + agent_settings_system auto-update card (muted fill, r10) now route their chrome through jian Card, looks preserved. Three agent-settings cards now share the canonical primitive. --- crates/op-editor-ui/src/widgets/agent_settings_mcp.rs | 10 ++++++++-- .../op-editor-ui/src/widgets/agent_settings_system.rs | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/crates/op-editor-ui/src/widgets/agent_settings_mcp.rs b/crates/op-editor-ui/src/widgets/agent_settings_mcp.rs index 4092014b2..da609bd8a 100644 --- a/crates/op-editor-ui/src/widgets/agent_settings_mcp.rs +++ b/crates/op-editor-ui/src/widgets/agent_settings_mcp.rs @@ -6,9 +6,11 @@ use crate::widgets::agent_settings_i18n::t as t_settings; use crate::widgets::agent_settings_switch::{ paint_settings_switch, SETTINGS_SWITCH_H, SETTINGS_SWITCH_W, }; +use crate::widgets::button::tokens_from_theme; use crate::widgets::icons::{draw_icon, Icon}; use crate::widgets::PaintCx; use crate::{Color, Point2D, Rect, TextLayout}; +use jian_widgets::components::card::Card; use op_editor_core::agent_settings::{AgentSettings, McpCli, SettingsFocus}; use op_editor_core::editor_ui_state::EditorUiState; use op_editor_core::{AgentSettingsButton, ButtonPressTarget}; @@ -381,8 +383,12 @@ fn paint_client_config( return; } let rect = client_config_rect(content); - cx.backend.fill_round_rect(rect, 8.0, theme.card); - cx.backend.stroke_round_rect(rect, 8.0, theme.border, 1.0); + Card { + fill: Some(theme.card), + border: Some(theme.border), + radius: 8.0, + } + .paint(cx.backend, rect, &tokens_from_theme(theme)); let title = TextLayout::single_run( t_settings(ui, "agents.mcpClientConfig"), "system-ui", diff --git a/crates/op-editor-ui/src/widgets/agent_settings_system.rs b/crates/op-editor-ui/src/widgets/agent_settings_system.rs index c8cbebe31..4028922c5 100644 --- a/crates/op-editor-ui/src/widgets/agent_settings_system.rs +++ b/crates/op-editor-ui/src/widgets/agent_settings_system.rs @@ -8,8 +8,10 @@ use crate::widgets::agent_settings_i18n::t as t_settings; use crate::widgets::agent_settings_switch::{ paint_settings_switch, SETTINGS_SWITCH_H, SETTINGS_SWITCH_W, }; +use crate::widgets::button::tokens_from_theme; use crate::widgets::PaintCx; use crate::{Point2D, Rect, TextLayout}; +use jian_widgets::components::card::Card; use op_editor_core::agent_settings::AgentSettings; use op_editor_core::editor_ui_state::EditorUiState; @@ -117,8 +119,12 @@ fn paint_toggle_card( desc_key: &'static str, enabled: bool, ) { - cx.backend.fill_round_rect(card, 10.0, theme.muted); - cx.backend.stroke_round_rect(card, 10.0, theme.border, 1.0); + Card { + fill: Some(theme.muted), + border: Some(theme.border), + radius: 10.0, + } + .paint(cx.backend, card, &tokens_from_theme(theme)); let label_layout = TextLayout::single_run( t_settings(ui, label_key),