Backup before continuing from Codex 5.2 session - User storage, compaction suggestions, streaming improvements
This commit is contained in:
@@ -29,6 +29,7 @@ const TOOL_CALL_CACHE_SCOPE = "tool-call"
|
||||
const TOOL_SCROLL_SENTINEL_MARGIN_PX = 48
|
||||
const TOOL_SCROLL_INTENT_WINDOW_MS = 600
|
||||
const TOOL_SCROLL_INTENT_KEYS = new Set(["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " ", "Spacebar"])
|
||||
const FILE_CHANGE_EVENT = "opencode:workspace-files-changed"
|
||||
|
||||
function makeRenderCacheKey(
|
||||
toolCallId?: string | null,
|
||||
@@ -304,6 +305,7 @@ export default function ToolCall(props: ToolCallProps) {
|
||||
let toolCallRootRef: HTMLDivElement | undefined
|
||||
let scrollContainerRef: HTMLDivElement | undefined
|
||||
let detachScrollIntentListeners: (() => void) | undefined
|
||||
let lastFileEventKey = ""
|
||||
|
||||
let pendingScrollFrame: number | null = null
|
||||
let pendingAnchorScroll: number | null = null
|
||||
@@ -493,6 +495,19 @@ export default function ToolCall(props: ToolCallProps) {
|
||||
})
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
const state = toolState()
|
||||
if (!state || state.status !== "completed") return
|
||||
const tool = toolName()
|
||||
if (!["write", "edit", "patch"].includes(tool)) return
|
||||
const key = `${toolCallIdentifier()}:${tool}:${state.status}`
|
||||
if (key === lastFileEventKey) return
|
||||
lastFileEventKey = key
|
||||
if (typeof window !== "undefined") {
|
||||
window.dispatchEvent(new CustomEvent(FILE_CHANGE_EVENT, { detail: { instanceId: props.instanceId } }))
|
||||
}
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
const activeKey = activePermissionKey()
|
||||
if (!activeKey) return
|
||||
|
||||
Reference in New Issue
Block a user