Skip to content

Commit

Permalink
add loading icon when chat is thinking, fix conversation header style
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Jul 12, 2024
1 parent 1f9474c commit e0df3f8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/components/ChattyLLM/ChattyLLMInputForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -641,14 +641,17 @@ export default {
&--close {
.app-navigation-toggle-wrapper {
margin-right: -38px !important;
margin-right: -33px !important;
}
}
&--close ~ .session-area {
.session-area__chat-area, .session-area__input-area {
padding-left: 0 !important;
}
.session-area__top-bar {
padding-left: 36px !important;
}
}
}
Expand Down Expand Up @@ -719,6 +722,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
gap: 4px;
position: sticky;
top: 0;
height: calc(var(--default-clickable-area) + var(--default-grid-baseline) * 2);
Expand Down
9 changes: 8 additions & 1 deletion src/components/ChattyLLM/EditableTextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
:maxlength="maxLength"
:disabled="loading"
:placeholder="placeholder"
:label-outside="true"
@keydown.enter="handleSubmitText"
@keydown.esc="handleCancelEditing" />
<template v-if="!loading">
Expand Down Expand Up @@ -166,11 +167,16 @@ export default {
<style lang="scss" scoped>
.editable-text-field {
display: flex;
width: 100%;
//width: 100%;
overflow: hidden;
position: relative;
min-height: var(--default-clickable-area);
align-items: center;
gap: 4px;

> div.input-field {
margin: 0 0 0 6px !important;
}

&__edit {
margin-left: var(--default-clickable-area);
Expand All @@ -179,6 +185,7 @@ export default {
&__output {
width: 100%;
padding: 10px;
margin: 0 !important;
line-height: var(--default-line-height) !important;
}

Expand Down
5 changes: 4 additions & 1 deletion src/components/ChattyLLM/InputArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
type="primary"
@click="$emit('submit', $event)">
<template #icon>
<SendIcon :size="20" />
<NcLoadingIcon v-if="loading.llmGeneration" />
<SendIcon v-else :size="20" />
</template>
</NcButton>
</div>
Expand All @@ -32,6 +33,7 @@ import SendIcon from 'vue-material-design-icons/Send.vue'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcRichContenteditable from '@nextcloud/vue/dist/Components/NcRichContenteditable.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
/*
maxlength calculation (just a rough estimate):
Expand All @@ -48,6 +50,7 @@ export default {
NcButton,
NcRichContenteditable,
NcLoadingIcon,
},
props: {
Expand Down

0 comments on commit e0df3f8

Please sign in to comment.