Skip to content

Commit 499d0ad

Browse files
committed
feat: add ai hint for smart replies
Signed-off-by: greta <gretadoci@gmail.com>
1 parent 999d405 commit 499d0ad

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/components/Message.vue

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@
5151
<div id="reply-composer" />
5252
<div class="reply-buttons">
5353
<div v-if="smartReplies.length > 0" class="reply-buttons__suggested">
54+
<NcPopover trigger="hover focus">
55+
<template #trigger>
56+
<NcButton
57+
variant="tertiary-no-background"
58+
:aria-label="t('mail', 'AI info')"
59+
class="button">
60+
<template #icon>
61+
<IconInfo :size="20" />
62+
</template>
63+
</NcButton>
64+
</template>
65+
<p class="smart-replies-info">
66+
{{ AiInfo }}
67+
</p>
68+
</NcPopover>
5469
<NcAssistantButton
5570
v-for="(reply, index) in smartReplies"
5671
:key="index"
@@ -75,8 +90,9 @@
7590

7691
<script>
7792
import { generateUrl } from '@nextcloud/router'
78-
import { NcAssistantButton, NcButton } from '@nextcloud/vue'
93+
import { NcAssistantButton, NcButton, NcPopover } from '@nextcloud/vue'
7994
import { mapStores } from 'pinia'
95+
import IconInfo from 'vue-material-design-icons/InformationOutline.vue'
8096
import LockOffIcon from 'vue-material-design-icons/LockOffOutline.vue'
8197
import ReplyIcon from 'vue-material-design-icons/ReplyOutline.vue'
8298
import Imip from './Imip.vue'
@@ -93,6 +109,7 @@ import { html, plain } from '../util/text.js'
93109
export default {
94110
name: 'Message',
95111
components: {
112+
IconInfo,
96113
Itinerary,
97114
MessageAttachments,
98115
MessageEncryptedBody,
@@ -103,6 +120,7 @@ export default {
103120
LockOffIcon,
104121
ReplyIcon,
105122
NcButton,
123+
NcPopover,
106124
NcAssistantButton,
107125
},
108126
@@ -135,6 +153,12 @@ export default {
135153
},
136154
},
137155
156+
data() {
157+
return {
158+
AiInfo: t('mail', 'Suggested replies are using AI'),
159+
}
160+
},
161+
138162
computed: {
139163
...mapStores(useMainStore),
140164
from() {
@@ -257,4 +281,7 @@ export default {
257281
}
258282
}
259283
}
284+
.smart-replies-info {
285+
padding: 16px;
286+
}
260287
</style>

0 commit comments

Comments
 (0)