Skip to content

Commit

Permalink
Merge pull request #1642 from solliancenet/sc-fix-ui-lint-errors-081
Browse files Browse the repository at this point in the history
(0.8.1) Fix UI lint errors + minor fixes
  • Loading branch information
ciprianjichici authored Aug 28, 2024
2 parents b1b2a96 + 78eb1f9 commit dce4b8c
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 49 deletions.
9 changes: 4 additions & 5 deletions src/ui/UserPortal/components/ChatInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
<template #popper> Use Shift+Enter to add a new line </template>
</VTooltip>
</div>
<VTooltip
:autoHide="false"
:popperTriggers="['hover']"
>
<VTooltip :auto-hide="false" :popper-triggers="['hover']">
<Button
:badge="fileArrayFiltered.length.toString() || null"
:aria-label="'Upload file (' + fileArrayFiltered.length.toString() + ' files attached)'"
Expand All @@ -21,7 +18,9 @@
@click="showFileUploadDialog = true"
/>
<template #popper>
Attach files ({{ fileArrayFiltered.length === 1 ? '1 file' : fileArrayFiltered.length + ' files' }})
Attach files ({{
fileArrayFiltered.length === 1 ? '1 file' : fileArrayFiltered.length + ' files'
}})
</template>
</VTooltip>
<Dialog
Expand Down
9 changes: 6 additions & 3 deletions src/ui/UserPortal/components/ChatMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
}"
/>
<VTooltip :auto-hide="false" :popper-triggers="['hover']">
<span class="time-stamp" tabindex="0">{{ $filters.timeAgo(new Date(message.timeStamp)) }}</span>
<span class="time-stamp" tabindex="0">{{
$filters.timeAgo(new Date(message.timeStamp))
}}</span>
<template #popper>
{{formatTimeStamp(message.timeStamp)}}
{{ formatTimeStamp(message.timeStamp) }}
</template>
</VTooltip>

Expand Down Expand Up @@ -131,6 +133,7 @@
<span>
<!-- Copy message button -->
<Button
:disabled="message.type === 'LoadingMessage'"
class="message__button"
size="small"
text
Expand All @@ -152,8 +155,8 @@

<!-- Prompt dialog -->
<Dialog
class="prompt-dialog"
v-model:visible="viewPrompt"
class="prompt-dialog"
modal
header="Completion Prompt"
>
Expand Down
28 changes: 11 additions & 17 deletions src/ui/UserPortal/components/ChatSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,18 @@
@keydown.enter="handleSessionSelected(session)"
>
<div class="chat" :class="{ 'chat--selected': currentSession?.id === session.id }">

<!-- Chat name -->
<VTooltip :auto-hide="false" :popper-triggers="['hover']">
<h2 class="chat__name" tabindex="0">{{ session.name }}</h2>
<template #popper>
{{session.name}}
{{ session.name }}
</template>
</VTooltip>

<!-- Chat icons -->
<span v-if="currentSession?.id === session.id" class="chat__icons">
<!-- Rename session -->
<VTooltip
:autoHide="false"
:popperTriggers="['hover']"
>
<VTooltip :auto-hide="false" :popper-triggers="['hover']">
<Button
icon="pi pi-pencil"
size="small"
Expand All @@ -72,16 +68,11 @@
aria-label="Rename chat session"
@click.stop="openRenameModal(session)"
/>
<template #popper>
Rename chat session
</template>
<template #popper> Rename chat session </template>
</VTooltip>

<!-- Delete session -->
<VTooltip
:autoHide="false"
:popperTriggers="['hover']"
>
<VTooltip :auto-hide="false" :popper-triggers="['hover']">
<Button
icon="pi pi-trash"
size="small"
Expand All @@ -90,9 +81,7 @@
aria-label="Delete chat session"
@click.stop="sessionToDelete = session"
/>
<template #popper>
Delete chat session
</template>
<template #popper> Delete chat session </template>
</VTooltip>
</span>
</div>
Expand Down Expand Up @@ -152,7 +141,12 @@
>
<div v-if="deleteProcessing" class="delete-dialog-content">
<div role="status">
<i class="pi pi-spin pi-spinner" style="font-size: 2rem;" role="img" aria-label="Loading"></i>
<i
class="pi pi-spin pi-spinner"
style="font-size: 2rem"
role="img"
aria-label="Loading"
></i>
</div>
</div>
<div v-else>
Expand Down
27 changes: 18 additions & 9 deletions src/ui/UserPortal/components/ChatThread.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<template>
<div class="chat-thread">
<!-- Message list -->
<div class="chat-thread__messages"
<div
ref="messageContainer"
class="chat-thread__messages"
:class="messages.length === 0 && 'empty'"
ref="messageContainer">
>
<template v-if="isLoading">
<div class="chat-thread__loading" role="status">
<i class="pi pi-spin pi-spinner" style="font-size: 2rem" role="img" aria-label="Loading"></i>
<i
class="pi pi-spin pi-spinner"
style="font-size: 2rem"
role="img"
aria-label="Loading"
></i>
</div>
</template>

Expand All @@ -18,9 +25,11 @@
v-for="(message, index) in messages.slice()"
:key="`${message.id}-${componentKey}`"
:message="message"
:show-word-animation="index === 0 && userSentMessage && message.sender === 'Assistant'"
@rate="handleRateMessage($event.message, $event.isLiked)"
:show-word-animation="
index === messages.length - 1 && userSentMessage && message.sender === 'Assistant'
"
role="log"
@rate="handleRateMessage($event.message, $event.isLiked)"
/>
</template>

Expand Down Expand Up @@ -161,10 +170,10 @@ export default {
},
scrollToBottom() {
this.$nextTick(() => {
this.$refs.messageContainer.scrollTop = this.$refs.messageContainer.scrollHeight;
});
},
this.$nextTick(() => {
this.$refs.messageContainer.scrollTop = this.$refs.messageContainer.scrollHeight;
});
},
},
};
</script>
Expand Down
24 changes: 9 additions & 15 deletions src/ui/UserPortal/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<div class="navbar">
<!-- Sidebar header -->
<div class="navbar__header">
<img v-if="$appConfigStore.logoUrl !== ''" :src="$appConfigStore.logoUrl" :alt="$appConfigStore.logoText" />
<img
v-if="$appConfigStore.logoUrl !== ''"
:src="$appConfigStore.logoUrl"
:alt="$appConfigStore.logoText"
/>
<span v-else>{{ $appConfigStore.logoText }}</span>

<template v-if="!$appConfigStore.isKioskMode">
Expand All @@ -26,10 +30,7 @@
<div class="navbar__content__left__item">
<template v-if="currentSession">
<span>{{ currentSession.name }}</span>
<VTooltip
:autoHide="false"
:popperTriggers="['hover']"
>
<VTooltip :auto-hide="false" :popper-triggers="['hover']">
<Button
v-if="!$appConfigStore.isKioskMode"
class="button--share"
Expand All @@ -39,9 +40,7 @@
aria-label="Copy link to chat session"
@click="handleCopySession"
/>
<template #popper>
Copy link to chat session
</template>
<template #popper> Copy link to chat session </template>
</VTooltip>
<Toast position="top-center" />
</template>
Expand All @@ -58,18 +57,13 @@
<div class="navbar__content__right">
<template v-if="currentSession">
<span class="header__dropdown">
<VTooltip
:autoHide="false"
:popperTriggers="['hover']"
>
<VTooltip :auto-hide="false" :popper-triggers="['hover']">
<AgentIcon
:src="$appConfigStore.agentIconUrl || '~/assets/FLLM-Agent-Light.svg'"
alt="Select an agent"
tabindex="0"
/>
<template #popper>
Select an agent
</template>
<template #popper> Select an agent </template>
</VTooltip>
<Dropdown
v-model="agentSelection"
Expand Down

0 comments on commit dce4b8c

Please sign in to comment.