refactor(tui): replace v2 sync with data context (#31826)

This commit is contained in:
Dax
2026-06-10 23:34:35 -04:00
committed by GitHub
parent 69623c2b79
commit 47a45601fd
16 changed files with 1113 additions and 2380 deletions
@@ -7,8 +7,7 @@ import {
type ParentProps,
type Setter,
} from "solid-js"
import { useSync } from "../../context/sync"
import { useTuiPaths } from "../../context/runtime"
import { useData } from "../../context/data"
export type HomeSessionDestination = { type: "directory"; directory: string; subdirectory: boolean } | { type: "new" }
@@ -21,11 +20,10 @@ type Context = {
const HomeSessionDestinationContext = createContext<Context>()
export function HomeSessionDestinationProvider(props: ParentProps) {
const sync = useSync()
const paths = useTuiPaths()
const data = useData()
const [selected, setDestination] = createSignal<HomeSessionDestination>()
const destination = createMemo<HomeSessionDestination>(
() => selected() ?? { type: "directory", directory: sync.path.directory || paths.cwd, subdirectory: false },
() => selected() ?? { type: "directory", directory: data.location.default().directory, subdirectory: false },
)
return (
<HomeSessionDestinationContext.Provider