feat(app): cache session-scoped stores, optional context gating

This commit is contained in:
Adam
2026-01-08 07:41:20 -06:00
parent c949e5b390
commit be9b2bab15
6 changed files with 469 additions and 231 deletions

View File

@@ -977,9 +977,18 @@ export default function Page() {
.join("")
.trim()
onCleanup(() => {
createEffect(() => {
if (!prompt.ready()) return
handoff.prompt = previewPrompt()
})
createEffect(() => {
if (!terminal.ready()) return
handoff.terminals = terminal.all().map((t) => t.title)
})
createEffect(() => {
if (!file.ready()) return
handoff.files = Object.fromEntries(
tabs()
.all()
@@ -989,6 +998,9 @@ export default function Page() {
return [[path, file.selectedLines(path) ?? null] as const]
}),
)
})
onCleanup(() => {
cancelTurnBackfill()
document.removeEventListener("keydown", handleKeyDown)
if (scrollSpyFrame !== undefined) cancelAnimationFrame(scrollSpyFrame)