feat: replace all emoji/unicode icons with thin-stroke SVG icons

Adds AppIcon.vue component with Lucide-style 24x24 viewBox icons
(inbox, sent, drafts, trash, spam, archive, folder, chevron, settings,
plus, flag, attachment, envelope, refresh). All components updated to
use AppIcon instead of HTML entities and emoji glyphs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
vodyanoysh 2026-03-31 21:43:01 +07:00
parent ccdec7f9c1
commit d3966ba788
9 changed files with 172 additions and 49 deletions

View file

@ -0,0 +1,110 @@
<script setup lang="ts">
export type IconName =
| 'inbox'
| 'sent'
| 'drafts'
| 'trash'
| 'spam'
| 'archive'
| 'folder'
| 'chevron-right'
| 'settings'
| 'plus'
| 'flag'
| 'attachment'
| 'envelope'
| 'refresh'
const props = defineProps<{
name: IconName
size?: number
}>()
const size = props.size ?? 16
// All paths use 24×24 viewBox, stroke="currentColor",
// stroke-width="2", stroke-linecap="round", stroke-linejoin="round", fill="none"
const paths: Record<IconName, string> = {
inbox: `
<polyline points="22 13 16 13 14 16 10 16 8 13 2 13"/>
<path d="M5.45 5.11 2 13v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-7.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>
`,
sent: `
<line x1="22" y1="2" x2="11" y2="13"/>
<polygon points="22 2 15 22 11 13 2 9 22 2"/>
`,
drafts: `
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>
`,
trash: `
<polyline points="3 6 5 6 21 6"/>
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
<line x1="10" y1="11" x2="10" y2="17"/>
<line x1="14" y1="11" x2="14" y2="17"/>
`,
spam: `
<path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>
<line x1="12" y1="9" x2="12" y2="13"/>
<line x1="12" y1="17" x2="12.01" y2="17"/>
`,
archive: `
<polyline points="21 8 21 21 3 21 3 8"/>
<rect x="1" y="3" width="22" height="5"/>
<line x1="10" y1="12" x2="14" y2="12"/>
`,
folder: `
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>
`,
'chevron-right': `
<polyline points="9 18 15 12 9 6"/>
`,
settings: `
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/>
<circle cx="12" cy="12" r="3"/>
`,
plus: `
<line x1="12" y1="5" x2="12" y2="19"/>
<line x1="5" y1="12" x2="19" y2="12"/>
`,
flag: `
<path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/>
<line x1="4" y1="22" x2="4" y2="15"/>
`,
attachment: `
<path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/>
`,
envelope: `
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>
<polyline points="22,6 12,13 2,6"/>
`,
refresh: `
<polyline points="23 4 23 10 17 10"/>
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>
`,
}
</script>
<template>
<svg
:width="size"
:height="size"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
class="app-icon"
aria-hidden="true"
v-html="paths[name]"
/>
</template>
<style scoped>
.app-icon {
display: inline-block;
flex-shrink: 0;
vertical-align: middle;
}
</style>

View file

@ -6,6 +6,7 @@ import FolderTree from '../sidebar/FolderTree.vue'
import MessageList from '../messages/MessageList.vue'
import MessagePreview from '../preview/MessagePreview.vue'
import AddAccountDialog from '../accounts/AddAccountDialog.vue'
import AppIcon from '../AppIcon.vue'
import { useAccountsStore } from '../../stores/accounts.store'
const accountsStore = useAccountsStore()
@ -84,7 +85,9 @@ function stopResize(): void {
<!-- Пустое состояние: нет аккаунтов -->
<div v-if="accountsStore.accounts.length === 0 && !accountsStore.loading && !showAddAccount" class="empty-state">
<div class="empty-content">
<div class="empty-icon">&#9993;</div>
<div class="empty-icon">
<AppIcon name="envelope" :size="52" />
</div>
<h2>Добро пожаловать в Vue Mail</h2>
<p>Добавьте почтовый аккаунт для начала работы</p>
<button class="add-btn" @click="onAddAccount">
@ -208,10 +211,9 @@ function stopResize(): void {
}
.empty-icon {
font-size: 52px;
margin-bottom: 20px;
opacity: 0.25;
filter: grayscale(1);
opacity: 0.22;
color: var(--text-muted);
}
.empty-content h2 {

View file

@ -5,6 +5,7 @@ import { useFoldersStore } from '../../stores/folders.store'
import { useAccountsStore } from '../../stores/accounts.store'
import { useSettingsStore, type SwipeAction } from '../../stores/settings.store'
import MessageListItem from './MessageListItem.vue'
import AppIcon from '../AppIcon.vue'
const messagesStore = useMessagesStore()
const foldersStore = useFoldersStore()
@ -91,7 +92,7 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
title="Обновить"
@click="refresh"
>
&#8635;
<AppIcon name="refresh" :size="14" />
</button>
</div>
</div>
@ -100,13 +101,13 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
<div v-if="selectMode && hasSelected" class="bulk-actions">
<span class="bulk-count">Выбрано: {{ messagesStore.selectedIds.size }}</span>
<button class="bulk-btn" @click="messagesStore.markSelectedAsRead()">
&#10003; Прочитать
<AppIcon name="envelope" :size="11" /> Прочитать
</button>
<button class="bulk-btn" @click="messagesStore.flagSelected()">
&#9873; Флажок
<AppIcon name="flag" :size="11" /> Флажок
</button>
<button class="bulk-btn danger" @click="messagesStore.deleteSelected()">
&#128465; Удалить
<AppIcon name="trash" :size="11" /> Удалить
</button>
<button class="bulk-btn" @click="exitSelectMode">Отмена</button>
</div>

View file

@ -3,6 +3,7 @@ import { ref, computed, onMounted, onUnmounted } from 'vue'
import type { MessageEnvelope } from '@shared/types/message'
import { formatMessageDate } from '../../utils/date'
import { SWIPE_ACTION_INFO, type SwipeAction } from '../../stores/settings.store'
import AppIcon from '../AppIcon.vue'
const props = defineProps<{
message: MessageEnvelope
@ -237,7 +238,9 @@ onUnmounted(() => {
class="action-bg action-left"
:style="{ background: leftColor, opacity: progress }"
>
<span class="action-icon" :class="{ confirmed }">{{ leftIcon }}</span>
<span class="action-icon" :class="{ confirmed }">
<AppIcon v-if="leftIcon" :name="(leftIcon as any)" :size="18" />
</span>
</div>
<!-- Reveal: right side (swipe-left action) -->
@ -246,7 +249,9 @@ onUnmounted(() => {
class="action-bg action-right"
:style="{ background: rightColor, opacity: progress }"
>
<span class="action-icon" :class="{ confirmed }">{{ rightIcon }}</span>
<span class="action-icon" :class="{ confirmed }">
<AppIcon v-if="rightIcon" :name="(rightIcon as any)" :size="18" />
</span>
</div>
<!-- Message row — pointer handlers here, NO @click handler -->
@ -292,8 +297,8 @@ onUnmounted(() => {
</div>
<div class="message-indicators">
<span v-if="isFlagged" class="flag-icon">&#9873;</span>
<span v-if="message.hasAttachments" class="attachment-icon">&#128206;</span>
<AppIcon v-if="isFlagged" name="flag" :size="12" class="flag-icon" />
<AppIcon v-if="message.hasAttachments" name="attachment" :size="12" class="attachment-icon" />
</div>
</div>
@ -317,7 +322,13 @@ onUnmounted(() => {
.action-left { justify-content: flex-start; padding-left: 18px; }
.action-right { justify-content: flex-end; padding-right: 18px; }
.action-icon { font-size: 17px; transition: transform 0.15s ease; }
.action-icon {
display: flex;
align-items: center;
justify-content: center;
color: #fff;
transition: transform 0.15s ease;
}
.action-icon.confirmed { transform: scale(1.3); }
.message-item {
@ -413,6 +424,6 @@ onUnmounted(() => {
align-items: center; gap: 4px;
flex-shrink: 0; padding-top: 2px;
}
.flag-icon { font-size: 12px; color: var(--warning); }
.attachment-icon { font-size: 12px; color: var(--text-muted); }
.flag-icon { color: var(--warning); }
.attachment-icon { color: var(--text-muted); }
</style>

View file

@ -2,6 +2,7 @@
import { computed } from 'vue'
import type { MessageEnvelope } from '@shared/types/message'
import { formatFullDate } from '../../utils/date'
import AppIcon from '../AppIcon.vue'
const props = defineProps<{
message: MessageEnvelope
@ -46,10 +47,10 @@ const dateDisplay = computed(() => formatFullDate(props.message.date))
</div>
<div class="header-badges">
<span v-if="message.hasAttachments" class="badge">
&#128206; Вложения
<AppIcon name="attachment" :size="11" /> Вложения
</span>
<span v-if="message.flags.flagged" class="badge flagged">
&#9873; Отмечено
<AppIcon name="flag" :size="11" /> Отмечено
</span>
</div>
</div>

View file

@ -3,6 +3,7 @@ import { computed } from 'vue'
import { useMessagesStore } from '../../stores/messages.store'
import MessageHeader from './MessageHeader.vue'
import MessageBody from './MessageBody.vue'
import AppIcon from '../AppIcon.vue'
const messagesStore = useMessagesStore()
@ -14,7 +15,9 @@ const selectedMessage = computed(() =>
<template>
<div class="message-preview">
<div v-if="!selectedMessage" class="no-selection">
<div class="no-selection-icon">&#9993;</div>
<div class="no-selection-icon">
<AppIcon name="envelope" :size="48" />
</div>
<span>Выберите письмо для чтения</span>
</div>
@ -52,9 +55,8 @@ const selectedMessage = computed(() =>
}
.no-selection-icon {
font-size: 48px;
opacity: 0.18;
filter: grayscale(1);
color: var(--text-muted);
}
.loading-body {

View file

@ -1,6 +1,7 @@
<script setup lang="ts">
import { useAccountsStore } from '../../stores/accounts.store'
import { useRouter } from 'vue-router'
import AppIcon from '../AppIcon.vue'
const emit = defineEmits<{
addAccount: []
@ -40,11 +41,11 @@ function getAccountColor(index: number): string {
<div class="spacer" />
<button class="account-btn add-btn" title="Добавить аккаунт" @click="emit('addAccount')">
<span class="add-icon">+</span>
<AppIcon name="plus" :size="16" class="add-icon" />
</button>
<button class="account-btn settings-btn" title="Настройки" @click="router.push('/settings')">
<span class="settings-icon">&#9881;</span>
<AppIcon name="settings" :size="15" class="settings-icon" />
</button>
</div>
</template>
@ -104,16 +105,10 @@ function getAccountColor(index: number): string {
}
.add-icon {
font-size: 20px;
color: var(--text-muted);
font-weight: 300;
line-height: 1;
}
.add-icon,
.settings-icon {
font-size: 15px;
color: var(--text-muted);
transition: color var(--transition-fast);
}
.add-btn:hover .add-icon,

View file

@ -3,6 +3,8 @@ import { ref, computed } from 'vue'
import type { Folder } from '@shared/types/folder'
import { SpecialFolderRole } from '@shared/types/folder'
import { useFoldersStore } from '../../stores/folders.store'
import AppIcon from '../AppIcon.vue'
import type { IconName } from '../AppIcon.vue'
const props = defineProps<{
folder: Folder
@ -15,15 +17,15 @@ const expanded = ref(true)
const isActive = computed(() => foldersStore.activeFolderId === props.folder.id)
const hasChildren = computed(() => props.folder.children.length > 0)
const folderIcon = computed(() => {
const folderIcon = computed((): IconName => {
switch (props.folder.role) {
case SpecialFolderRole.Inbox: return '&#128229;'
case SpecialFolderRole.Sent: return '&#128228;'
case SpecialFolderRole.Drafts: return '&#128221;'
case SpecialFolderRole.Trash: return '&#128465;'
case SpecialFolderRole.Spam: return '&#9888;'
case SpecialFolderRole.Archive: return '&#128451;'
default: return '&#128193;'
case SpecialFolderRole.Inbox: return 'inbox'
case SpecialFolderRole.Sent: return 'sent'
case SpecialFolderRole.Drafts: return 'drafts'
case SpecialFolderRole.Trash: return 'trash'
case SpecialFolderRole.Spam: return 'spam'
case SpecialFolderRole.Archive: return 'archive'
default: return 'folder'
}
})
@ -48,13 +50,14 @@ function toggleExpand(event: Event): void {
<button
v-if="hasChildren"
class="expand-btn"
:class="{ rotated: expanded }"
@click="toggleExpand"
>
<span :class="{ rotated: expanded }">&#9656;</span>
<AppIcon name="chevron-right" :size="12" />
</button>
<span v-else class="expand-spacer" />
<span class="folder-icon" v-html="folderIcon" />
<AppIcon :name="folderIcon" :size="14" class="folder-icon" />
<span class="folder-name truncate">{{ folder.name }}</span>
<span v-if="folder.unreadCount > 0" class="unread-badge">
{{ folder.unreadCount }}
@ -120,14 +123,12 @@ function toggleExpand(event: Event): void {
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
color: var(--text-muted);
flex-shrink: 0;
transition: transform var(--transition-fast);
}
.expand-btn span.rotated {
display: inline-block;
.expand-btn.rotated {
transform: rotate(90deg);
}
@ -137,10 +138,10 @@ function toggleExpand(event: Event): void {
}
.folder-icon {
font-size: 14px;
flex-shrink: 0;
width: 18px;
text-align: center;
color: var(--text-muted);
opacity: 0.75;
}
.folder-name {

View file

@ -11,10 +11,10 @@ export const SWIPE_ACTION_LABELS: Record<SwipeAction, string> = {
}
export const SWIPE_ACTION_INFO: Record<SwipeAction, { icon: string; color: string }> = {
delete: { icon: '🗑', color: 'var(--danger)' },
toggleRead: { icon: '✉', color: 'var(--accent)' },
toggleFlag: { icon: '⚑', color: 'var(--warning)' },
none: { icon: '', color: 'transparent' }
delete: { icon: 'trash', color: 'var(--danger)' },
toggleRead: { icon: 'envelope', color: 'var(--accent)' },
toggleFlag: { icon: 'flag', color: 'var(--warning)' },
none: { icon: '', color: 'transparent' }
}
// ─── Accent color ────────────────────────────────────────