feat(flow): session routing contract 정리

This commit is contained in:
2026-03-15 18:40:00 +09:00
parent cbeeb38413
commit 6a0710d023
6 changed files with 52 additions and 13 deletions

View File

@@ -39,6 +39,7 @@ import { FocusTopToast } from "./FocusTopToast";
export const SpaceWorkspaceWidget = () => {
const searchParams = useSearchParams();
const router = useRouter();
const resumeIntent = searchParams.get("resume");
const sceneQuery = searchParams.get("scene") ?? searchParams.get("room");
const goalQuery = searchParams.get("goal")?.trim() ?? "";
const focusPlanItemIdQuery = searchParams.get("planItemId");
@@ -222,6 +223,8 @@ export const SpaceWorkspaceWidget = () => {
workspaceMode === "setup" &&
showReviewTeaserAfterComplete &&
hasEnoughWeeklyData;
const allowsPausedReentry =
resumeIntent === "continue" || resumeIntent === "refocus";
const secondaryReviewTeaser = shouldShowSecondaryReviewTeaser
? {
title: isPro
@@ -242,6 +245,16 @@ export const SpaceWorkspaceWidget = () => {
}
}, [isBootstrapping, currentSession, hasQueryOverrides, router]);
useEffect(() => {
if (isBootstrapping || !currentSession) {
return;
}
if (currentSession.state === "paused" && !allowsPausedReentry) {
router.replace("/app");
}
}, [allowsPausedReentry, currentSession, isBootstrapping, router]);
useEffect(() => {
const preferMobile =
typeof window !== "undefined"