fix virtual message list scrolling (#1089)

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
ekko
2026-05-28 15:22:18 +08:00
committed by GitHub
parent d610c3d1b9
commit 9d2e82cd06
6 changed files with 103 additions and 30 deletions
@@ -42,6 +42,7 @@ const hermesSessionsLoaded = ref(false)
const historySessionId = ref<string | null>(null)
const historySession = ref<Session | null>(null)
const showOutline = ref(false)
const historyMessageListRef = ref<InstanceType<typeof HistoryMessageList> | null>(null)
const isBatchMode = ref(false)
const isBatchDeleting = ref(false)
const showBatchDeleteConfirm = ref(false)
@@ -52,6 +53,10 @@ const contextMenuX = ref(0)
const contextMenuY = ref(0)
let hermesSessionsRequestId = 0
function handleOutlineNavigate(target: { messageId: string; anchorId: string }) {
historyMessageListRef.value?.scrollToAnchor(target.messageId, target.anchorId)
}
async function loadHermesSessions() {
const requestId = ++hermesSessionsRequestId
hermesSessionsLoading.value = true
@@ -759,9 +764,13 @@ function handleBatchDeleteConfirm() {
<div class="history-content-wrapper">
<div class="history-main-content">
<HistoryMessageList :session="historySession" />
<HistoryMessageList ref="historyMessageListRef" :session="historySession" />
</div>
<OutlinePanel v-if="showOutline && historySession" :messages="historySession.messages || []" />
<OutlinePanel
v-if="showOutline && historySession"
:messages="historySession.messages || []"
@navigate="handleOutlineNavigate"
/>
</div>
</div>
</div>