From c094d23fbe30404a777900b453d768ec6a8fd823 Mon Sep 17 00:00:00 2001 From: Zach Dunn Date: Fri, 11 Sep 2026 20:52:56 -0400 Subject: [PATCH] refactor(web): factor a shared createIslandMounter for manual hydration The read-seed -> teardown-on-swap -> lazy-import -> hydrateRoot lifecycle was hand-written in five places (both signed-in layouts and the files, screenshots, and admin workspaces pages). Extract it into react-island.ts as createIslandMounter and have every site call it, so the mount contract lives in one place. Behavior is unchanged. --- apps/web/src/layouts/AccountLayout.astro | 45 ++---------- apps/web/src/layouts/AdminLayout.astro | 39 ++--------- apps/web/src/lib/react-island.ts | 68 +++++++++++++++++++ .../account/workspaces/[name]/files.astro | 58 +++------------- .../workspaces/[name]/screenshots.astro | 57 +++------------- apps/web/src/pages/admin/index.astro | 49 ++----------- 6 files changed, 106 insertions(+), 210 deletions(-) diff --git a/apps/web/src/layouts/AccountLayout.astro b/apps/web/src/layouts/AccountLayout.astro index 3772de75..c9829598 100644 --- a/apps/web/src/layouts/AccountLayout.astro +++ b/apps/web/src/layouts/AccountLayout.astro @@ -229,47 +229,16 @@ const sidebarSeedJson = JSON.stringify(sidebarProps).replace(/