Skip to content

Commit 8536f83

Browse files
committed
improve chat styles
1 parent b5e574d commit 8536f83

4 files changed

Lines changed: 221 additions & 206 deletions

File tree

compact.cirru

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,10 @@
447447
{} $ :class-name (str-spaced css/row-middle css/gap8 style-reply-actions)
448448
button
449449
{}
450-
:class-name $ str-spaced css/button style-more
450+
:class-name $ str-spaced css/button style-reply-button
451451
:on-click $ fn (e d!)
452452
.show reply-plugin d! $ fn (text) (submit-message! cursor state text false false model d!)
453-
<> "|回复"
453+
<> |Reply
454454
, nil
455455
if (:loading? state)
456456
div ({}) (memof1-call-by :abort-loading comp-abort "\"Loading...")
@@ -801,7 +801,6 @@
801801
:code $ quote
802802
defstyle style-message-assistant $ {}
803803
"\"&" $ {} (:align-self :flex-start)
804-
:background-color $ hsl 0 0 100
805804
:examples $ []
806805
|style-message-box $ %{} :CodeEntry (:doc |)
807806
:code $ quote
@@ -822,7 +821,7 @@
822821
|style-message-item $ %{} :CodeEntry (:doc |)
823822
:code $ quote
824823
defstyle style-message-item $ {}
825-
"\"&" $ {} (:padding "\"12px 16px") (:border-radius 10) (:max-width "\"80%") (:line-height "\"1.6")
824+
"\"&" $ {} (:line-height "\"1.6")
826825
:examples $ []
827826
|style-message-list $ %{} :CodeEntry (:doc |)
828827
:code $ quote
@@ -846,6 +845,8 @@
846845
defstyle style-message-user $ {}
847846
"\"&" $ {} (:align-self :flex-end)
848847
:background-color $ hsl 0 0 96
848+
:padding "\"12px 16px"
849+
:border-radius 10
849850
:examples $ []
850851
|style-more $ %{} :CodeEntry (:doc |)
851852
:code $ quote
@@ -856,7 +857,7 @@
856857
:padding "\"4px 12px"
857858
:margin "\"8px 0"
858859
:white-space :nowrap
859-
:display :inline-flex
860+
:display :inline-block
860861
"\"&:hover" $ {}
861862
:box-shadow $ str "\"1px 1px 4px " (hsl 0 0 0 0.2)
862863
:examples $ []
@@ -865,6 +866,19 @@
865866
defstyle style-reply-actions $ {}
866867
"\"&" $ {} (:margin-top 6) (:justify-content :flex-start) (:width "\"100%")
867868
:examples $ []
869+
|style-reply-button $ %{} :CodeEntry (:doc |)
870+
:code $ quote
871+
defstyle style-reply-button $ {}
872+
"\"&" $ {} (:text-align :center) (:min-width 80)
873+
:background-color $ hsl 0 0 100
874+
:border-radius 16
875+
:padding "\"4px 12px"
876+
:margin "\"8px 0"
877+
:white-space :nowrap
878+
:display :inline-block
879+
"\"&:hover" $ {}
880+
:box-shadow $ str "\"1px 1px 4px " (hsl 0 0 0 0.2)
881+
:examples $ []
868882
|style-submit $ %{} :CodeEntry (:doc |)
869883
:code $ quote
870884
defstyle style-submit $ {}
@@ -873,8 +887,8 @@
873887
|style-textbox $ %{} :CodeEntry (:doc |)
874888
:code $ quote
875889
defstyle style-textbox $ {}
876-
"\"&" $ {} (:border-radius 12) (:height "\"max(160px,20vh)") (:width "\"100%") (:transition-duration "\"320ms") (:border :none) (:background-color :transparent)
877-
"\"&.focus-within" $ {} (:height "\"max(240px,32vh)") (:border :none) (:box-shadow :none)
890+
"\"&" $ {} (:border-radius 12) (:height "|max(100px,15vh)") (:width "\"100%") (:transition-duration "\"320ms") (:border :none) (:background-color :transparent)
891+
"\"&.focus-within" $ {} (:height "|max(240px,32vh)") (:border :none) (:box-shadow :none)
878892
:examples $ []
879893
|style-thinking $ %{} :CodeEntry (:doc |)
880894
:code $ quote
@@ -893,28 +907,31 @@
893907
:code $ quote
894908
defn submit-message! (cursor state prompt-text search? think? model d!) (hint-fn async)
895909
let
910+
state1 $ assoc state :messages
911+
append-user-message (:messages state) prompt-text
896912
*text $ atom "\""
897913
*thinking-text $ atom "\""
898914
model $ :model state
915+
d! cursor state1
899916
try
900917
do $ case-default model
901-
js-await $ call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text
902-
:gemini-pro $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text)
903-
:flash-imagen $ js-await (call-flash-imagen-msg! model cursor state prompt-text d!)
904-
:imagen-4 $ js-await (call-imagen-4-msg! model cursor state prompt-text d!)
905-
:gemini-thinking $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text)
906-
:gemini-flash-thinking $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text)
907-
:gemini-flash-lite $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text)
908-
:gemini-flash $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text)
909-
:gemini-learnlm $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text)
910-
:claude-3.7 $ js-await (call-anthropic-msg! cursor state prompt-text "\"claude-3-7-sonnet-20250219" false d!)
911-
:openrouter/anthropic/claude-sonnet-4 $ js-await (call-openrouter! cursor state prompt-text "\"anthropic/claude-sonnet-4" true d! *text)
912-
:openrouter/anthropic/claude-opus-4 $ js-await (call-openrouter! cursor state prompt-text "\"anthropic/claude-opus-4" true d! *text)
913-
:openrouter/anthropic/claude-3.7-sonnet:thinking $ js-await (call-openrouter! cursor state prompt-text "\"anthropic/claude-3.7-sonnet:thinking" true d! *text)
914-
:openrouter/google/gemini-2.5-pro-preview $ js-await (call-openrouter! cursor state prompt-text "\"google/gemini-2.5-pro-preview" true d! *text)
915-
:openrouter/google/gemini-2.5-flash-preview-05-20 $ js-await (call-openrouter! cursor state prompt-text "\"google/gemini-2.5-flash-preview-05-20" true d! *text)
916-
:openrouter/openai/gpt-5 $ js-await (call-openrouter! cursor state prompt-text "\"openai/gpt-5" true d! *text)
917-
:openrouter/deepseek/deepseek-chat-v3.1 $ js-await (call-openrouter! cursor state prompt-text "\"deepseek/deepseek-chat-v3.1" true d! *text)
918+
js-await $ call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text
919+
:gemini-pro $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text)
920+
:flash-imagen $ js-await (call-flash-imagen-msg! model cursor state1 prompt-text d!)
921+
:imagen-4 $ js-await (call-imagen-4-msg! model cursor state1 prompt-text d!)
922+
:gemini-thinking $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text)
923+
:gemini-flash-thinking $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text)
924+
:gemini-flash-lite $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text)
925+
:gemini-flash $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text)
926+
:gemini-learnlm $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text)
927+
:claude-3.7 $ js-await (call-anthropic-msg! cursor state1 prompt-text "\"claude-3-7-sonnet-20250219" false d!)
928+
:openrouter/anthropic/claude-sonnet-4 $ js-await (call-openrouter! cursor state1 prompt-text "\"anthropic/claude-sonnet-4" true d! *text)
929+
:openrouter/anthropic/claude-opus-4 $ js-await (call-openrouter! cursor state1 prompt-text "\"anthropic/claude-opus-4" true d! *text)
930+
:openrouter/anthropic/claude-3.7-sonnet:thinking $ js-await (call-openrouter! cursor state1 prompt-text "\"anthropic/claude-3.7-sonnet:thinking" true d! *text)
931+
:openrouter/google/gemini-2.5-pro-preview $ js-await (call-openrouter! cursor state1 prompt-text "\"google/gemini-2.5-pro-preview" true d! *text)
932+
:openrouter/google/gemini-2.5-flash-preview-05-20 $ js-await (call-openrouter! cursor state1 prompt-text "\"google/gemini-2.5-flash-preview-05-20" true d! *text)
933+
:openrouter/openai/gpt-5 $ js-await (call-openrouter! cursor state1 prompt-text "\"openai/gpt-5" true d! *text)
934+
:openrouter/deepseek/deepseek-chat-v3.1 $ js-await (call-openrouter! cursor state1 prompt-text "\"deepseek/deepseek-chat-v3.1" true d! *text)
918935
fn (e)
919936
let
920937
err-text $ str "\"Failed to load: " e

deps.cirru

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
{} (:calcit-version |0.10.8)
2+
{} (:calcit-version |0.10.9)
33
:dependencies $ {} (|Respo/alerts.calcit |0.10.4)
44
|Respo/reel.calcit |main
55
|Respo/respo-markdown.calcit |0.4.11

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dependencies": {
3-
"@calcit/procs": "^0.10.8",
4-
"@google/genai": "^1.36.0",
3+
"@calcit/procs": "^0.10.9",
4+
"@google/genai": "^1.37.0",
55
"axios": "^1.12.2",
66
"cirru-color": "^0.2.4",
77
"copy-text-to-clipboard": "^3.2.2",

0 commit comments

Comments
 (0)