chore: add v0.4.8 changelog and improve scroll behavior (#234)
* chore: add v0.4.8 changelog and improve scroll behavior - Add v0.4.8 changelog entries for recent fixes - Fix forced scroll to bottom when returning from other tabs - Smooth session switch with loading transition overlay - Auto-scroll to bottom after mermaid diagram rendering - Bump version to 0.4.8 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace blob URLs with persistent download URLs and add image preview - Replace blob URLs with /api/hermes/download URLs after upload so attachments survive page refresh - Add click-to-preview overlay for image attachments - Move upload directory from /tmp to ~/.hermes-web-ui/upload Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace findLast with reverse+find for ES2022 compat Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump TypeScript lib target from ES2022 to ES2023 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: add changelog entries for blob URL fix, image preview and upload dir Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { startRun, streamRunEvents, type ChatMessage, type RunEvent } from '@/api/hermes/chat'
|
||||
import { deleteSession as deleteSessionApi, fetchSession, fetchSessions, fetchSessionUsageSingle, type HermesMessage, type SessionSummary } from '@/api/hermes/sessions'
|
||||
import { getApiKey } from '@/api/client'
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, computed } from 'vue'
|
||||
import { useAppStore } from './app'
|
||||
@@ -797,7 +798,21 @@ export const useChatStore = defineStore('chat', () => {
|
||||
let inputText = content.trim()
|
||||
if (attachments && attachments.length > 0) {
|
||||
const uploaded = await uploadFiles(attachments)
|
||||
const pathParts = uploaded.map(f => `[File: ${f.name}](${f.path})`)
|
||||
// Replace blob URLs with persistent download URLs on the user message
|
||||
const token = getApiKey()
|
||||
const urlMap = new Map(uploaded.map(f => {
|
||||
const base = `/api/hermes/download?path=${encodeURIComponent(f.path)}&name=${encodeURIComponent(f.name)}`
|
||||
return [f.name, token ? `${base}&token=${encodeURIComponent(token)}` : base]
|
||||
}))
|
||||
const msgs = getSessionMsgs(sid)
|
||||
const lastUser = msgs.findLast(m => m.id === userMsg.id)
|
||||
if (lastUser?.attachments) {
|
||||
lastUser.attachments = lastUser.attachments.map(a => {
|
||||
const dl = urlMap.get(a.name)
|
||||
return dl ? { ...a, url: dl } : a
|
||||
})
|
||||
}
|
||||
const pathParts = uploaded.map(f => `[File: ${f.name}](${urlMap.get(f.name)})`)
|
||||
inputText = inputText ? inputText + '\n\n' + pathParts.join('\n') : pathParts.join('\n')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user