Skip to content

Commit 93de689

Browse files
sukvvonKevinVandy
andauthored
feat(landing/QueryLanding): drive the hero panel with a real QueryClient (#1142)
* fix(landing/QueryLanding): restore the live cache demo with a real 'useQuery' hero * refactor(landing/QueryLanding): drop comments the code already states * fix(landing/QueryLanding): tick the age readout and honor reduced motion changes * feat(landing/QueryLanding): select a cached row to inspect its state * fix(landing/QueryLanding): spell out the observer count instead of 'obs' * feat(landing/QueryLanding): drive the row gauge with cache freshness * feat(landing/QueryLanding): give each row its own cache entry and 'staleTime' * feat(landing/QueryLanding): badge each row's cache state and summarise the header * refactor(landing/QueryLanding): use 'useIsFetching' instead of tallying rows * feat(landing/QueryLanding): reject every third write so the rollback path runs * refactor(landing/QueryLanding): seed every row at 'P0' so bumps read as a count * fix(landing/QueryLanding): read the real observer count from the cache * feat(landing/QueryLanding): subscribe the detail pane to the selected key * Revert "feat(landing/QueryLanding): subscribe the detail pane to the selected key" This reverts commit 8f297ba. * fix(landing/QueryLanding): name the rolled-back values in the toast * refactor(landing/QueryLanding): drop type assertions in favor of declared types * fix(landing/QueryLanding): add 'fetchStatus' row to the detail pane * fix(landing/QueryLanding): align the row list and detail pane to the same baseline * refactor(landing/QueryLanding): drop layout classes that no longer affect the panel * fix(landing/QueryLanding): let the panel columns shrink below their content width * refactor(landing/QueryLanding): share the bump logic and drop redundant guards * fix(landing/QueryLanding): drain the freshness gauges at a constant rate * fix(landing/QueryLanding): refill the gauge instantly so it reaches full * fix(landing/QueryLanding): interpolate the gauges per frame and slow the drain * fix(landing/QueryLanding): sweep the gauge to its real freshness after a refetch * refactor(landing/QueryLanding): fold the gauge guards into one check * refactor(landing/QueryLanding): match the repo's arrow-function loop style * fix(landing/QueryLanding): sweep the gauge from its current position, not from empty * docs(landing/QueryLanding): note that any cache write sweeps the gauge * refactor(landing/QueryLanding): space the row 'staleTime' values evenly * refactor(landing/QueryLanding): keep the gauge sweep state in one ref * docs(landing/QueryLanding): move the row comment onto the values it describes * fix(landing/QueryLanding): drop the Refetch label so the controls stay on one row * fix(landing/QueryLanding): lighten the refetch border on hover --------- Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
1 parent 22f95f9 commit 93de689

2 files changed

Lines changed: 411 additions & 2 deletions

File tree

src/components/landing/LibraryLanding.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export type LibraryLandingConfig = {
6666
items: readonly LibraryLandingWorkbenchItem[]
6767
label: string
6868
}
69+
heroRender?: React.ReactNode
6970
libraryId: LibraryLandingId
7071
lifecycle: {
7172
body: string
@@ -189,7 +190,7 @@ export function LibraryLanding({ config }: { config: LibraryLandingConfig }) {
189190
<LibraryLandingShell
190191
description={config.description}
191192
headline={config.headline}
192-
hero={<LandingWorkbench config={config.hero} />}
193+
hero={config.heroRender ?? <LandingWorkbench config={config.hero} />}
193194
libraryId={config.libraryId}
194195
prompt={config.prompt}
195196
promptLabel={config.promptLabel}

0 commit comments

Comments
 (0)