refactor(app): rename global context files to server context files (#28790)

This commit is contained in:
Brendan Allan
2026-05-25 09:01:02 +08:00
committed by GitHub
parent c5c9a1d435
commit eab34b46d0
56 changed files with 338 additions and 338 deletions
+8 -8
View File
@@ -34,7 +34,7 @@ import { useLocation, useSearchParams } from "@solidjs/router"
import { NewSessionDesignView, NewSessionView, SessionHeader } from "@/components/session"
import { useComments } from "@/context/comments"
import { getSessionPrefetch, SESSION_PREFETCH_TTL } from "@/context/global-sync/session-prefetch"
import { useGlobalSync } from "@/context/global-sync"
import { useServerSync } from "@/context/server-sync"
import { useLanguage } from "@/context/language"
import { useLayout } from "@/context/layout"
import { usePrompt } from "@/context/prompt"
@@ -182,7 +182,7 @@ function createSessionHistoryLoader(input: SessionHistoryWindowInput) {
}
export default function Page() {
const globalSync = useGlobalSync()
const serverSync = useServerSync()
const layout = useLayout()
const local = useLocal()
const file = useFile()
@@ -560,11 +560,11 @@ export default function Page() {
}
function upsert(next: Project) {
const list = globalSync.data.project
const list = serverSync.data.project
sync.set("project", next.id)
const idx = list.findIndex((item) => item.id === next.id)
if (idx >= 0) {
globalSync.set(
serverSync.set(
"project",
list.map((item, i) => (i === idx ? { ...item, ...next } : item)),
)
@@ -572,10 +572,10 @@ export default function Page() {
}
const at = list.findIndex((item) => item.id > next.id)
if (at >= 0) {
globalSync.set("project", [...list.slice(0, at), next, ...list.slice(at)])
serverSync.set("project", [...list.slice(0, at), next, ...list.slice(at)])
return
}
globalSync.set("project", [...list, next])
serverSync.set("project", [...list, next])
}
const gitMutation = useMutation(() => ({
@@ -673,7 +673,7 @@ export default function Page() {
todoTimer = undefined
if (!id) return
if (status === "idle" && !blocked) return
const cached = untrack(() => sync.data.todo[id] !== undefined || globalSync.data.session_todo[id] !== undefined)
const cached = untrack(() => sync.data.todo[id] !== undefined || serverSync.data.session_todo[id] !== undefined)
todoFrame = requestAnimationFrame(() => {
todoFrame = undefined
@@ -1386,7 +1386,7 @@ export default function Page() {
const ok = await sendFollowupDraft({
client: sdk.client,
sync,
globalSync,
serverSync,
draft: item,
optimisticBusy: item.sessionDirectory === sdk.directory,
}).catch((err) => {