From a8b45b724ad89e90b145dd19a883c1169d80fbd3 Mon Sep 17 00:00:00 2001 From: Mahad Kalam Date: Sun, 19 Apr 2026 13:47:15 +0100 Subject: [PATCH 1/6] Don't show skeleton on SSR! --- app/javascript/pages/Home/SignedIn.svelte | 110 +++++++++++------- .../svelte/dist/components/App.svelte | 4 + 2 files changed, 74 insertions(+), 40 deletions(-) diff --git a/app/javascript/pages/Home/SignedIn.svelte b/app/javascript/pages/Home/SignedIn.svelte index dc51c6e12..0f85aeb70 100644 --- a/app/javascript/pages/Home/SignedIn.svelte +++ b/app/javascript/pages/Home/SignedIn.svelte @@ -133,48 +133,78 @@ {/if} - - {#snippet fallback()} -
-
- -
- - + {#if dashboard_stats} +
+ +
+ {#if dashboard_stats.today_stats} + + {/if}
- {/snippet} - - {#snippet children({ reloading })} -
- -
- {#if dashboard_stats?.today_stats} - - {/if} + + + {#if dashboard_stats.filterable_dashboard_data} + + {/if} + + + {#if dashboard_stats.activity_graph} + + {/if} +
+ {:else} + + {#snippet fallback()} +
+
+ +
+ +
+ {/snippet} - - {#if dashboard_stats?.filterable_dashboard_data} - - {/if} + {#snippet children({ reloading })} +
+
+ {#if dashboard_stats?.today_stats} + + {/if} +
- - {#if dashboard_stats?.activity_graph} - - {/if} -
- {/snippet} -
+ {#if dashboard_stats?.filterable_dashboard_data} + + {/if} + + {#if dashboard_stats?.activity_graph} + + {/if} +
+ {/snippet} + + {/if}
diff --git a/vendor/inertia/packages/svelte/dist/components/App.svelte b/vendor/inertia/packages/svelte/dist/components/App.svelte index 65db5213d..13edce85b 100644 --- a/vendor/inertia/packages/svelte/dist/components/App.svelte +++ b/vendor/inertia/packages/svelte/dist/components/App.svelte @@ -35,6 +35,10 @@ let page = $state({ ...initialPage, flash: initialPage.flash ?? {} }) let renderProps = $derived.by(() => resolveRenderProps(component, page, key)) + // Populate the global page store before the initial render so SSR can + // resolve Deferred/WhenVisible content against the actual page props. + setPage(page) + // Reactively update the global page state when local page state changes $effect.pre(() => { setPage(page) From 2cce6821a9268f50731f5e83fe3f867d0b767b9f Mon Sep 17 00:00:00 2001 From: Mahad Kalam Date: Sun, 19 Apr 2026 13:52:58 +0100 Subject: [PATCH 2/6] goog --- app/javascript/pages/Home/SignedIn.svelte | 70 +++++++++++------------ 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/app/javascript/pages/Home/SignedIn.svelte b/app/javascript/pages/Home/SignedIn.svelte index 0f85aeb70..f502c3872 100644 --- a/app/javascript/pages/Home/SignedIn.svelte +++ b/app/javascript/pages/Home/SignedIn.svelte @@ -1,5 +1,6 @@
` tag. Useful for bindings. */ + export let element = undefined; +@@ -179,8 +184,8 @@ + * Prefix these with `_` to keep things organized + */ + const _percentRange = writable(percentRange); +- const _containerWidth = writable(containerWidth); +- const _containerHeight = writable(containerHeight); ++ const _containerWidth = writable(resolvedContainerWidth); ++ const _containerHeight = writable(resolvedContainerHeight); + const _extents = writable(filterObject(extents)); + const _data = writable(data); + const _flatData = writable(flatData || data); +@@ -221,8 +226,8 @@ + const _custom = writable(custom); + + $: $_percentRange = percentRange; +- $: $_containerWidth = containerWidth; +- $: $_containerHeight = containerHeight; ++ $: $_containerWidth = resolvedContainerWidth; ++ $: $_containerHeight = resolvedContainerHeight; + $: $_extents = filterObject(extents); + $: $_data = data; + $: $_flatData = flatData || data; +@@ -540,8 +545,8 @@ + style:bottom={position === 'absolute' ? '0' : null} + style:left={position === 'absolute' ? '0' : null} + style:pointer-events={pointerEvents === false ? 'none' : null} +- bind:clientWidth={containerWidth} +- bind:clientHeight={containerHeight} ++ bind:clientWidth={measuredContainerWidth} ++ bind:clientHeight={measuredContainerHeight} + > + Date: Sun, 19 Apr 2026 23:20:44 +0100 Subject: [PATCH 6/6] clanker fucks up, as usual --- Dockerfile | 1 + Dockerfile.dev | 1 + 2 files changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index e05f017c0..7aad1b82c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,6 +48,7 @@ RUN apt-get update -qq && \ # Install npm dependencies for Vite. Vendored Inertia packages must exist # before `bun i` because they are referenced via local file dependencies. COPY package.json bun.lock ./ +COPY patches patches COPY vendor/inertia vendor/inertia RUN bun i diff --git a/Dockerfile.dev b/Dockerfile.dev index 34df3ea42..78ce68d37 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -28,6 +28,7 @@ WORKDIR /app # Install npm dependencies for Vite. Vendored Inertia packages must exist # before `bun install` because they are referenced via local file dependencies. COPY package.json bun.lock ./ +COPY patches patches COPY vendor/inertia vendor/inertia RUN bun install