Skip to content

Commit 3ff395a

Browse files
authored
Merge pull request #28 from iceljc/features/add-resizeable-panel
Features/add resizeable panel
2 parents 668dd7f + f085736 commit 3ff395a

File tree

10 files changed

+247
-171
lines changed

10 files changed

+247
-171
lines changed

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"svelte-jsoneditor": "^0.21.1",
6161
"svelte-link": "^1.4.0",
6262
"svelte-select": "^5.7.0",
63+
"svelte-splitpanes": "^0.8.0",
6364
"svelvet": "^9.0.0",
6465
"sweetalert2": "^11.6.13",
6566
"swiper": "^10.3.1"

src/lib/helpers/types.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,10 @@ IRichContent.prototype.text;
217217
/**
218218
* @typedef {Object} ContentLogModel
219219
* @property {string} conversation_id - The conversation id.
220+
* @property {string} name - The sender name.
220221
* @property {string} content - The log content.
221222
* @property {Date} created_at - The log sent time.
223+
* @property {boolean} is_collapsed - For UI display.
222224
*/
223225

224226
/**

src/lib/scss/custom/pages/_chat.scss

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,8 @@
253253
}
254254
}
255255

256-
.user-chat {
257-
flex: 1;
258-
}
259-
260-
.chat-with-log {
261-
flex: 0.6;
262-
}
263-
264256
.chat-log {
265-
flex: 0.4;
257+
height: 100vh;
266258

267259
.padding-side {
268260
padding-left: 10px;
@@ -285,11 +277,24 @@
285277
.log-element {
286278
margin-top: 15px;
287279
margin-bottom: 15px;
280+
281+
.log-meta {
282+
font-size: 15px;
283+
color: white;
284+
}
288285

289286
.log-content {
290287
font-size: 15px;
291288
color: white;
292289
}
290+
291+
.log-collapse {
292+
overflow-y: hidden;
293+
height: 10%;
294+
display: -webkit-box;
295+
-webkit-box-orient: vertical;
296+
-webkit-line-clamp: 5;
297+
}
293298

294299
.divider {
295300
overflow: visible; /* For IE */
@@ -299,6 +304,14 @@
299304
color: white;
300305
text-align: center;
301306
}
307+
308+
.toggle-btn {
309+
outline: none;
310+
box-shadow: none;
311+
color: white;
312+
font-size: 15px;
313+
padding-left: 0px;
314+
}
302315
}
303316
}
304317
}

src/routes/chat/+page.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@
66
import { getAgents } from '$lib/services/agent-service.js'
77
88
const params = $page.params;
9+
/** @type {import('$types').AgentFilter} */
10+
const filter = {
11+
pager: { page: 1, size: 10, count: 0 },
12+
isEvaluator: false
13+
};
14+
915
/** @type {import('$types').AgentModel[]} */
1016
let agents = [];
1117
let agentId = 'undefined';
1218
1319
onMount(async () => {
14-
agents = await getAgents({isEvaluator: false});
20+
const response = await getAgents(filter);
21+
agents = response?.items?.map(t => { return { ...t }; }) || [];
1522
const agentSettings = await getSettingDetail("Agent");
23+
// @ts-ignore
1624
agentId = agentSettings.hostAgentId;
1725
});
1826
</script>

0 commit comments

Comments
 (0)