Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"svelte-file-dropzone": "^2.0.2",
"svelte-flatpickr": "^3.3.3",
"svelte-i18n": "^4.0.0",
"svelte-json-tree": "^2.2.0",
"svelte-jsoneditor": "^0.21.1",
"svelte-link": "^1.4.0",
"svelte-select": "^5.7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/common/Loader.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { Circle } from 'svelte-loading-spinners';
export let size=100
export let size = 100;
</script>

<div class="loader">
Expand Down
14 changes: 14 additions & 0 deletions src/lib/helpers/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ IRichContent.prototype.text;
* @property {boolean} is_collapsed - For UI display.
*/

/**
* @typedef {Object} ConversationStateLogModel
* @property {string} conversation_id - The conversation id.
* @property {string} states - The states content.
* @property {Date} created_at - The states sent time.
*/

/**
* Invoked when a new conersation is created.
* This callback type is called `requestCallback` and is displayed as a global symbol.
Expand Down Expand Up @@ -251,6 +258,13 @@ IRichContent.prototype.text;
* @param {ContentLogModel} log
*/

/**
* Conversation states
*
* @callback OnConversationStatesGenerated
* @param {ConversationStateLogModel} data
*/

// having to export an empty object here is annoying,
// but required for vscode to pass on your types.
export default {};
2 changes: 2 additions & 0 deletions src/lib/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1807,3 +1807,5 @@ $kbd-bg: var(--#{$prefix}body-color);
$nested-kbd-font-weight: null; // Deprecated in v5.2.0, removing in v6

$pre-color: null;

$faded-color: #BCBCBC;
43 changes: 38 additions & 5 deletions src/lib/scss/custom/pages/_chat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@
box-shadow: $box-shadow;
border: 1px solid var(--#{$prefix}border-color);

li:first-child {
@media (max-width: 1024px) {
display: none;
li {
&:nth-child(-n+2) {
@media (max-width: 1024px) {
display: none;
}
}
}
}
Expand Down Expand Up @@ -275,8 +277,8 @@
.log-list {
height: 90vh;
.log-element {
margin-top: 15px;
margin-bottom: 15px;
margin-top: 25px;
margin-bottom: 30px;

.log-meta {
font-size: 15px;
Expand All @@ -286,6 +288,19 @@
.log-content {
font-size: 15px;
color: white;

li {
margin-top: 5px;
margin-bottom: 5px;
.property {
padding-left: 10px;
}
}

span {
color: white;
font-size: 18px;
}
}

.log-collapse {
Expand All @@ -312,11 +327,29 @@
font-size: 15px;
padding-left: 0px;
}

&:nth-child(even) {
.log-meta {
color: $faded-color !important;
}

.log-content {
color: $faded-color !important;
span {
color: $faded-color !important;
}
}

button {
color: $faded-color !important;
}
}
}
}
}
}


.chat-iframe {
@media (max-width: 1024px) {
position: fixed;
Expand Down
10 changes: 10 additions & 0 deletions src/lib/services/signalr-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const signalr = {
/** @type {import('$types').OnContentLogReceived} */
onContentLogGenerated: () => {},

/** @type {import('$types').OnConversationStatesGenerated} */
onConversationStatesGenerated: () => {},

// start the connection
/** @param {string} conversationId */
async start(conversationId) {
Expand Down Expand Up @@ -84,6 +87,13 @@ export const signalr = {
this.onContentLogGenerated(jsonLog);
}
});

connection.on('onConversateStatesGenerated', (data) => {
const jsonData = JSON.parse(data);
if (conversationId === jsonData?.conversation_id) {
this.onConversationStatesGenerated(jsonData);
}
});
},

// stop the connection
Expand Down
Loading