mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-08-01 16:43:37 +08:00
feat: sidebar click opens session in tab instead of replacing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e43a0baa08
commit
e3accc4068
@ -4,6 +4,8 @@ import { useUIStore } from '../../stores/uiStore'
|
|||||||
import { useTranslation } from '../../i18n'
|
import { useTranslation } from '../../i18n'
|
||||||
import { ProjectFilter } from './ProjectFilter'
|
import { ProjectFilter } from './ProjectFilter'
|
||||||
import type { SessionListItem } from '../../types/session'
|
import type { SessionListItem } from '../../types/session'
|
||||||
|
import { useTabStore } from '../../stores/tabStore'
|
||||||
|
import { useChatStore } from '../../stores/chatStore'
|
||||||
|
|
||||||
const isTauri = typeof window !== 'undefined' && ('__TAURI_INTERNALS__' in window || '__TAURI__' in window)
|
const isTauri = typeof window !== 'undefined' && ('__TAURI_INTERNALS__' in window || '__TAURI__' in window)
|
||||||
|
|
||||||
@ -205,7 +207,11 @@ export function Sidebar() {
|
|||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
onClick={() => { setActiveView('code'); setActiveSession(session.id) }}
|
onClick={() => {
|
||||||
|
setActiveView('code')
|
||||||
|
useTabStore.getState().openTab(session.id, session.title)
|
||||||
|
useChatStore.getState().connectToSession(session.id)
|
||||||
|
}}
|
||||||
onContextMenu={(e) => handleContextMenu(e, session.id)}
|
onContextMenu={(e) => handleContextMenu(e, session.id)}
|
||||||
className={`
|
className={`
|
||||||
w-full flex items-center gap-2 pl-4 pr-3 py-1.5 text-sm text-left rounded-[var(--radius-md)] transition-colors duration-200 group
|
w-full flex items-center gap-2 pl-4 pr-3 py-1.5 text-sm text-left rounded-[var(--radius-md)] transition-colors duration-200 group
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user