Skip to content

Commit 86a1bc0

Browse files
author
Jicheng Lu
committed
refine log
1 parent c38f02b commit 86a1bc0

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368
position: sticky;
369369
display: flex;
370370
justify-content: space-between;
371-
height: 5vh;
371+
height: 7vh;
372372
}
373373

374374
.state-log-section {

src/routes/chat/[agentId]/[conversationId]/chat-box.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@
458458
});
459459
} else {
460460
window.parent.postMessage({ action: "close" }, "*");
461-
}
461+
}
462462
}
463463
464464
function toggleContentLog() {

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
<script>
2-
32
/** @type {any} */
43
export let data;
54
65
/** @type {string} */
76
let beforeActiveRoundText = '';
87
let afterActiveRoundText = '';
9-
const defaultKey = '-';
8+
let beforeDataValue = '';
9+
let afterDataValue = '';
10+
const defaultValue = '-';
1011
1112
$: {
13+
beforeDataValue = buildDataValue(data?.before_value);
14+
afterDataValue = buildDataValue(data?.after_value);
1215
beforeActiveRoundText = buildActiveRoundText(data?.before_value, data?.before_active_rounds);
1316
afterActiveRoundText = buildActiveRoundText(data?.after_value, data?.after_active_rounds);
1417
}
1518
19+
/** @param {any} value */
20+
function buildDataValue(value) {
21+
return value || defaultValue;
22+
}
23+
1624
/**
1725
* @param {any} value
1826
* @param {any} activeRounds
@@ -34,14 +42,15 @@
3442
}
3543
</script>
3644
45+
{#if beforeDataValue != defaultValue || afterDataValue != defaultValue}
3746
<div class="log-element state-change-container">
3847
<div class="log-meta state-key">
3948
<div><b>{`${data?.name}`}</b></div>
4049
</div>
4150
<div class="log-content state-value-container">
4251
<div class="state-value">
4352
<div class="value">
44-
{`${data?.before_value || defaultKey}`}
53+
{beforeDataValue}
4554
</div>
4655
{#if !!beforeActiveRoundText}
4756
<div class="active-rounds">
@@ -51,7 +60,7 @@
5160
</div>
5261
<div class="state-value text-warning">
5362
<div class="value">
54-
{`${data?.after_value || defaultKey}`}
63+
{afterDataValue}
5564
</div>
5665
{#if !!afterActiveRoundText}
5766
<div class="active-rounds">
@@ -61,3 +70,4 @@
6170
</div>
6271
</div>
6372
</div>
73+
{/if}

0 commit comments

Comments
 (0)