Skip to content

Commit

Permalink
dismiss menu after selecting option, change button color, fix border …
Browse files Browse the repository at this point in the history
…radius
  • Loading branch information
sid597 committed Jan 9, 2024
1 parent 5cd3fd0 commit 3cbec96
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/main/ui/components.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
:on-click callback}])

(defn button-popover [button-text render-comp]

[:> Popover
{:position "bottom"}
[:> Button {:minimal true
Expand Down
34 changes: 16 additions & 18 deletions src/main/ui/render_comp.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,7 @@
:margin "10px 10px -10px 10px "
:background-color "whitesmoke"
:border "1px"}}
[chat-context context]
[:> ButtonGroup
{:vertical true
:style {:align-self "flex-end"
:padding "15px"}}]]

[chat-context context]]
[:div.chin
{:style {:display "flex"
:flex-direction "row"
Expand All @@ -290,20 +285,23 @@
(str "Model: " @default-model)
[:div
[:span {:style {:margin-bottom "5px"}} "Select Model:"]
[:> HTMLSelect
{:fill true
:style {:margin-bottom "10px"}
:on-change (fn [e]
(reset! default-model (j/get-in e [:currentTarget :value])))
:value @default-model}

[:option {:value "gpt-4-1106-preview"} "gpt-4-1106-preview"]
[:option {:value "gpt-3.5-turbo-1106"} "gpt-3.5-turbo-1106"]]]]

[:> Divider]
[:> Menu.Item
{:text "gpt-4-1106-preview"
:on-click (fn [e]
(js/console.log "clicked menu item" e)
(reset! default-model "gpt-4-1106-preview"))}]
[:> Divider]
[:> Menu
[:> Menu.Item
{:text "gpt-3.5-turbo-1106"
:on-click (fn [e]
(js/console.log "clicked menu item" e)
(reset! default-model "gpt-3.5-turbo-1106"))}]]]]
[:> Divider]
[comp/button-popover
(str "Max Tokens: " @default-msg-value)
[:div
[:div.bp3-popover-dismiss
[:span {:style {:margin-bottom "5px"}} "Max output length:"]
[:> Slider {:min 0
:max 2048
Expand All @@ -318,7 +316,7 @@
[:> Divider]
[comp/button-popover
(str "Temperature: " (js/parseFloat (.toFixed @default-temp 1)))
[:div
[:div.bp3-popover-dismiss
{:style {:margin-bottom "10px"}}
[:span {:style {:margin-bottom "5px"}} "Temperature:"]
[:> Slider {:min 0
Expand Down

0 comments on commit 3cbec96

Please sign in to comment.