Skip to content

Commit 9b2c7b5

Browse files
author
Jicheng Lu
committed
refine styles
1 parent db3a57e commit 9b2c7b5

File tree

3 files changed

+48
-18
lines changed

3 files changed

+48
-18
lines changed

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

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,18 @@
102102
height: 80%;
103103
max-height: 25px;
104104
}
105+
106+
.chat-head-agent-name {
107+
font-size: 0.8em;
108+
}
105109
}
106110

107111
.chat-head-user {
108112
flex: 0.5;
109113
display: flex;
110114
gap: 5px;
111115
width: fit-content;
112-
font-size: 12px;
116+
font-size: 0.7em !important;
113117
}
114118
}
115119
}
@@ -127,6 +131,7 @@
127131
display: flex;
128132
justify-content: flex-end;
129133
align-items: center;
134+
gap: 5px;
130135
}
131136

132137
.user-chat-nav {
@@ -141,8 +146,14 @@
141146
background-color: var(--#{$prefix}light);
142147
border-radius: 50%;
143148
border: none;
144-
width: 40px;
145-
height: 40px;
149+
// width: 40px;
150+
// height: 40px;
151+
width: 2em;
152+
height: 2em;
153+
154+
i {
155+
font-size: 0.8em;
156+
}
146157
}
147158

148159
.dropdown {
@@ -176,6 +187,10 @@
176187
border-top-left-radius: 0px;
177188
border-bottom-left-radius: 0px;
178189
}
190+
191+
i, span {
192+
font-size: 0.9em;
193+
}
179194
}
180195
}
181196

@@ -420,6 +435,10 @@
420435

421436
.log-footer {
422437
flex: 2%;
438+
439+
.log-footer-nav-btn {
440+
font-size: 0.75em;
441+
}
423442
}
424443

425444
.instant-log-body {

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

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
const params = $page.params;
8888
const messageLimit = 100;
8989
const screenWidthThreshold = 1024;
90+
const chatWidthThreshold = 300;
9091
const maxTextLength = 64000;
9192
const duration = 2000;
9293
@@ -219,6 +220,7 @@
219220
selectedTags = conversation?.tags || [];
220221
initUserSentMessages(dialogs);
221222
initChatView();
223+
handlePaneResize();
222224
223225
signalr.onMessageReceivedFromClient = onMessageReceivedFromClient;
224226
signalr.onMessageReceivedFromCsr = onMessageReceivedFromClient;
@@ -659,7 +661,7 @@
659661
if (disableSpeech) return;
660662
661663
if (!isListening) {
662-
llmRealtime.start(params.agentId, message => {
664+
llmRealtime.start(params.agentId, (/** @type {any} */ message) => {
663665
console.log(message);
664666
});
665667
isListening = true;
@@ -1317,6 +1319,14 @@
13171319
isLoading = false;
13181320
});
13191321
}
1322+
1323+
function handlePaneResize() {
1324+
const header = document.querySelector('.chat-head');
1325+
if (!header) return;
1326+
1327+
const width = header.getBoundingClientRect().width;
1328+
isLite = width < chatWidthThreshold;
1329+
}
13201330
</script>
13211331
13221332
@@ -1432,9 +1442,9 @@
14321442
14331443
<HeadTitle title="Chat" addOn='' />
14341444
<div class="d-lg-flex">
1435-
<Splitpanes>
1445+
<Splitpanes on:resize={() => handlePaneResize()}>
14361446
{#if isLoadInstantLog}
1437-
<Pane size={30} minSize={20} maxSize={50} >
1447+
<Pane size={30} minSize={25} maxSize={40} >
14381448
<InstantLog
14391449
bind:msgStateLogs={msgStateLogs}
14401450
bind:agentQueueLogs={agentQueueLogs}
@@ -1444,7 +1454,7 @@
14441454
/>
14451455
</Pane>
14461456
{/if}
1447-
<Pane minSize={20}>
1457+
<Pane minSize={30}>
14481458
<div style="height: 100vh;">
14491459
<div class="card mb-0" style="height: 100vh;">
14501460
<div class="border-bottom chat-head">
@@ -1469,18 +1479,18 @@
14691479
</div>
14701480
14711481
<div class="col-md-8 col-5">
1472-
<ul class="list-inline user-chat-nav user-chat-nav-flex mb-0">
1482+
<div class="user-chat-nav user-chat-nav-flex mb-0">
14731483
{#if PUBLIC_DEBUG_MODE === 'true' && isFrame}
1474-
<li class="list-inline-item">
1484+
<div class="">
14751485
<button
14761486
class="btn btn-secondary btn-rounded btn-sm"
14771487
on:click={() => openFullScreen()}
14781488
>
14791489
<i class="bx bx-fullscreen" />
14801490
</button>
1481-
</li>
1491+
</div>
14821492
{/if}
1483-
<li class="list-inline-item">
1493+
<div class="">
14841494
{#if !isLite}
14851495
<Dropdown>
14861496
<DropdownToggle class="nav-btn dropdown-toggle">
@@ -1547,9 +1557,9 @@
15471557
/>
15481558
</button>
15491559
{/if}
1550-
</li>
1560+
</div>
15511561
1552-
<li class="list-inline-item btn-pair">
1562+
<div class="btn-pair">
15531563
{#if !isLite}
15541564
<button
15551565
class={`btn btn-rounded btn-sm btn-primary btn-left`}
@@ -1558,13 +1568,12 @@
15581568
>
15591569
<span
15601570
data-bs-toggle="tooltip"
1561-
data-bs-placement="top"
1571+
data-bs-placement="bottom"
15621572
title="New Conversation"
15631573
>
15641574
<i class="mdi mdi-plus" />
15651575
<span class="me-2">New</span>
15661576
</span>
1567-
15681577
</button>
15691578
{/if}
15701579
<button
@@ -1577,8 +1586,8 @@
15771586
{/if}
15781587
<i class="mdi mdi-window-close" />
15791588
</button>
1580-
</li>
1581-
</ul>
1589+
</div>
1590+
</div>
15821591
</div>
15831592
</div>
15841593
</div>
@@ -1869,7 +1878,7 @@
18691878
</div>
18701879
</Pane>
18711880
{#if isLoadPersistLog}
1872-
<Pane size={30} minSize={20} maxSize={50}>
1881+
<Pane size={30} minSize={25} maxSize={40}>
18731882
<PersistLog
18741883
bind:contentLogs={contentLogs}
18751884
bind:convStateLogs={convStateLogs}

src/routes/chat/[agentId]/[conversationId]/persist-log/persist-log.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
<NavBar id={'persist-log-container'}>
160160
<NavItem
161161
navBtnId={'content-log-tab'}
162+
navBtnClasses={'log-footer-nav-btn'}
162163
dataBsTarget={'#content-log-tab-pane'}
163164
ariaControls={'content-log-tab-pane'}
164165
navBtnText={'Content Log'}
@@ -168,6 +169,7 @@
168169
/>
169170
<NavItem
170171
navBtnId={'conv-state-log-tab'}
172+
navBtnClasses={'log-footer-nav-btn'}
171173
dataBsTarget={'#conv-state-log-tab-pane'}
172174
ariaControls={'conv-state-log-tab-pane'}
173175
navBtnText={'Conversation States'}

0 commit comments

Comments
 (0)