chore: bump version to 0.4.9 and remove session switch transition overlay (#235)

- Remove isTransitioning overlay that caused white screen on session switch
- Simplify scroll logic: just scrollToBottom() on session change
- Remove changelog entry for removed transition feature

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-26 13:59:01 +08:00
committed by GitHub
parent 0446385a37
commit c936585174
3 changed files with 7 additions and 65 deletions
@@ -11,8 +11,6 @@ const chatStore = useChatStore();
const { t } = useI18n();
const { isDark } = useTheme();
const listRef = ref<HTMLElement>();
const isTransitioning = ref(false);
let transitionTimer: ReturnType<typeof setTimeout> | null = null;
const displayMessages = computed(() =>
chatStore.messages.filter((m) => m.role !== "tool"),
@@ -56,61 +54,20 @@ function scrollToMessage(messageId: string) {
});
}
// Scroll to bottom once when messages are first loaded after session switch
let pendingScrollToBottom = false
let isInitialLoad = true
function showTransition(): void {
if (isInitialLoad) return
if (transitionTimer) clearTimeout(transitionTimer)
isTransitioning.value = true
}
function hideTransition(): void {
if (transitionTimer) clearTimeout(transitionTimer)
transitionTimer = setTimeout(() => {
isTransitioning.value = false
transitionTimer = null
}, 100)
}
// Scroll to bottom on session switch
watch(
() => chatStore.activeSessionId,
(id) => {
if (!id) return;
if (isInitialLoad) {
isInitialLoad = false
if (!chatStore.focusMessageId) {
nextTick(() => scrollToBottom())
} else {
nextTick(() => scrollToMessage(chatStore.focusMessageId!))
}
return;
}
if (chatStore.focusMessageId) {
nextTick(() => scrollToMessage(chatStore.focusMessageId!));
return;
}
pendingScrollToBottom = true
showTransition()
nextTick(() => scrollToBottom());
},
{ immediate: true },
);
// Safety: ensure overlay is always removed once messages load
watch(
() => chatStore.messages.length,
() => {
if (pendingScrollToBottom && chatStore.messages.length > 0) {
pendingScrollToBottom = false
setTimeout(() => {
scrollToBottom()
hideTransition()
}, 300)
}
},
);
watch(
() => chatStore.focusMessageId,
(messageId) => {
@@ -135,15 +92,6 @@ watch(
scrollToMessage(chatStore.focusMessageId);
return;
}
if (pendingScrollToBottom) {
pendingScrollToBottom = false
// Wait a moment for mermaid diagrams to render, then reveal and scroll
setTimeout(() => {
scrollToBottom()
hideTransition()
}, 300)
return
}
if (!isNearBottom()) return;
scrollToBottom();
},
@@ -159,8 +107,8 @@ watch(currentToolCalls, () => {
</script>
<template>
<div ref="listRef" class="message-list" :class="{ 'is-transitioning': isTransitioning }">
<div v-if="chatStore.messages.length === 0 && !isTransitioning" class="empty-state">
<div ref="listRef" class="message-list">
<div v-if="chatStore.messages.length === 0" class="empty-state">
<img src="/logo.png" alt="Hermes" class="empty-logo" />
<p>{{ t("chat.emptyState") }}</p>
</div>
@@ -228,16 +176,10 @@ watch(currentToolCalls, () => {
flex-direction: column;
gap: 16px;
background-color: $bg-card;
transition: opacity 0.15s ease;
.dark & {
background-color: #333333;
}
&.is-transitioning {
opacity: 0;
pointer-events: none;
}
}
.empty-state {