mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-08 07:17:39 +00:00
fix: verify Cursor chat store before reopen (#1037)
* test: reproduce issue #841 * test: cover Cursor chat store discovery * fix: verify Cursor chat store before resume (closes #841) * test: preserve non-Cursor resume behavior * test: cover conservative Cursor resume gating * fix: gate Cursor reopen until store verification * test: cover legacy Cursor drawer fallback * fix: scan unique legacy Cursor store drawer * test: preserve raw Cursor workspace path hashing * fix: hash raw Cursor workspace path * test: pin Cursor probe owner and machine * fix: probe Cursor store on recorded owner * test: normalize Cursor probe owner home * fix: normalize Cursor probe owner home
This commit is contained in:
@@ -26,6 +26,7 @@ import { getSessionTitle } from '@/lib/sessionTitle'
|
||||
import type { Machine } from '@/types/api'
|
||||
import { getMachinePlatform, presentMachineHealth } from '@/lib/machineHealth'
|
||||
import { MachineGroupHeader } from '@/components/MachineGroupHeader'
|
||||
import { useCursorChatStoreStatus } from '@/hooks/queries/useCursorChatStoreStatus'
|
||||
|
||||
type SessionGroup = {
|
||||
key: string
|
||||
@@ -596,6 +597,22 @@ function SessionItem(props: {
|
||||
const [renameOpen, setRenameOpen] = useState(false)
|
||||
const [archiveOpen, setArchiveOpen] = useState(false)
|
||||
const [deleteOpen, setDeleteOpen] = useState(false)
|
||||
const {
|
||||
status: cursorChatStoreStatus,
|
||||
isApplicable: cursorChatStoreApplicable,
|
||||
error: cursorChatStoreError,
|
||||
} = useCursorChatStoreStatus({
|
||||
api,
|
||||
session: s,
|
||||
enabled: menuOpen
|
||||
})
|
||||
const cursorReopenDisabledReason = cursorChatStoreApplicable && cursorChatStoreStatus?.onDisk !== true
|
||||
? cursorChatStoreError
|
||||
? t('session.action.reopenCursorCheckFailed')
|
||||
: cursorChatStoreStatus?.onDisk === false
|
||||
? t('session.action.reopenCursorMissing')
|
||||
: t('session.action.reopenCursorChecking')
|
||||
: undefined
|
||||
|
||||
const { archiveSession, reopenSession, renameSession, deleteSession, isPending } = useSessionActions(
|
||||
api,
|
||||
@@ -732,7 +749,8 @@ function SessionItem(props: {
|
||||
sessionActive={s.active}
|
||||
onRename={() => setRenameOpen(true)}
|
||||
onArchive={() => setArchiveOpen(true)}
|
||||
onReopen={handleReopen}
|
||||
onReopen={cursorReopenDisabledReason ? undefined : handleReopen}
|
||||
reopenDisabledReason={cursorReopenDisabledReason}
|
||||
onDelete={() => setDeleteOpen(true)}
|
||||
anchorPoint={menuAnchorPoint}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user