fix: preserve cockpit steps across view toggles and show full step info
Backend: stop wiping pending_task_lane when AI response has no new [ACTIONS]/[QUESTIONS] markers — previous task lane state is still relevant until replaced by new markers. Frontend (selectChat): don't eagerly clear task lane before server response arrives; restore from sessionStorage as fallback when pending_task_lane is null (covers sessions before backend fix). StepsPanel: show description and command for all steps instead of hiding behind hover/active-only visibility. Commands render as inline code blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -168,9 +168,7 @@ export function useAssistantSession() {
|
||||
const selectChat = useCallback(async (chatId: string) => {
|
||||
currentChatRef.current = chatId
|
||||
setActiveChatId(chatId)
|
||||
setShowTaskLane(false)
|
||||
setActiveQuestions([])
|
||||
setActiveActions([])
|
||||
// Don't clear task lane yet — wait for server response to decide
|
||||
try {
|
||||
const detail = await aiSessionsApi.getSession(chatId)
|
||||
if (currentChatRef.current !== chatId) return
|
||||
@@ -188,7 +186,7 @@ export function useAssistantSession() {
|
||||
triage_hypothesis: detail.triage_hypothesis ?? null,
|
||||
evidence_items: detail.evidence_items ?? null,
|
||||
})
|
||||
// Restore task lane from persisted state
|
||||
// Restore task lane from server state
|
||||
if (detail.pending_task_lane) {
|
||||
const q = detail.pending_task_lane.questions || []
|
||||
const a = detail.pending_task_lane.actions || []
|
||||
@@ -202,10 +200,35 @@ export function useAssistantSession() {
|
||||
setActiveQuestions(q)
|
||||
setActiveActions(a)
|
||||
setShowTaskLane(true)
|
||||
return
|
||||
}
|
||||
}
|
||||
// Fallback: restore from sessionStorage (covers view toggles before backend fix)
|
||||
try {
|
||||
const saved = sessionStorage.getItem('rf-tasklane-meta')
|
||||
if (saved) {
|
||||
const d = JSON.parse(saved)
|
||||
if (d.chatId === chatId) {
|
||||
const q = d.questions || []
|
||||
const a = d.actions || []
|
||||
if (q.length > 0 || a.length > 0) {
|
||||
setActiveQuestions(q)
|
||||
setActiveActions(a)
|
||||
setShowTaskLane(d.show === true)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch { /* ignore */ }
|
||||
// No task lane data from either source — clear
|
||||
setShowTaskLane(false)
|
||||
setActiveQuestions([])
|
||||
setActiveActions([])
|
||||
} catch {
|
||||
setMessages([])
|
||||
setShowTaskLane(false)
|
||||
setActiveQuestions([])
|
||||
setActiveActions([])
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user