Skip to content

Commit 1f6e332

Browse files
committed
update sidebar background color and improve dark mode styles / colors
fix: email validation trigger in reply box
1 parent 102ba99 commit 1f6e332

File tree

4 files changed

+32
-43
lines changed

4 files changed

+32
-43
lines changed

frontend/src/assets/styles/main.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
}
6363
}
6464
:root {
65-
--sidebar-background: 0 0% 99%;
65+
--sidebar-background: 0 0% 100%;
6666
--sidebar-foreground: 240 5.9% 10%;
6767
--sidebar-primary: 240 5.9% 10%;
6868
--sidebar-primary-foreground: 0 0% 98%;
@@ -126,7 +126,7 @@
126126
}
127127

128128
.dark {
129-
--background: 240 10% 3.9%;
129+
--background: 240 5.9% 10%;
130130
--foreground: 0 0% 98%;
131131

132132
--card: 240 10% 3.9%;

frontend/src/features/conversation/ReplyBoxContent.vue

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,9 @@
2424
</TabsTrigger>
2525
</TabsList>
2626
</Tabs>
27-
<span
28-
class="text-muted-foreground hover:text-foreground transition-colors duration-200 cursor-pointer"
29-
variant="ghost"
30-
@click="toggleFullscreen"
31-
>
32-
<component
33-
:is="isFullscreen ? Minimize2 : Maximize2"
34-
:size="isFullscreen ? '18' : '15'"
35-
:class="{ 'mr-2': !isFullscreen, 'mr-1 mb-2': isFullscreen }"
36-
/>
37-
</span>
27+
<Button class="text-muted-foreground" variant="ghost" @click="toggleFullscreen">
28+
<component :is="isFullscreen ? Minimize2 : Maximize2" />
29+
</Button>
3830
</div>
3931

4032
<!-- To, CC, and BCC fields -->
@@ -43,13 +35,13 @@
4335
v-if="messageType === 'reply'"
4436
>
4537
<div class="flex items-center space-x-2">
46-
<label class="w-12 text-sm font-medium text-muted-foreground">To:</label>
38+
<label class="w-12 text-sm font-medium text-muted-foreground">TO:</label>
4739
<Input
4840
type="text"
4941
:placeholder="t('replyBox.emailAddresess')"
5042
v-model="to"
5143
class="flex-grow px-3 py-2 text-sm border rounded focus:ring-2 focus:ring-ring"
52-
@blur="validateEmails('to')"
44+
@blur="validateEmails"
5345
/>
5446
</div>
5547
<div class="flex items-center space-x-2">
@@ -59,7 +51,7 @@
5951
:placeholder="t('replyBox.emailAddresess')"
6052
v-model="cc"
6153
class="flex-grow px-3 py-2 text-sm border rounded focus:ring-2 focus:ring-ring"
62-
@blur="validateEmails('cc')"
54+
@blur="validateEmails"
6355
/>
6456
<Button
6557
size="sm"
@@ -76,7 +68,7 @@
7668
:placeholder="t('replyBox.emailAddresess')"
7769
v-model="bcc"
7870
class="flex-grow px-3 py-2 text-sm border rounded focus:ring-2 focus:ring-ring"
79-
@blur="validateEmails('bcc')"
71+
@blur="validateEmails"
8072
/>
8173
</div>
8274
</div>
@@ -221,9 +213,11 @@ const editorPlaceholder = t('replyBox.editor.placeholder')
221213
const toggleBcc = async () => {
222214
showBcc.value = !showBcc.value
223215
await nextTick()
224-
// If hiding BCC field, clear the content
216+
// If hiding BCC field, clear the content and validate email bcc so it doesn't show errors.
225217
if (!showBcc.value) {
226218
bcc.value = ''
219+
await nextTick()
220+
validateEmails()
227221
}
228222
}
229223
@@ -255,37 +249,32 @@ const enableSend = computed(() => {
255249
})
256250
257251
/**
258-
* Validate email addresses in the To, CC, and BCC fields
259-
* @param {string} field - 'to', 'cc', or 'bcc'
252+
* Validates email addresses in To, CC, and BCC fields.
253+
* Populates `emailErrors` with invalid emails grouped by field.
260254
*/
261-
const validateEmails = (field) => {
262-
const emails = field === 'to' ? to.value : field === 'cc' ? cc.value : bcc.value
263-
const emailList = emails
264-
.split(',')
265-
.map((e) => e.trim())
266-
.filter((e) => e !== '')
255+
const validateEmails = async () => {
256+
emailErrors.value = []
257+
await nextTick()
267258
268-
const invalidEmails = emailList.filter((email) => !validateEmail(email))
259+
const fields = ['to', 'cc', 'bcc']
260+
const values = { to: to.value, cc: cc.value, bcc: bcc.value }
269261
270-
// Clear existing errors
271-
emailErrors.value = []
262+
fields.forEach((field) => {
263+
const invalid = values[field]
264+
.split(',')
265+
.map((e) => e.trim())
266+
.filter((e) => e && !validateEmail(e))
272267
273-
// Add new error if there are invalid emails
274-
if (invalidEmails.length > 0) {
275-
emailErrors.value = [
276-
...emailErrors.value,
277-
`${t('replyBox.invalidEmailsIn')} '${field}': ${invalidEmails.join(', ')}`
278-
]
279-
}
268+
if (invalid.length)
269+
emailErrors.value.push(`${t('replyBox.invalidEmailsIn')} '${field}': ${invalid.join(', ')}`)
270+
})
280271
}
281272
282273
/**
283274
* Send the reply or private note
284275
*/
285276
const handleSend = async () => {
286-
validateEmails('to')
287-
validateEmails('cc')
288-
validateEmails('bcc')
277+
await validateEmails()
289278
if (emailErrors.value.length > 0) {
290279
emitter.emit(EMITTER_EVENTS.SHOW_TOAST, {
291280
variant: 'destructive',

frontend/src/features/conversation/list/ConversationListItem.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<div
3-
class="group relative p-4 transition-all duration-200 ease-in-out cursor-pointer hover:bg-accent/20 dark:hover:bg-accent/30"
3+
class="group relative px-4 p-4 transition-all duration-200 ease-in-out cursor-pointer hover:bg-accent/20 dark:hover:bg-accent/60"
44
:class="{
5-
'bg-accent/30 dark:bg-accent border-l-2': conversation.uuid === currentConversation?.uuid
5+
'bg-accent/60 border-l-4': conversation.uuid === currentConversation?.uuid
66
}"
77
@click="navigateToConversation(conversation.uuid)"
88
>
@@ -39,7 +39,7 @@
3939

4040
<!-- Message preview and unread count -->
4141
<div class="flex items-start justify-between gap-2">
42-
<div class="text-sm flex items-center gap-1.5 flex-1 break-all">
42+
<div class="text-sm flex items-center gap-1.5 flex-1 break-all text-gray-600 dark:text-gray-300">
4343
<Reply
4444
class="text-green-600 flex-shrink-0"
4545
size="15"

frontend/src/features/conversation/message/AgentMessageBubble.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'bg-[#FEF1E1] dark:bg-[#4C3A24]': message.private,
1818
'border border-border': !message.private,
1919
'opacity-50 animate-pulse': message.status === 'pending',
20-
'border-red-200': message.status === 'failed'
20+
'border-red-400': message.status === 'failed'
2121
}"
2222
>
2323
<!-- Message Envelope -->

0 commit comments

Comments
 (0)