fix: auto scroll and progress changes by ogzhanolguncu · Pull Request #5263 · unkeyed/unkey
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/apps/dashboard/components/virtual-table/hooks/useAutoScroll.ts`:
- Around line 22-36: The effect currently returns early when parentRef.current
is null and never re-runs because only the stable ref object is in deps; change
the effect to read const el = parentRef.current at the top and use that el value
in the dependency array (e.g. [enabled, el]) so the effect re-attaches when the
real DOM container appears, keep the same onScroll callback logic that updates
userScrolledUp.current (referencing SCROLL_THRESHOLD_PX and userScrolledUp), and
ensure the cleanup safely removes the listener only if el is non-null.
In `@web/apps/dashboard/components/virtual-table/index.tsx`:
- Around line 163-169: The auto-scroll is wired to historicData only, so new
streamed rows in realtimeData are ignored; call useTableData(realtimeData,
historicData) to get the rendered dataset (e.g., renderedData or tableData) and
pass that result into useAutoScroll's data prop (instead of historicData) so
useAutoScroll receives updates when realtimeData changes; update the
useAutoScroll invocation that currently passes data: historicData to use the
derived dataset returned by useTableData and keep other props (enabled:
autoScrollToBottom, parentRef, isLoading, expandedCount) unchanged.
In `@web/internal/ui/src/components/settings-card.tsx`:
- Line 170: The SettingCard currently forces a single-line ellipsized
description via the div with class "truncate", which hides long explanatory
copy; update the SettingCard component (the description rendering) to allow
multi-line wrapping and provide a recovery path: replace the hard truncate with
a multiline clamp (e.g., CSS line-clamp-2/3) or remove "truncate" so text can
wrap, and add a lightweight fallback such as a title attribute or a hover
tooltip/expand-on-click control that shows the full description when truncated;
ensure changes target the description div in the SettingCard so other usages
keep access to full content.