diff --git a/web/src/components/MemoEditor/MemoEditor.tsx b/web/src/components/MemoEditor/MemoEditor.tsx
index 032deef07..e67c72fc7 100644
--- a/web/src/components/MemoEditor/MemoEditor.tsx
+++ b/web/src/components/MemoEditor/MemoEditor.tsx
@@ -162,8 +162,14 @@ const MemoEditorDraft = ({ draft, ...editing }: MemoEditorDraftProps) => {
const identity: MemoEditIdentity = draft.parent
? { kind: "comment", parent: draft.parent }
: { kind: "new", scope: draft.scope ?? "default", space: draft.space };
+ // While the session's code loads, a still of the empty composer: the same frame, the
+ // placeholder line and the toolbar's height, so the page below does not move when the
+ // session takes its place.
const fallback = editing.frameless ? null : (
-
+
+
{editing.placeholder ?? " "}
+
+
);
return (
diff --git a/web/src/components/MemoEditor/README.md b/web/src/components/MemoEditor/README.md
index eaa8c5b76..2c8ca39b9 100644
--- a/web/src/components/MemoEditor/README.md
+++ b/web/src/components/MemoEditor/README.md
@@ -61,7 +61,7 @@ Hosts of a new top-level memo pass `useMemoSuggestions()` into `suggestions`; ed
- **Inline** (Home, panels): the session brings its own frame. The + menu offers focus mode, which expands it over the page; the exit button minimizes it back.
- **Hosted** (`onFocusModeExit`): a host presents the session full-screen and owns that frame (`contexts/GlobalMemoEditorContext.tsx`). It mounts straight into focus mode and exits by calling back to dismiss the host.
-The session's code is a chunk of its own, loaded when a memo is first edited or composed, and renders without suspending once loaded; a host that knows an editor is coming calls `preloadMemoEditing()`.
+The session's code is a chunk of its own, loaded when a memo is first edited or composed, and renders without suspending once loaded. A host that knows an editor is coming calls `preloadMemoEditing()`: the router loads it with the Home page for a signed-in user, so the composer renders with the page, and the comment section loads it while the pointer is on its button. Until it is loaded a new draft shows a still of the empty composer, the same frame, placeholder line and toolbar height, so nothing moves when the session takes its place.
### Destination and visibility
diff --git a/web/src/router/index.tsx b/web/src/router/index.tsx
index ff2433ea9..e3466e345 100644
--- a/web/src/router/index.tsx
+++ b/web/src/router/index.tsx
@@ -1,6 +1,7 @@
import { createBrowserRouter, Navigate, type RouteObject, useLocation } from "react-router-dom";
import App from "@/App";
import { ChunkLoadErrorFallback } from "@/components/ErrorBoundary";
+import { preloadMemoEditing } from "@/components/MemoEditor";
import { useAuth } from "@/contexts/AuthContext";
import useCurrentUser from "@/hooks/useCurrentUser";
import MainLayout from "@/layouts/MainLayout";
@@ -18,6 +19,9 @@ const AuthCallback = lazyWithReload(() => import("@/pages/AuthCallback"));
const MemoMap = lazyWithReload(() => import("@/pages/Map"));
const Calendar = lazyWithReload(() => import("@/pages/Calendar"));
const Home = lazyWithReload(() => import("@/pages/Home"));
+// A signed-in user's Home composes at once, so the page's code arrives together with the
+// editing session's and the composer renders with the page, never after it.
+const ComposingHome = lazyWithReload(() => Promise.all([import("@/pages/Home"), preloadMemoEditing()]).then(([page]) => page));
const Inboxes = lazyWithReload(() => import("@/pages/Inboxes"));
const MemoDetail = lazyWithReload(() => import("@/pages/MemoDetail"));
const NotFound = lazyWithReload(() => import("@/pages/NotFound"));
@@ -36,14 +40,15 @@ const HomeRoute = () => {
if (!currentUser && !getCollectionCreator(location.search)) {
return ;
}
- return ;
+ return currentUser ? : ;
};
const ExploreRoute = () => {
+ const currentUser = useCurrentUser();
const location = useLocation();
const search = withCollectionCreator(location.search);
if (search !== location.search) return ;
- return ;
+ return currentUser ? : ;
};
// Backward compatibility alias.