Skip to content

Commit

Permalink
change log background
Browse files Browse the repository at this point in the history
  • Loading branch information
Jicheng Lu committed Jan 18, 2024
1 parent 99457be commit 3341756
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 28 deletions.
39 changes: 20 additions & 19 deletions src/lib/scss/custom/pages/_chat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -257,32 +257,33 @@

.chat-log {
flex: 0.3;
background-color: white;

.padding-side {
padding-left: 10px;
padding-right: 20px;
}

.log-close-btn {
margin-top: 1.5rem;
margin-bottom: 10px;
position: sticky;
display: flex;
justify-content: flex-end;
}
.log-background {
background-color: black;

.log-list {
height: 90vh;
.log-element {
margin-top: 20px;
margin-bottom: 20px;
border-radius: 5px;
background-color: antiquewhite;

.log-content {
padding: 15px 15px;
font-size: 15px;
.log-close-btn {
margin-top: 1.5rem;
margin-bottom: 10px;
position: sticky;
display: flex;
justify-content: flex-end;
}

.log-list {
height: 90vh;
.log-element {
margin-top: 15px;
margin-bottom: 15px;

.log-content {
font-size: 15px;
color: white;
}
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/routes/chat/[agentId]/[conversationId]/chat-box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import 'overlayscrollbars/overlayscrollbars.css';
import { OverlayScrollbars } from 'overlayscrollbars';
import { page } from '$app/stores';
import { onMount } from 'svelte';
import { onMount, tick } from 'svelte';
import Link from 'svelte-link';
import { signalr } from '$lib/services/signalr-service.js';
import { webSpeech } from '$lib/services/web-speech.js';
Expand Down Expand Up @@ -86,7 +86,7 @@
/** @param {import('$types').ChatResponseModel} message */
function onMessageReceivedFromAssistant(message) {
// webSpeech.utter(message.text);
webSpeech.utter(message.text);
// clean rich content elements
dialogs.forEach(dialog => {
if (dialog.rich_content && dialog.rich_content.message.rich_type == "quick_reply") {
Expand Down Expand Up @@ -122,9 +122,10 @@
webSpeech.start();
}
function refresh() {
async function refresh() {
// trigger UI render
dialogs = dialogs;
await tick();
setTimeout(() => {
const { viewport } = scrollbar.elements();
Expand Down Expand Up @@ -203,7 +204,7 @@
<i class="bx bx-dots-vertical-rounded" />
</DropdownToggle>
<DropdownMenu class="dropdown-menu-end">
<DropdownItem href="#">Eidt</DropdownItem>
<DropdownItem href="#">Edit</DropdownItem>
<DropdownItem href="#">Copy</DropdownItem>
<DropdownItem href="#">Delete</DropdownItem>
</DropdownMenu>
Expand Down
11 changes: 6 additions & 5 deletions src/routes/chat/[agentId]/[conversationId]/content-log.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
import 'overlayscrollbars/overlayscrollbars.css';
import { OverlayScrollbars } from 'overlayscrollbars';
import { afterUpdate, onMount } from 'svelte';
import { afterUpdate, onMount, tick } from 'svelte';
import { replaceNewLine } from '$lib/helpers/http';
/** @type {any[]} */
Expand All @@ -26,7 +26,7 @@
};
onMount(async () => {
const scrollElements = document.querySelectorAll('.scrollbar');
const scrollElements = document.querySelectorAll('.log-scrollbar');
scrollElements.forEach((item) => {
scrollbar = OverlayScrollbars(item, options);
});
Expand All @@ -39,9 +39,10 @@
});
function refreshLog() {
async function refreshLog() {
// trigger UI render
logs = logs;
await tick();
setTimeout(() => {
const { viewport } = scrollbar.elements();
Expand All @@ -52,7 +53,7 @@
</script>

<div class="chat-log">
<div class="card mb-0" style="height: 100%;">
<div class="card mb-0 log-background" style="height: 100%;">
<div class="log-close-btn padding-side ">
<button
type="button"
Expand All @@ -62,7 +63,7 @@
<span class="d-none d-sm-inline-block me-2" >Close</span><i class="mdi mdi-window-close"></i>
</button>
</div>
<div class="scrollbar log-list padding-side">
<div class="log-scrollbar log-list padding-side">
<ul>
{#each logs as log}
<div class="log-element">
Expand Down

0 comments on commit 3341756

Please sign in to comment.