fix session links profile filtering (#979)

This commit is contained in:
ekko
2026-05-24 19:30:32 +08:00
committed by GitHub
parent acdf18793c
commit 6763721545
11 changed files with 13 additions and 23 deletions
@@ -61,11 +61,9 @@ let mobileQuery: MediaQueryList | null = null;
const isMobile = ref(false);
function sessionHref(sessionId: string) {
const profile = sessionProfile(sessionId);
return router.resolve({
name: "hermes.session",
params: { sessionId },
query: profile ? { profile } : undefined,
}).href;
}
@@ -75,11 +73,9 @@ function openSessionInNewTab(sessionId: string) {
}
async function handleSessionClick(sessionId: string) {
const session = chatStore.sessions.find((item) => item.id === sessionId);
await router.push({
name: "hermes.session",
params: { sessionId },
query: session?.profile ? { profile: session.profile } : undefined,
});
if (mobileQuery?.matches) showSessions.value = false;
}
@@ -283,7 +279,6 @@ async function confirmNewChat() {
await router.push({
name: "hermes.session",
params: { sessionId: session.id },
query: session.profile ? { profile: session.profile } : undefined,
});
showNewChatModal.value = false;
}
+1 -1
View File
@@ -273,7 +273,7 @@ export default {
monitorRoleUser: 'Benutzer',
monitorRoleAssistant: 'Assistent',
copySessionLink: 'Sitzungslink kopieren',
openSessionInNewTab: 'Open in new tab',
openSessionInNewTab: 'In neuem Tab öffnen',
sessionLinkCopied: 'Session link copied',
copySessionId: 'Sitzungs-ID kopieren',
export: 'Exportieren',
+1 -1
View File
@@ -273,7 +273,7 @@ export default {
monitorRoleUser: 'Usuario',
monitorRoleAssistant: 'Asistente',
copySessionLink: 'Copiar enlace de sesión',
openSessionInNewTab: 'Open in new tab',
openSessionInNewTab: 'Abrir en una nueva pestaña',
sessionLinkCopied: 'Session link copied',
copySessionId: 'Copiar ID de sesión',
export: 'Exportar',
+1 -1
View File
@@ -273,7 +273,7 @@ export default {
monitorRoleUser: 'Utilisateur',
monitorRoleAssistant: 'Assistant',
copySessionLink: 'Copier le lien de session',
openSessionInNewTab: 'Open in new tab',
openSessionInNewTab: 'Ouvrir dans un nouvel onglet',
sessionLinkCopied: 'Session link copied',
copySessionId: "Copier l'ID de session",
export: 'Exporter',
+1 -1
View File
@@ -273,7 +273,7 @@ export default {
monitorRoleUser: 'ユーザー',
monitorRoleAssistant: 'アシスタント',
copySessionLink: 'セッションリンクをコピー',
openSessionInNewTab: 'Open in new tab',
openSessionInNewTab: '新しいタブで開く',
sessionLinkCopied: 'Session link copied',
copySessionId: 'セッション ID をコピー',
export: 'エクスポート',
+1 -1
View File
@@ -273,7 +273,7 @@ export default {
monitorRoleUser: '사용자',
monitorRoleAssistant: '어시스턴트',
copySessionLink: '세션 링크 복사',
openSessionInNewTab: 'Open in new tab',
openSessionInNewTab: '새 탭에서 열기',
sessionLinkCopied: 'Session link copied',
copySessionId: '세션 ID 복사',
export: '내보내기',
+1 -1
View File
@@ -273,7 +273,7 @@ export default {
monitorRoleUser: 'Usuário',
monitorRoleAssistant: 'Assistente',
copySessionLink: 'Copiar link da sessão',
openSessionInNewTab: 'Open in new tab',
openSessionInNewTab: 'Abrir em nova aba',
sessionLinkCopied: 'Session link copied',
copySessionId: 'Copiar ID da sessão',
export: 'Exportar',
+1 -1
View File
@@ -287,7 +287,7 @@ export default {
monitorRoleUser: '使用者',
monitorRoleAssistant: '助手',
copySessionLink: '複製工作階段連結',
openSessionInNewTab: 'Open in new tab',
openSessionInNewTab: '在新分頁開啟',
sessionLinkCopied: 'Session link copied',
copySessionId: '複製工作階段 ID',
export: '匯出',
+1 -1
View File
@@ -289,7 +289,7 @@ export default {
monitorRoleUser: '用户',
monitorRoleAssistant: '助手',
copySessionLink: '复制会话链接',
openSessionInNewTab: 'Open in new tab',
openSessionInNewTab: '在新标签页打开',
sessionLinkCopied: 'Session link copied',
copySessionId: '复制会话 ID',
export: '导出',
@@ -25,7 +25,7 @@ const routeProfile = computed(() => {
})
async function loadRouteSession() {
await chatStore.loadSessions(routeProfile.value, routeSessionId.value)
await chatStore.loadSessions(chatStore.sessionProfileFilter, routeSessionId.value)
if (routeSessionId.value && chatStore.activeSessionId !== routeSessionId.value) {
await router.replace({ name: 'hermes.chat' })
}
@@ -45,19 +45,14 @@ onMounted(async () => {
watch([routeSessionId, routeProfile], async ([sessionId]) => {
if (!chatStore.sessionsLoaded) return
if (!sessionId) {
await chatStore.loadSessions(routeProfile.value)
return
}
if (chatStore.activeSessionId === sessionId && (!routeProfile.value || chatStore.activeSession?.profile === routeProfile.value)) return
if (routeProfile.value) {
await loadRouteSession()
await chatStore.loadSessions(chatStore.sessionProfileFilter)
return
}
if (chatStore.activeSessionId === sessionId) return
const exists = chatStore.sessions.some(session => session.id === sessionId)
if (!exists) {
await router.replace({ name: 'hermes.chat' })
await loadRouteSession()
return
}
+1 -1
View File
@@ -32,6 +32,6 @@ test('session rows expose native session links', async ({ page }) => {
await page.goto('/#/hermes/chat')
const sessionLink = page.locator('.session-items a.session-item').first()
await expect(sessionLink).toHaveAttribute('href', '#/hermes/session/session-native-1?profile=research')
await expect(sessionLink).toHaveAttribute('href', '#/hermes/session/session-native-1')
await expect(sessionLink).toContainText('Native Link Session')
})