thread-view: очевидная визуализация раскрытого треда
- Вертикальная accent-линия слева соединяет заголовок с дочерними письмами - Заголовок раскрытого треда: accent-тинт фон + accent border - Дочерние письма со сдвигом вправо освобождают место под линию - Анимация раскрытия: fade + slide-down (Transition) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dd04f1f6bd
commit
2fb444eeb5
2 changed files with 86 additions and 24 deletions
|
|
@ -280,7 +280,7 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
|
|||
</div>
|
||||
|
||||
<template v-for="thread in threads" :key="thread.id">
|
||||
<!-- Одно письмо в треде — показываем MessageListItem напрямую -->
|
||||
<!-- Одно письмо — напрямую, без обёртки -->
|
||||
<MessageListItem
|
||||
v-if="thread.messages.length === 1"
|
||||
:message="thread.messages[0]"
|
||||
|
|
@ -294,31 +294,37 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
|
|||
@swipe-action="(action) => handleSwipeAction(action, thread.messages[0].id)"
|
||||
/>
|
||||
|
||||
<!-- Несколько писем — заголовок треда + раскрываемые сообщения -->
|
||||
<template v-else>
|
||||
<!-- Несколько писем — группа с вертикальной линией при раскрытии -->
|
||||
<div
|
||||
v-else
|
||||
class="thread-group"
|
||||
:class="{ 'thread-group--open': expandedThreadIds.has(thread.id) }"
|
||||
>
|
||||
<ThreadListItem
|
||||
:thread="thread"
|
||||
:expanded="expandedThreadIds.has(thread.id)"
|
||||
:selected="thread.messages.some(m => messagesStore.selectedMessageId === m.id)"
|
||||
@click="toggleThread(thread)"
|
||||
/>
|
||||
<template v-if="expandedThreadIds.has(thread.id)">
|
||||
<MessageListItem
|
||||
v-for="msg in thread.messages"
|
||||
:key="msg.id"
|
||||
:message="msg"
|
||||
:selected="messagesStore.selectedMessageId === msg.id"
|
||||
:checked="messagesStore.selectedIds.has(msg.id)"
|
||||
:select-mode="selectMode"
|
||||
:swipe-left-action="settingsStore.swipeLeftAction"
|
||||
:swipe-right-action="settingsStore.swipeRightAction"
|
||||
class="thread-child-item"
|
||||
@click="messagesStore.selectMessage(msg.id)"
|
||||
@toggle-select="messagesStore.toggleSelect(msg.id)"
|
||||
@swipe-action="(action) => handleSwipeAction(action, msg.id)"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
<Transition name="thread-expand">
|
||||
<div v-if="expandedThreadIds.has(thread.id)" class="thread-children">
|
||||
<MessageListItem
|
||||
v-for="msg in thread.messages"
|
||||
:key="msg.id"
|
||||
:message="msg"
|
||||
:selected="messagesStore.selectedMessageId === msg.id"
|
||||
:checked="messagesStore.selectedIds.has(msg.id)"
|
||||
:select-mode="selectMode"
|
||||
:swipe-left-action="settingsStore.swipeLeftAction"
|
||||
:swipe-right-action="settingsStore.swipeRightAction"
|
||||
class="thread-child-item"
|
||||
@click="messagesStore.selectMessage(msg.id)"
|
||||
@toggle-select="messagesStore.toggleSelect(msg.id)"
|
||||
@swipe-action="(action) => handleSwipeAction(action, msg.id)"
|
||||
/>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div v-if="messagesStore.loading" class="loading-more">
|
||||
|
|
@ -748,9 +754,37 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
|
|||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* Дочерние письма раскрытого треда */
|
||||
/* ── Группа треда ───────────────────────────────────────── */
|
||||
.thread-group {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Вертикальная accent-линия — появляется только когда тред открыт */
|
||||
.thread-group--open::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 13px;
|
||||
top: 46px; /* ниже заголовка треда */
|
||||
bottom: 8px;
|
||||
width: 2px;
|
||||
border-radius: 2px;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
var(--accent),
|
||||
color-mix(in srgb, var(--accent) 30%, transparent)
|
||||
);
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Контейнер дочерних писем */
|
||||
.thread-children {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Дочерние письма — отступ, чтобы освободить место для линии */
|
||||
:deep(.thread-child-item) {
|
||||
margin-left: 12px;
|
||||
margin-left: 20px;
|
||||
margin-top: 0;
|
||||
border-radius: 0;
|
||||
border-top-color: transparent;
|
||||
|
|
@ -759,5 +793,22 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
|
|||
:deep(.thread-child-item:last-child) {
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
/* ── Анимация раскрытия ─────────────────────────────────── */
|
||||
.thread-expand-enter-active {
|
||||
transition: opacity 180ms ease, transform 220ms cubic-bezier(0.34, 1.1, 0.64, 1);
|
||||
}
|
||||
.thread-expand-leave-active {
|
||||
transition: opacity 140ms ease, transform 160ms ease;
|
||||
}
|
||||
.thread-expand-enter-from {
|
||||
opacity: 0;
|
||||
transform: translateY(-6px);
|
||||
}
|
||||
.thread-expand-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -276,10 +276,21 @@ const snippet = computed(() => props.thread.latest.snippet || '')
|
|||
color: var(--accent);
|
||||
}
|
||||
|
||||
/* Раскрытый тред — убираем нижний border-radius чтобы слиться с дочерними письмами */
|
||||
/* Раскрытый тред */
|
||||
.thread-card.expanded {
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-color: transparent;
|
||||
border-color: color-mix(in srgb, var(--accent) 30%, rgba(255,255,255,0.08));
|
||||
border-bottom-color: color-mix(in srgb, var(--accent) 15%, transparent);
|
||||
background:
|
||||
linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent) 0%, transparent 100%),
|
||||
rgba(255, 255, 255, 0.04);
|
||||
box-shadow:
|
||||
inset 0 1px 0 color-mix(in srgb, var(--accent) 20%, rgba(255,255,255,0.08)),
|
||||
0 2px 12px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.thread-card.expanded .thread-item {
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue