You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by wy...@apache.org on 2026/10/22 13:24:33 UTC

(maka) 12/14: style(terminal-shell): format the reasoning selector

This is an automated email from the ASF dual-hosted git repository.

M4n5ter pushed a commit to branch rust-preview
in repository https://gitbox.apache.org/repos/asf/maka.git

commit 1b57cb5208cfb607319311233cc782711e44424c
Author: M4n5ter <m4...@gmail.com>
AuthorDate: Thu Oct 22 20:57:29 2026 +0800

    style(terminal-shell): format the reasoning selector
---
 products/maka/terminal-shell/app/ModelSelect.tsx  | 30 +++++++++++++++++------
 products/maka/terminal-shell/tests/real_host.rs   |  4 ++-
 products/maka/terminal-shell/tests/support/mod.rs | 11 ++++++---
 3 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/products/maka/terminal-shell/app/ModelSelect.tsx b/products/maka/terminal-shell/app/ModelSelect.tsx
index 2477933b8f..bd09b86f6f 100644
--- a/products/maka/terminal-shell/app/ModelSelect.tsx
+++ b/products/maka/terminal-shell/app/ModelSelect.tsx
@@ -17,7 +17,18 @@
  * under the License.
  */
 
-import { batch, cleanup, computed, effect, Input, inputAction, Scroll, signal, Text, View } from 'nsh';
+import {
+  batch,
+  cleanup,
+  computed,
+  effect,
+  Input,
+  inputAction,
+  Scroll,
+  signal,
+  Text,
+  View,
+} from 'nsh';
 import type { YNode } from 'nsh';
 import type { ThinkingLevel } from '../../../../packages/plugin-sdk/src/generated/runtime';
 import { Button, Popover } from 'nsh/base';
@@ -483,7 +494,9 @@ function ModelMenu(props: {
             focusStyle={{ backgroundColor: C.raised }}
             disabledStyle={controlDisabledStyle}
           >
-            <Text style={{ ...captionTextStyle, color: C.secondary }}>{tr('Reasoning effort')}</Text>
+            <Text style={{ ...captionTextStyle, color: C.secondary }}>
+              {tr('Reasoning effort')}
+            </Text>
             <Text
               numberOfLines={1}
               style={{
@@ -619,7 +632,10 @@ function ModelMenu(props: {
           >
             {(item) => (
               <View style={{ gap: 8 }}>
-                <Each<ThinkingLevel> of={item().thinkingLevels} key={(level: ThinkingLevel) => level}>
+                <Each<ThinkingLevel>
+                  of={item().thinkingLevels}
+                  key={(level: ThinkingLevel) => level}
+                >
                   {(level) => (
                     <Button
                       disabled={pending()}
@@ -649,14 +665,14 @@ function ModelMenu(props: {
                         checked={effectiveThinkingLevel(owner.backend(), item()) === level()}
                         disabled={pending()}
                       />
-                      <Text style={{ ...captionTextStyle, color: C.text }}>
-                        {level()}
-                      </Text>
+                      <Text style={{ ...captionTextStyle, color: C.text }}>{level()}</Text>
                     </Button>
                   )}
                 </Each>
                 <If
-                  when={item().defaultThinkingLevel === null && owner.backend()?.thinkingLevel != null}
+                  when={
+                    item().defaultThinkingLevel === null && owner.backend()?.thinkingLevel != null
+                  }
                 >
                   <Button
                     disabled={pending()}
diff --git a/products/maka/terminal-shell/tests/real_host.rs b/products/maka/terminal-shell/tests/real_host.rs
index 5ac42203c7..b62a3c88eb 100644
--- a/products/maka/terminal-shell/tests/real_host.rs
+++ b/products/maka/terminal-shell/tests/real_host.rs
@@ -162,7 +162,9 @@ fn assert_effort_choices(view: &AppView, choice: &Value, selected: Option<&str>)
         "efforts must come from this model's metadata"
     );
     assert!(
-        !nodes.iter().any(|node| node.label == "Use connection default"),
+        !nodes
+            .iter()
+            .any(|node| node.label == "Use connection default"),
         "connection inheritance must not appear as another reasoning effort",
     );
     let effective = selected.or_else(|| choice["defaultThinkingLevel"].as_str());
diff --git a/products/maka/terminal-shell/tests/support/mod.rs b/products/maka/terminal-shell/tests/support/mod.rs
index c475c02f0c..2db25a7410 100644
--- a/products/maka/terminal-shell/tests/support/mod.rs
+++ b/products/maka/terminal-shell/tests/support/mod.rs
@@ -796,12 +796,17 @@ async fn configure(owner: Arc<RootOwner>, base: &str, vision: bool, reasoning: b
         overrides["fixture-model"]["defaultThinkingLevel"] = json!("low");
         overrides["fixture-model-alt"]["thinkingLevels"] = json!(["off", "high"]);
         overrides["fixture-model-alt"]["defaultThinkingLevel"] = json!("high");
-        overrides["fixture-model-unknown"] = json!({"contextWindow":200000,"vision":vision,"thinkingLevels":["off","high"]});
+        overrides["fixture-model-unknown"] =
+            json!({"contextWindow":200000,"vision":vision,"thinkingLevels":["off","high"]});
     }
     let enabled_models = if reasoning {
-        json!(["fixture-model","fixture-model-alt","fixture-model-unknown"])
+        json!([
+            "fixture-model",
+            "fixture-model-alt",
+            "fixture-model-unknown"
+        ])
     } else {
-        json!(["fixture-model","fixture-model-alt"])
+        json!(["fixture-model", "fixture-model-alt"])
     };
     let CatalogMutationResult::Committed {connection:Some(connection),..} = config.create_connection(serde_json::from_value(json!({
         "expectedCatalogRevision":0,"connection":{"slug":"nsh-fixture","name":"NSH fixture","provider":provider,"configuration":{"baseUrl":base},"enabled":true,"enabledModelIds":enabled_models,"modelOverrides":overrides}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org