Skip to content

Commit 210d98d

Browse files
authored
Merge pull request #100 from iceljc/features/refine-chat-window
refine log style
2 parents 02874f8 + 40055a5 commit 210d98d

File tree

4 files changed

+33
-42
lines changed

4 files changed

+33
-42
lines changed

src/lib/helpers/http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ export function replaceNewLine(text) {
9595
* @returns string
9696
*/
9797
export function replaceMarkdown(text) {
98-
return text.replace(/#/g, '\\# ');
98+
return text.replace(/#([\s]*)/g, '\\# ').replace(/\*([\s]*)/g, '\\* ');
9999
}

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

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@
389389

390390
.log-list {
391391
.log-element {
392-
margin-top: 25px;
393-
margin-bottom: 30px;
392+
margin-top: 10px;
393+
margin-bottom: 15px;
394394

395395
.log-meta {
396396
font-size: 15px;
@@ -431,12 +431,33 @@
431431
font-size: 15px;
432432
padding-left: 0px;
433433
}
434+
435+
.state-key {
436+
color: var(--bs-primary);
437+
}
438+
439+
.state-value-container {
440+
display: flex;
441+
flex-wrap: wrap;
442+
443+
.state-value {
444+
min-width: 50%;
445+
font-size: 15px;
446+
margin-top: 3px;
447+
margin-bottom: 3px;
448+
}
449+
}
434450
}
435451

436-
.state-log-item .log-content {
437-
span {
438-
color: white;
439-
font-size: 16px;
452+
.state-log-item {
453+
margin-top: 5px;
454+
margin-bottom: 10px;
455+
456+
.log-content {
457+
span {
458+
color: white;
459+
font-size: 16px;
460+
}
440461
}
441462
}
442463
}

src/routes/chat/[agentId]/[conversationId]/stateLogs/state-change-element.svelte

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,16 @@
44
export let data;
55
</script>
66

7-
<div class="log-element state-change-element">
8-
<div class="log-meta">
9-
<div><b>{`[${data?.name}]`}</b></div>
7+
<div class="log-element">
8+
<div class="log-meta state-key">
9+
<div><b>{`${data?.name}`}</b></div>
1010
</div>
11-
<div class="log-content">
12-
<div class="transition-word text-secondary">
13-
Before
14-
</div>
11+
<div class="log-content state-value-container">
1512
<div class="state-value">
1613
<div>{`${data?.before_value || 'unknown'}`}</div>
1714
</div>
18-
19-
<div class="transition-word text-secondary">
20-
After
21-
</div>
22-
<div class="state-value">
15+
<div class="state-value text-warning">
2316
<div>{`${data?.after_value || 'unknown'}`}</div>
2417
</div>
2518
</div>
2619
</div>
27-
28-
<style>
29-
.transition-word {
30-
font-size: 12px;
31-
font-weight: 600;
32-
margin-top: 5px;
33-
margin-bottom: 5px;
34-
}
35-
36-
.state-change-element {
37-
margin-top: 15px !important;
38-
margin-bottom: 15px !important;
39-
}
40-
41-
.state-value {
42-
font-size: 15px;
43-
}
44-
</style>

src/routes/chat/[agentId]/[conversationId]/stateLogs/state-log-element.svelte

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
<script>
2-
import { utcToLocal } from '$lib/helpers/datetime';
32
import JSONTree from 'svelte-json-tree';
43
54
/** @type {any} */
65
export let data;
76
</script>
87

98
<div class="log-element state-log-item" id={`state-log-${data.message_id}`}>
10-
<div class="log-meta">
11-
<div><b>{`[${utcToLocal(data.created_at, 'hh:mm:ss.SSS A, MMM DD YYYY')}]`}</b></div>
12-
</div>
13-
<br>
149
<div class="log-content">
1510
<JSONTree value={data?.states || {}} />
1611
</div>

0 commit comments

Comments
 (0)