feat(app): /new-session route for new design (#31457)

This commit is contained in:
Brendan Allan
2026-06-10 11:35:50 +08:00
committed by GitHub
parent 6c6ed68b5a
commit 0fc33e2a06
15 changed files with 320 additions and 61 deletions
+3 -1
View File
@@ -10,7 +10,7 @@ import { useSync } from "@/context/sync"
import { decode64 } from "@/utils/base64"
import { Schema } from "effect"
function DirectoryDataProvider(props: ParentProps<{ directory: string }>) {
export function DirectoryDataProvider(props: ParentProps<{ directory: string; draftID?: string }>) {
const location = useLocation()
const navigate = useNavigate()
const params = useParams()
@@ -18,6 +18,8 @@ function DirectoryDataProvider(props: ParentProps<{ directory: string }>) {
const slug = createMemo(() => base64Encode(props.directory))
createEffect(() => {
// A draft lives at /new-session?draftId=… and has no directory segment to normalize.
if (props.draftID) return
const next = sync.data.path.directory
if (!next || next === props.directory) return
const path = location.pathname.slice(slug().length + 1)