From dac65914ed36efbeaacd5366429c7cffa97dac8c Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Tue, 28 Apr 2026 11:29:28 +0100 Subject: [PATCH] chore(base): drop pre-virtualizer-fix scroll-jump workarounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two pieces of code added under the wrong height-mismatch theory of the inline-embed scroll jump are no longer load-bearing now that the real cause (virtual-core's _willUpdate calling _scrollToOffset(NaN)) is fixed by the initialOffset seed in grid-container.tsx: - BaseTableSkeleton's `rows` prop, whose only consumer was the "creating database" placeholder passing rows=0 to "match" the eventual empty-base height. Reverted to a fixed 10-row skeleton. - The Database slash command's React Query cache prefill of ["bases", id] and ["base-rows", id, …] (~30 lines), which existed to skip BaseTable's own loading skeleton on swap. The create endpoint return type is back to { id }. The placeholder approach (pendingKey + setNodeMarkup patch) stays — that's what gives the user visible state during the create request, unrelated to the scroll jump. --- .../base/components/base-table-skeleton.tsx | 16 ++----- .../components/base-embed/base-embed-view.tsx | 11 ++--- .../components/slash-menu/menu-items.ts | 46 ++----------------- 3 files changed, 10 insertions(+), 63 deletions(-) diff --git a/apps/client/src/features/base/components/base-table-skeleton.tsx b/apps/client/src/features/base/components/base-table-skeleton.tsx index 287789d5b..dfcae12fc 100644 --- a/apps/client/src/features/base/components/base-table-skeleton.tsx +++ b/apps/client/src/features/base/components/base-table-skeleton.tsx @@ -5,24 +5,14 @@ import classes from "@/features/base/styles/base-table-skeleton.module.css"; const ROW_NUMBER_WIDTH = 64; const COLUMN_WIDTH = 180; const COLUMN_COUNT = 6; -const DEFAULT_ROW_COUNT = 10; +const ROW_COUNT = 10; // Deterministic per-cell widths so the skeleton doesn't flicker between // renders. Values are rough normal distribution around 55-85 % of cell. const CELL_WIDTH_RATIOS = [0.78, 0.62, 0.84, 0.55, 0.71, 0.66]; const HEADER_WIDTH_RATIOS = [0.42, 0.58, 0.5, 0.64, 0.46, 0.54]; -type BaseTableSkeletonProps = { - // Override the body row count. Pass 0 when rendering as the - // "creating database" placeholder for a freshly-inserted inline embed - // — the eventual empty base has no rows, so a 10-row skeleton would - // shrink ~330px on swap and trip the browser's scrollY clamp. - rows?: number; -}; - -export function BaseTableSkeleton({ - rows = DEFAULT_ROW_COUNT, -}: BaseTableSkeletonProps = {}) { +export function BaseTableSkeleton() { const gridTemplateColumns = [ `${ROW_NUMBER_WIDTH}px`, ...Array.from({ length: COLUMN_COUNT }, () => `${COLUMN_WIDTH}px`), @@ -64,7 +54,7 @@ export function BaseTableSkeleton({ ))} - {Array.from({ length: rows }).map((_, rowIndex) => ( + {Array.from({ length: ROW_COUNT }).map((_, rowIndex) => (