Skip to content

Commit 558bdf3

Browse files
committed
fix #61 and add config background on mouse hover
1 parent 83edede commit 558bdf3

File tree

6 files changed

+45
-13
lines changed

6 files changed

+45
-13
lines changed

src/assets/styles/components/_message.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@
182182
&.user .message-actions {
183183
margin-top: 0.5rem;
184184
justify-content: flex-end;
185+
186+
// This fixes https://github.com/beekeeper-studio/bks-ai-shell/issues/61
187+
.btn:last-child .title-popup {
188+
right: 0;
189+
}
185190
}
186191

187192
.message-content .code-block .actions .btn {

src/assets/styles/pages/configuration/_general.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@
22
.base-input textarea {
33
resize: vertical;
44
}
5-
6-
.switch {
7-
margin-top: 1.5rem;
8-
}
95
}

src/assets/styles/pages/configuration/_main.scss

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
}
1616

1717
.configuration {
18+
--config-bg-hover: color-mix(in srgb, var(--theme-base) 3.5%, var(--query-editor-bg));
1819
position: fixed;
1920
top: 0;
2021
left: 0;
@@ -49,7 +50,7 @@
4950
background-color: transparent;
5051

5152
&:not(.back-btn):hover {
52-
background-color: rgb(from var(--theme-base) r g b / 3.5%);
53+
background-color: var(--config-bg-hover);
5354
}
5455

5556
&.active {
@@ -62,7 +63,7 @@
6263
}
6364

6465
.content {
65-
padding: 1rem;
66+
padding-bottom: 1rem;
6667
padding-top: 1.26rem;
6768
flex-grow: 1;
6869
min-width: 0;
@@ -75,5 +76,18 @@
7576
> :last-child {
7677
padding-bottom: 2rem;
7778
}
79+
80+
h1, h2, h3, h4, p, li, .base-input {
81+
padding-inline: 1rem;
82+
}
83+
84+
.base-input {
85+
padding-block: 0.75rem;
86+
border-radius: 8px;
87+
88+
&:hover {
89+
background-color: var(--config-bg-hover);
90+
}
91+
}
7892
}
7993
}

src/assets/styles/pages/configuration/_models.scss

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,32 @@
66

77
h3 {
88
margin: 0;
9-
width: 7rem;
9+
width: 6rem;
10+
padding-right: 0;
11+
padding-top: 0.35rem;
1012
}
1113

1214
.model-list {
1315
flex-grow: 1;
1416
}
1517

1618
.model {
17-
height: 2rem;
19+
border-radius: 8px;
20+
21+
&.available label {
22+
cursor: pointer;
23+
}
1824

1925
label {
26+
height: 2rem;
2027
display: flex;
2128
justify-content: space-between;
2229
align-items: center;
2330
}
31+
32+
&:hover {
33+
background-color: var(--config-bg-hover);
34+
}
2435
}
2536

2637
.switch {
@@ -59,6 +70,11 @@
5970
.api-info {
6071
margin-bottom: 1rem;
6172
}
73+
74+
.api-key-form {
75+
gap: 0;
76+
}
77+
6278
.description {
6379
margin-top: 0;
6480
margin-bottom: 1rem;
@@ -68,7 +84,7 @@
6884
}
6985

7086
>.base-input {
71-
margin-top: 1rem;
87+
// margin-top: 1rem;
7288

7389
label {
7490
width: 7rem;
@@ -110,7 +126,8 @@
110126
}
111127
}
112128

113-
.api-key-form .base-input, .config-form .base-input {
129+
.api-key-form .base-input,
130+
.config-form .base-input {
114131
display: grid;
115132
grid-template-columns: 1fr 3fr;
116133

src/components/common/BaseInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default {
6363
if (this.$refs.focusable) {
6464
(this.$refs.focusable as HTMLElement).focus();
6565
}
66-
}
66+
},
6767
},
6868
};
6969
</script>

src/components/configuration/ModelsConfiguration.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<div v-for="provider in modelsByProvider" class="provider">
44
<h3>{{ provider.providerDisplayName }}</h3>
55
<ul class="model-list">
6-
<li v-for="model in provider.models" :key="model.id" class="model">
7-
<label class="switch-label" :title="!model.available ? 'Enter the API key to enable this model' : model.id
6+
<li v-for="model in provider.models" :key="model.id" class="model" :class="{ available: model.available }">
7+
<label class="switch-label" :title="!model.available ? `${provider.providerDisplayName} API key is required to enable this model` : model.id
88
">
99
{{ model.displayName }}
1010
<Switch :model-value="model.enabled" @change="toggle(model, $event)" :disabled="!model.available" />

0 commit comments

Comments
 (0)