Skip to content

Commit 56351ed

Browse files
style: improve empty state display for inbox and sent box (dreamhunter2333#831)
- Add different messages based on mail count (empty vs select) - Add semantic icons (InboxRound for inbox, SendRound for sent) - Unify list container height to min-height: 60vh; max-height: 100vh - Update CHANGELOG for v1.4.0 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9583f0e commit 56351ed

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
### Improvements
1616

17+
- style: |邮件列表| 优化收件箱和发件箱空状态显示,根据邮件数量显示不同提示信息,添加语义化图标
18+
1719
## v1.3.0
1820

1921
### Features

CHANGELOG_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
### Improvements
1616

17+
- style: |Mail List| Improve empty state display for inbox and sent box, show different messages based on mail count, add semantic icons
18+
1719
## v1.3.0
1820

1921
### Features

frontend/src/components/MailBox.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { watch, onMounted, ref, onBeforeUnmount, computed } from "vue";
33
import { useMessage } from 'naive-ui'
44
import { useI18n } from 'vue-i18n'
55
import { useGlobalState } from '../store'
6-
import { CloudDownloadRound, ArrowBackIosNewFilled, ArrowForwardIosFilled } from '@vicons/material'
6+
import { CloudDownloadRound, ArrowBackIosNewFilled, ArrowForwardIosFilled, InboxRound } from '@vicons/material'
77
import { useIsMobile } from '../utils/composables'
88
import { processItem } from '../utils/email-parser'
99
import { utcToLocalDate } from '../utils';
@@ -147,6 +147,7 @@ const { t } = useI18n({
147147
attachments: 'Show Attachments',
148148
downloadMail: 'Download Mail',
149149
pleaseSelectMail: "Please select mail",
150+
emptyInbox: "Your inbox is empty",
150151
delete: 'Delete',
151152
deleteMailTip: 'Are you sure you want to delete mail?',
152153
reply: 'Reply',
@@ -171,6 +172,7 @@ const { t } = useI18n({
171172
downloadMail: '下载邮件',
172173
attachments: '查看附件',
173174
pleaseSelectMail: "请选择邮件",
175+
emptyInbox: "收件箱为空",
174176
delete: '删除',
175177
deleteMailTip: '确定要删除邮件吗?',
176178
reply: '回复',
@@ -446,7 +448,7 @@ onBeforeUnmount(() => {
446448
<n-split class="left" direction="horizontal" :max="0.75" :min="0.25" :default-size="mailboxSplitSize"
447449
:on-update:size="onSpiltSizeChange">
448450
<template #1>
449-
<div style="overflow: auto; min-height: 50vh; max-height: 100vh;">
451+
<div style="overflow: auto; min-height: 60vh; max-height: 100vh;">
450452
<n-list hoverable clickable>
451453
<n-list-item v-for="row in data" v-bind:key="row.id" @click="() => clickRow(row)"
452454
:class="mailItemClass(row)">
@@ -506,7 +508,10 @@ onBeforeUnmount(() => {
506508
:onDelete="deleteMail" :onReply="replyMail" :onForward="forwardMail" :onSaveToS3="saveToS3Proxy" />
507509
</n-card>
508510
<n-card :bordered="false" embedded class="mail-item" v-else>
509-
<n-result status="info" :title="t('pleaseSelectMail')">
511+
<n-result status="info" :title="count === 0 ? t('emptyInbox') : t('pleaseSelectMail')">
512+
<template #icon>
513+
<n-icon :component="InboxRound" :size="100" />
514+
</template>
510515
</n-result>
511516
</n-card>
512517
</template>
@@ -531,7 +536,7 @@ onBeforeUnmount(() => {
531536
<n-input v-model:value="localFilterKeyword"
532537
:placeholder="t('keywordQueryTip')" size="small" clearable />
533538
</div>
534-
<div style="overflow: auto; height: 80vh;">
539+
<div style="overflow: auto; min-height: 60vh; max-height: 100vh;">
535540
<n-list hoverable clickable>
536541
<n-list-item v-for="row in data" v-bind:key="row.id" @click="() => clickRow(row)">
537542
<n-thing :title="row.subject">

frontend/src/components/SendBox.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n'
55
import { useGlobalState } from '../store'
66
import { useIsMobile } from '../utils/composables'
77
import { utcToLocalDate } from '../utils';
8+
import { SendRound } from '@vicons/material'
89
910
const message = useMessage()
1011
const isMobile = useIsMobile()
@@ -52,6 +53,7 @@ const { t } = useI18n({
5253
refresh: 'Refresh',
5354
showCode: 'Change View Original Code',
5455
pleaseSelectMail: "Please select a mail to view.",
56+
emptySent: "No sent emails",
5557
delete: 'Delete',
5658
deleteMailTip: 'Are you sure you want to delete mail?',
5759
multiAction: 'Multi Action',
@@ -64,6 +66,7 @@ const { t } = useI18n({
6466
refresh: '刷新',
6567
showCode: '切换查看元数据',
6668
pleaseSelectMail: "请选择一封邮件查看。",
69+
emptySent: "发件箱为空",
6770
delete: '删除',
6871
deleteMailTip: '确定要删除邮件吗?',
6972
multiAction: '多选',
@@ -239,7 +242,7 @@ onMounted(async () => {
239242
<n-split direction="horizontal" :max="0.75" :min="0.25" :default-size="mailboxSplitSize"
240243
:on-update:size="onSpiltSizeChange">
241244
<template #1>
242-
<div style="overflow: auto; height: 80vh;">
245+
<div style="overflow: auto; min-height: 60vh; max-height: 100vh;">
243246
<n-list hoverable clickable>
244247
<n-list-item v-for="row in data" v-bind:key="row.id" @click="() => clickRow(row)"
245248
:class="mailItemClass(row)">
@@ -297,7 +300,10 @@ onMounted(async () => {
297300
<div v-else v-html="curMail.content" style="margin-top: 10px;"></div>
298301
</n-card>
299302
<n-card :bordered="false" embedded class="mail-item" v-else>
300-
<n-result status="info" :title="t('pleaseSelectMail')">
303+
<n-result status="info" :title="count === 0 ? t('emptySent') : t('pleaseSelectMail')">
304+
<template #icon>
305+
<n-icon :component="SendRound" :size="100" />
306+
</template>
301307
</n-result>
302308
</n-card>
303309
</template>
@@ -312,7 +318,7 @@ onMounted(async () => {
312318
{{ t('refresh') }}
313319
</n-button>
314320
</div>
315-
<div style="overflow: auto; height: 80vh;">
321+
<div style="overflow: auto; min-height: 60vh; max-height: 100vh;">
316322
<n-list hoverable clickable>
317323
<n-list-item v-for="row in data" v-bind:key="row.id" @click="() => clickRow(row)">
318324
<n-thing :title="row.subject">

0 commit comments

Comments
 (0)