From d5c898e2c52b7adde30e6e630fefda7d802f34d5 Mon Sep 17 00:00:00 2001 From: Drew Davis Date: Sat, 21 Nov 2026 09:29:35 -0500 Subject: [PATCH 1/7] chore(app): place key before spread props --- packages/app/package.json | 2 +- packages/app/src/NamespaceDetailsSidePanel.tsx | 2 +- packages/app/src/NodeDetailsSidePanel.tsx | 2 +- packages/app/src/PodDetailsSidePanel.tsx | 2 +- packages/app/src/components/DBRowOverviewPanel.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 043a656733..5ca77c29e5 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -14,7 +14,7 @@ "build:clickhouse": "NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js", "run:clickhouse": "test -d out && npx rimraf tmp && mkdir tmp && cp -r out tmp/clickstack && echo 'visit http://localhost:3000/clickstack to start' && npx serve tmp -l 3000 || echo 'run build:clickhouse first'", "start": "next start", - "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 569 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", + "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 565 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", "lint:fix": "yarn run -T oxlint --fix && yarn run -T oxfmt '**/*.{ts,tsx,css,scss}'", "lint:styles": "stylelint **/*/*.{css,scss}", "ci:lint": "yarn lint && yarn tsc --noEmit && yarn lint:styles --quiet", diff --git a/packages/app/src/NamespaceDetailsSidePanel.tsx b/packages/app/src/NamespaceDetailsSidePanel.tsx index 5dbb278bd6..106b56edd2 100644 --- a/packages/app/src/NamespaceDetailsSidePanel.tsx +++ b/packages/app/src/NamespaceDetailsSidePanel.tsx @@ -430,8 +430,8 @@ export default function NamespaceDetailsSidePanel(props: { return ( diff --git a/packages/app/src/NodeDetailsSidePanel.tsx b/packages/app/src/NodeDetailsSidePanel.tsx index 20ab1ff272..2bea8c3ab0 100644 --- a/packages/app/src/NodeDetailsSidePanel.tsx +++ b/packages/app/src/NodeDetailsSidePanel.tsx @@ -443,8 +443,8 @@ export default function NodeDetailsSidePanel(props: { return ( diff --git a/packages/app/src/PodDetailsSidePanel.tsx b/packages/app/src/PodDetailsSidePanel.tsx index f0ec35707c..d2ed6a73fd 100644 --- a/packages/app/src/PodDetailsSidePanel.tsx +++ b/packages/app/src/PodDetailsSidePanel.tsx @@ -472,8 +472,8 @@ export default function PodDetailsSidePanel(props: { return ( diff --git a/packages/app/src/components/DBRowOverviewPanel.tsx b/packages/app/src/components/DBRowOverviewPanel.tsx index e4cf559f50..01d9f76684 100644 --- a/packages/app/src/components/DBRowOverviewPanel.tsx +++ b/packages/app/src/components/DBRowOverviewPanel.tsx @@ -498,6 +498,7 @@ export function RowOverviewPanel({ {Object.entries(resourceAttributes).map(([key, value]) => ( ))} From 7742859180f6e9d7fee23ae90c71548fd68743b2 Mon Sep 17 00:00:00 2001 From: Drew Davis Date: Sat, 21 Nov 2026 09:31:12 -0500 Subject: [PATCH 2/7] chore(app): name useState setters consistently and use lazy initial state --- packages/app/package.json | 2 +- packages/app/src/DBSearchPage.tsx | 4 +-- packages/app/src/DOMPlayer.tsx | 4 +-- packages/app/src/KubernetesDashboardPage.tsx | 2 -- .../ServicesDashboardPage.tsx | 2 +- packages/app/src/SessionSubpanel.tsx | 30 +++++++++---------- .../app/src/components/ContextSidePanel.tsx | 2 +- packages/app/src/components/DBDeltaChart.tsx | 6 ++-- .../src/components/DBSearchPageFilters.tsx | 6 ++-- .../DBSearchPageFilters/NestedFilterGroup.tsx | 4 +-- packages/app/src/components/DBTimeChart.tsx | 2 +- .../src/components/DBTraceWaterfallChart.tsx | 4 ++- .../SearchInput/AutocompleteInput.tsx | 12 ++++---- .../VirtualMultiSelect.stories.tsx | 4 +-- packages/app/src/dashboard.ts | 8 ++--- packages/app/src/hooks/useMetadata.tsx | 2 +- packages/app/src/timeQuery.ts | 6 ++-- packages/app/src/utils.ts | 2 +- 18 files changed, 50 insertions(+), 52 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 5ca77c29e5..e0a4c94b07 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -14,7 +14,7 @@ "build:clickhouse": "NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js", "run:clickhouse": "test -d out && npx rimraf tmp && mkdir tmp && cp -r out tmp/clickstack && echo 'visit http://localhost:3000/clickstack to start' && npx serve tmp -l 3000 || echo 'run build:clickhouse first'", "start": "next start", - "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 565 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", + "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 545 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", "lint:fix": "yarn run -T oxlint --fix && yarn run -T oxfmt '**/*.{ts,tsx,css,scss}'", "lint:styles": "stylelint **/*/*.{css,scss}", "ci:lint": "yarn lint && yarn tsc --noEmit && yarn lint:styles --quiet", diff --git a/packages/app/src/DBSearchPage.tsx b/packages/app/src/DBSearchPage.tsx index 668f59584e..f0b6e9548a 100644 --- a/packages/app/src/DBSearchPage.tsx +++ b/packages/app/src/DBSearchPage.tsx @@ -2325,7 +2325,7 @@ function DBSearchPageContent() { setNewSourceModalOpened(true); }, []); - const [isDrawerChildModalOpen, setDrawerChildModalOpen] = useState(false); + const [isDrawerChildModalOpen, setIsDrawerChildModalOpen] = useState(false); const rowTableContext = useMemo( () => ({ @@ -2335,7 +2335,7 @@ function DBSearchPageContent() { generateSearchUrl, dbSqlRowTableConfig, isChildModalOpen: isDrawerChildModalOpen, - setChildModalOpen: setDrawerChildModalOpen, + setChildModalOpen: setIsDrawerChildModalOpen, source: searchedSource, }), [ diff --git a/packages/app/src/DOMPlayer.tsx b/packages/app/src/DOMPlayer.tsx index 993dd52488..e22ce4b92d 100644 --- a/packages/app/src/DOMPlayer.tsx +++ b/packages/app/src/DOMPlayer.tsx @@ -143,9 +143,9 @@ export default function DOMPlayer({ const initialEventsRef = useRef([]); const lastEventTsLoadedRef = useRef(0); - const [lastEventTsLoaded, _setLastEventTsLoaded] = useState(0); + const [lastEventTsLoaded, setLastEventTsLoaded] = useState(0); const setLastEventTsLoadedRef = useRef( - throttle(_setLastEventTsLoaded, 100, { leading: true, trailing: true }), + throttle(setLastEventTsLoaded, 100, { leading: true, trailing: true }), ); const [isInitialEventsLoaded, setIsInitialEventsLoaded] = useState(false); const [isReplayFullyLoaded, setIsReplayFullyLoaded] = useState(false); diff --git a/packages/app/src/KubernetesDashboardPage.tsx b/packages/app/src/KubernetesDashboardPage.tsx index 274a05dd73..c61a45b872 100644 --- a/packages/app/src/KubernetesDashboardPage.tsx +++ b/packages/app/src/KubernetesDashboardPage.tsx @@ -1223,8 +1223,6 @@ function KubernetesDashboardPage() { const whereClause = searchQuery; - const [_searchQuery, _setSearchQuery] = React.useState(null); - const { data: logSourceJsonColumns, isLoading: isLoadingJsonColumns } = useJsonColumns( logSource && { diff --git a/packages/app/src/ServicesDashboardPage/ServicesDashboardPage.tsx b/packages/app/src/ServicesDashboardPage/ServicesDashboardPage.tsx index 59ab354435..6111aa1ec9 100644 --- a/packages/app/src/ServicesDashboardPage/ServicesDashboardPage.tsx +++ b/packages/app/src/ServicesDashboardPage/ServicesDashboardPage.tsx @@ -278,7 +278,7 @@ function ServicesDashboardPage() { }); // For future use if Live button is added - const [isLive, _setIsLive] = useState(false); + const isLive = false; const { manualRefreshCooloff, refresh } = useDashboardRefresh({ searchedTimeRange, diff --git a/packages/app/src/SessionSubpanel.tsx b/packages/app/src/SessionSubpanel.tsx index 6aa64ca489..917bdfa5fa 100644 --- a/packages/app/src/SessionSubpanel.tsx +++ b/packages/app/src/SessionSubpanel.tsx @@ -244,9 +244,7 @@ export default function SessionSubpanel({ ); const prevTsQuery = usePrevious(tsQuery); - const [focus, _setFocus] = useState< - { ts: number; setBy: string } | undefined - >( + const [focus, setFocus] = useState<{ ts: number; setBy: string } | undefined>( initialTs != null ? { ts: initialTs, @@ -257,7 +255,7 @@ export default function SessionSubpanel({ useEffect(() => { if (prevTsQuery == null && tsQuery != null) { - _setFocus({ ts: tsQuery, setBy: 'url' }); + setFocus({ ts: tsQuery, setBy: 'url' }); } }, [prevTsQuery, tsQuery]); @@ -273,16 +271,16 @@ export default function SessionSubpanel({ }; }, [setTsQuery]); - const setFocus = useCallback( + const updateFocus = useCallback( (focus: { ts: number; setBy: string }) => { if (focus.setBy === 'player') { debouncedSetTsQuery(focus.ts); } else { setTsQuery(focus.ts); } - _setFocus(focus); + setFocus(focus); }, - [_setFocus, setTsQuery, debouncedSetTsQuery], + [setFocus, setTsQuery, debouncedSetTsQuery], ); const [playerState, setPlayerState] = useState<'paused' | 'playing'>( 'paused', @@ -400,18 +398,18 @@ export default function SessionSubpanel({ }, [setPlayerState]); const skipBackward = useCallback(() => { - setFocus({ + updateFocus({ ts: Math.max((focus?.ts ?? minTs) - 15000, minTs), setBy: 'skip-backward', }); - }, [setFocus, focus?.ts, minTs]); + }, [updateFocus, focus?.ts, minTs]); const skipForward = useCallback(() => { - setFocus({ + updateFocus({ ts: Math.min((focus?.ts ?? minTs) + 15000, maxTs), setBy: 'skip-forward', }); - }, [setFocus, focus?.ts, minTs, maxTs]); + }, [updateFocus, focus?.ts, minTs, maxTs]); const { control, handleSubmit } = useForm({ values: { @@ -433,17 +431,17 @@ export default function SessionSubpanel({ ); const onSessionEventTimeClick = useCallback( (ts: number) => { - setFocus({ ts, setBy: 'timeline' }); + updateFocus({ ts, setBy: 'timeline' }); }, - [setFocus], + [updateFocus], ); const setPlayerTime = useCallback( (ts: number) => { if (focus?.setBy !== 'player' || focus?.ts !== ts) { - setFocus({ ts, setBy: 'player' }); + updateFocus({ ts, setBy: 'player' }); } }, - [focus, setFocus], + [focus, updateFocus], ); return ( @@ -538,7 +536,7 @@ export default function SessionSubpanel({ playerState={playerState} setPlayerState={setPlayerState} focus={focus} - setFocus={setFocus} + setFocus={updateFocus} playbackRange={playbackRange} queriedConfig={eventsConfig} logEvents={logEvents.events} diff --git a/packages/app/src/components/ContextSidePanel.tsx b/packages/app/src/components/ContextSidePanel.tsx index fe2db7ae00..c57a019a8f 100644 --- a/packages/app/src/components/ContextSidePanel.tsx +++ b/packages/app/src/components/ContextSidePanel.tsx @@ -57,7 +57,7 @@ export default function ContextSubpanel({ const origTimestamp = rowData[ROW_DATA_ALIASES.TIMESTAMP]; const { whereLanguage: originalLanguage = 'lucene' } = dbSqlRowTableConfig ?? {}; - const [range, setRange] = useState(ms('30s')); + const [range, setRange] = useState(() => ms('30s')); const [activePreset, setActivePreset] = useState('all'); const { control, reset } = useForm({ defaultValues: { diff --git a/packages/app/src/components/DBDeltaChart.tsx b/packages/app/src/components/DBDeltaChart.tsx index 2dcf2bd0df..92af434974 100644 --- a/packages/app/src/components/DBDeltaChart.tsx +++ b/packages/app/src/components/DBDeltaChart.tsx @@ -414,7 +414,7 @@ export default function DBDeltaChart({ isPriorityProperty, ]); - const [activePage, setPage] = useState(1); + const [activePage, setActivePage] = useState(1); const { ref: containerRef, @@ -440,7 +440,7 @@ export default function DBDeltaChart({ ), ); useEffect(() => { - setPage(1); + setActivePage(1); }, [columns, rows, xMin, xMax, yMin, yMax]); if (error) { @@ -669,7 +669,7 @@ export default function DBDeltaChart({ diff --git a/packages/app/src/components/DBSearchPageFilters.tsx b/packages/app/src/components/DBSearchPageFilters.tsx index 98aae2d97e..23b521041a 100644 --- a/packages/app/src/components/DBSearchPageFilters.tsx +++ b/packages/app/src/components/DBSearchPageFilters.tsx @@ -486,10 +486,10 @@ const FilterGroupBody = ({ }) => { const [search, setSearch] = useState(''); // "Show More" button when there's lots of options - const [shouldShowMore, setShowMore] = useState(false); + const [shouldShowMore, setShouldShowMore] = useState(false); // Track recently moved items for highlight animation const [recentlyMoved, setRecentlyMoved] = useState>( - new Set(), + () => new Set(), ); // For live searches, don't refresh percentages when date range changes const [dateRange, setDateRange] = useState<[Date, Date]>( @@ -770,7 +770,7 @@ const FilterGroupBody = ({ } onClick={() => { // When show more is clicked, immediately show all and also fetch more from server. - setShowMore(!shouldShowMore); + setShouldShowMore(!shouldShowMore); if (!shouldShowMore) { onLoadMore?.(name); } diff --git a/packages/app/src/components/DBSearchPageFilters/NestedFilterGroup.tsx b/packages/app/src/components/DBSearchPageFilters/NestedFilterGroup.tsx index ed8b12bb21..5affd3f0b5 100644 --- a/packages/app/src/components/DBSearchPageFilters/NestedFilterGroup.tsx +++ b/packages/app/src/components/DBSearchPageFilters/NestedFilterGroup.tsx @@ -98,7 +98,7 @@ export const NestedFilterGroup = ({ ); const hasSelections = totalFiltersSize > 0; - const [isExpanded, setExpanded] = useState( + const [isExpanded, setIsExpanded] = useState( isDefaultExpanded ?? hasSelections, ); @@ -151,7 +151,7 @@ export const NestedFilterGroup = ({ chevronPosition="left" classNames={{ chevron: classes.chevron }} value={isExpanded ? name : null} - onChange={v => setExpanded(v === name)} + onChange={v => setIsExpanded(v === name)} >
diff --git a/packages/app/src/components/DBTimeChart.tsx b/packages/app/src/components/DBTimeChart.tsx index 88f720472f..f1ff5905c8 100644 --- a/packages/app/src/components/DBTimeChart.tsx +++ b/packages/app/src/components/DBTimeChart.tsx @@ -446,7 +446,7 @@ function DBTimeChartComponent({ applySelectColors = false, }: DBTimeChartComponentProps) { const [selectedSeriesSet, setSelectedSeriesSet] = useState>( - new Set(), + () => new Set(), ); // When the render cap hides series, the hidden-series notice lets the user diff --git a/packages/app/src/components/DBTraceWaterfallChart.tsx b/packages/app/src/components/DBTraceWaterfallChart.tsx index 9b22ee2f00..462ee07a05 100644 --- a/packages/app/src/components/DBTraceWaterfallChart.tsx +++ b/packages/app/src/components/DBTraceWaterfallChart.tsx @@ -1011,7 +1011,9 @@ export function DBTraceWaterfallChartContainer({ aliasWith: WithClause[]; }; - const [collapsedIds, setCollapsedIds] = useState>(new Set()); + const [collapsedIds, setCollapsedIds] = useState>( + () => new Set(), + ); const { nodesMap, flattenedNodes, parentIdsByLevel } = useMemo(() => { const rootNodes: Node[] = []; diff --git a/packages/app/src/components/SearchInput/AutocompleteInput.tsx b/packages/app/src/components/SearchInput/AutocompleteInput.tsx index e9a2b989d5..77e267a7ef 100644 --- a/packages/app/src/components/SearchInput/AutocompleteInput.tsx +++ b/packages/app/src/components/SearchInput/AutocompleteInput.tsx @@ -58,14 +58,14 @@ export default function AutocompleteInput({ // Rows the query is shown across before the textarea starts scrolling. const maxVisibleRows = 4; - const [isSearchInputFocused, _setIsSearchInputFocused] = useState(false); + const [isSearchInputFocused, setIsSearchInputFocused] = useState(false); const [isInputDropdownOpen, setIsInputDropdownOpen] = useState(false); - const setIsSearchInputFocused = useCallback( + const updateSearchInputFocus = useCallback( (state: boolean) => { - _setIsSearchInputFocused(state); + setIsSearchInputFocused(state); setIsInputDropdownOpen(state); }, - [_setIsSearchInputFocused], + [setIsSearchInputFocused], ); const [rightSectionWidth, setRightSectionWidth] = useState( 'auto', @@ -240,12 +240,12 @@ export default function AutocompleteInput({ onFocus={() => { setSelectedAutocompleteIndex(-1); setSelectedQueryHistoryIndex(-1); - setIsSearchInputFocused(true); + updateSearchInputFocus(true); }} onBlur={() => { setSelectedAutocompleteIndex(-1); setSelectedQueryHistoryIndex(-1); - setIsSearchInputFocused(false); + updateSearchInputFocus(false); }} onKeyDown={e => { if ( diff --git a/packages/app/src/components/VirtualMultiSelect/VirtualMultiSelect.stories.tsx b/packages/app/src/components/VirtualMultiSelect/VirtualMultiSelect.stories.tsx index 8d891f8fb7..d0cebf3ad8 100644 --- a/packages/app/src/components/VirtualMultiSelect/VirtualMultiSelect.stories.tsx +++ b/packages/app/src/components/VirtualMultiSelect/VirtualMultiSelect.stories.tsx @@ -36,10 +36,10 @@ const meta: Meta = { decorators: [ (Story, ctx) => { - const [values, onChange] = useState([]); + const [values, setValues] = useState([]); return ( - + ); }, diff --git a/packages/app/src/dashboard.ts b/packages/app/src/dashboard.ts index 3e7c3af725..e9fa505b46 100644 --- a/packages/app/src/dashboard.ts +++ b/packages/app/src/dashboard.ts @@ -260,7 +260,7 @@ export function useDashboard({ enabled: dashboardId != null, }); - const [isSetting, setIsSettingDashboard] = useState(false); + const [isSetting, setIsSetting] = useState(false); const isLocalDashboard = dashboardId == null; @@ -299,14 +299,14 @@ export function useDashboard({ } onSuccess?.(); } else { - setIsSettingDashboard(true); + setIsSetting(true); return updateDashboard.mutate(newDashboard, { onSuccess: () => { - setIsSettingDashboard(false); + setIsSetting(false); onSuccess?.(); }, onError: e => { - setIsSettingDashboard(false); + setIsSetting(false); notifications.show({ color: 'red', title: 'Unable to save dashboard', diff --git a/packages/app/src/hooks/useMetadata.tsx b/packages/app/src/hooks/useMetadata.tsx index 1655d8b971..3a206bec0b 100644 --- a/packages/app/src/hooks/useMetadata.tsx +++ b/packages/app/src/hooks/useMetadata.tsx @@ -54,7 +54,7 @@ export const SINGLE_KEY_VALUES_LIMIT = 10000; // Hook to get metadata with proper settings applied export function useMetadataWithSettings() { - const [metadata, setMetadata] = useState(getMetadata()); + const [metadata, setMetadata] = useState(getMetadata); const { data: me } = api.useMe(); const settingsAppliedRef = useRef(false); const queryClient = useQueryClient(); diff --git a/packages/app/src/timeQuery.ts b/packages/app/src/timeQuery.ts index a4edc4be7e..e5053cdc5b 100644 --- a/packages/app/src/timeQuery.ts +++ b/packages/app/src/timeQuery.ts @@ -429,13 +429,13 @@ export function useNewTimeQuery({ const [ deprecatedDisplayedTimeInputValue, - deprecatedSetDisplayedTimeInputValue, + setDeprecatedDisplayedTimeInputValue, ] = useState(() => { return initialDisplayValue ?? dateRangeToString(initialTimeRange, timeZone); }); const _setDisplayedTimeInputValue = - setDisplayedTimeInputValue ?? deprecatedSetDisplayedTimeInputValue; + setDisplayedTimeInputValue ?? setDeprecatedDisplayedTimeInputValue; const [{ from, to }, setTimeRangeQuery] = useQueryStates( timeRangeQueryStateMap, @@ -444,7 +444,7 @@ export function useNewTimeQuery({ }, ); - const [searchedTimeRange, setSearchedTimeRange] = useState<[Date, Date]>( + const [searchedTimeRange, setSearchedTimeRange] = useState<[Date, Date]>(() => from != null && to != null ? [new Date(from), new Date(to)] : initialTimeRange, diff --git a/packages/app/src/utils.ts b/packages/app/src/utils.ts index 37391f5180..3aff23fcbb 100644 --- a/packages/app/src/utils.ts +++ b/packages/app/src/utils.ts @@ -160,7 +160,7 @@ export function useLocalStorage(key: string, initialValue: T) { // State to store our value // Pass initial state function to useState so logic is only executed once const [storedValue, setStoredValue] = useState( - getLocalStorageValue(key) ?? initialValue, + () => getLocalStorageValue(key) ?? initialValue, ); // Create a unique ID for this hook instance From 2400285e64ea469797516359550c3b45823326b1 Mon Sep 17 00:00:00 2001 From: Drew Davis Date: Sat, 21 Nov 2026 09:31:52 -0500 Subject: [PATCH 3/7] chore(app): drop use prefix from hookless source-mapped frame stub --- packages/app/package.json | 2 +- packages/app/src/components/ExceptionSubpanel.tsx | 4 ++-- .../src/{useSourceMappedFrame.tsx => sourceMappedFrame.ts} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename packages/app/src/{useSourceMappedFrame.tsx => sourceMappedFrame.ts} (65%) diff --git a/packages/app/package.json b/packages/app/package.json index e0a4c94b07..fe0612982a 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -14,7 +14,7 @@ "build:clickhouse": "NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js", "run:clickhouse": "test -d out && npx rimraf tmp && mkdir tmp && cp -r out tmp/clickstack && echo 'visit http://localhost:3000/clickstack to start' && npx serve tmp -l 3000 || echo 'run build:clickhouse first'", "start": "next start", - "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 545 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", + "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 544 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", "lint:fix": "yarn run -T oxlint --fix && yarn run -T oxfmt '**/*.{ts,tsx,css,scss}'", "lint:styles": "stylelint **/*/*.{css,scss}", "ci:lint": "yarn lint && yarn tsc --noEmit && yarn lint:styles --quiet", diff --git a/packages/app/src/components/ExceptionSubpanel.tsx b/packages/app/src/components/ExceptionSubpanel.tsx index add6b41e25..9211dce443 100644 --- a/packages/app/src/components/ExceptionSubpanel.tsx +++ b/packages/app/src/components/ExceptionSubpanel.tsx @@ -14,12 +14,12 @@ import { import { ColumnDef, Row, Table as TanstackTable } from '@tanstack/react-table'; import { CopySnippet } from '@/components/ClickStackOnboarding/CopySnippet'; +import { getSourceMappedFrame } from '@/sourceMappedFrame'; import type { StacktraceBreadcrumb, StacktraceFrame as TStacktraceFrame, } from '@/types'; import { FormatTime } from '@/useFormatTime'; -import { useSourceMappedFrame } from '@/useSourceMappedFrame'; import { UNKNOWN_FUNCTION } from '@/utils/sentryStackParser'; import { Table, TableCellButton } from './Table'; @@ -210,7 +210,7 @@ const StacktraceRow = ({ const frame = row.original; - const { isLoading, enrichedFrame } = useSourceMappedFrame(); + const { isLoading, enrichedFrame } = getSourceMappedFrame(); const augmentedFrame = enrichedFrame ?? frame; const hasContext = !!augmentedFrame.context_line; diff --git a/packages/app/src/useSourceMappedFrame.tsx b/packages/app/src/sourceMappedFrame.ts similarity index 65% rename from packages/app/src/useSourceMappedFrame.tsx rename to packages/app/src/sourceMappedFrame.ts index beda3b7bf5..0503decd72 100644 --- a/packages/app/src/useSourceMappedFrame.tsx +++ b/packages/app/src/sourceMappedFrame.ts @@ -1,4 +1,4 @@ -export const useSourceMappedFrame = () => { +export const getSourceMappedFrame = () => { return { isLoading: false, error: null, From 9537908293e81ba027b7137b6711d820d837851e Mon Sep 17 00:00:00 2001 From: Drew Davis Date: Sat, 21 Nov 2026 09:32:09 -0500 Subject: [PATCH 4/7] chore(app): name useId result with an Id suffix --- packages/app/package.json | 2 +- packages/app/src/HDXMultiSeriesTimeChart.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index fe0612982a..fa97bd39ca 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -14,7 +14,7 @@ "build:clickhouse": "NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js", "run:clickhouse": "test -d out && npx rimraf tmp && mkdir tmp && cp -r out tmp/clickstack && echo 'visit http://localhost:3000/clickstack to start' && npx serve tmp -l 3000 || echo 'run build:clickhouse first'", "start": "next start", - "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 544 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", + "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 543 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", "lint:fix": "yarn run -T oxlint --fix && yarn run -T oxfmt '**/*.{ts,tsx,css,scss}'", "lint:styles": "stylelint **/*/*.{css,scss}", "ci:lint": "yarn lint && yarn tsc --noEmit && yarn lint:styles --quiet", diff --git a/packages/app/src/HDXMultiSeriesTimeChart.tsx b/packages/app/src/HDXMultiSeriesTimeChart.tsx index 4466d06fcd..726f1b5aff 100644 --- a/packages/app/src/HDXMultiSeriesTimeChart.tsx +++ b/packages/app/src/HDXMultiSeriesTimeChart.tsx @@ -1484,8 +1484,8 @@ export const MemoChart = memo(function MemoChart({ */ yAxisMaxDomain?: number; }) { - const _id = useId(); - const id = _id.replace(/:/g, ''); + const reactId = useId(); + const id = reactId.replace(/:/g, ''); // The y-axis width budget is expressed in characters (see MAX_AXIS_MANTISSA), // so it has to grow with the tick font or the widest labels clip. From d6f111fd6335c2c8871aa3aadf2203f46ba7434f Mon Sep 17 00:00:00 2001 From: Drew Davis Date: Sat, 21 Nov 2026 09:32:31 -0500 Subject: [PATCH 5/7] test(app): type nuqs createParser mock without Function --- packages/app/package.json | 2 +- packages/app/src/hooks/__tests__/useDashboardFilters.test.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index fa97bd39ca..37cf1791a0 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -14,7 +14,7 @@ "build:clickhouse": "NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js", "run:clickhouse": "test -d out && npx rimraf tmp && mkdir tmp && cp -r out tmp/clickstack && echo 'visit http://localhost:3000/clickstack to start' && npx serve tmp -l 3000 || echo 'run build:clickhouse first'", "start": "next start", - "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 543 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", + "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 541 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", "lint:fix": "yarn run -T oxlint --fix && yarn run -T oxfmt '**/*.{ts,tsx,css,scss}'", "lint:styles": "stylelint **/*/*.{css,scss}", "ci:lint": "yarn lint && yarn tsc --noEmit && yarn lint:styles --quiet", diff --git a/packages/app/src/hooks/__tests__/useDashboardFilters.test.tsx b/packages/app/src/hooks/__tests__/useDashboardFilters.test.tsx index 599a4801a9..a2c7f2038d 100644 --- a/packages/app/src/hooks/__tests__/useDashboardFilters.test.tsx +++ b/packages/app/src/hooks/__tests__/useDashboardFilters.test.tsx @@ -33,7 +33,7 @@ const mockSetState = jest.fn( jest.mock('nuqs', () => ({ useQueryState: () => [mockState, mockSetState], - createParser: (opts: { parse: Function; serialize: Function }) => opts, + createParser: (opts: T) => opts, })); describe('useDashboardFilters', () => { From 9cd38f3b51fee99bd0b0fe0c86b466218f93522e Mon Sep 17 00:00:00 2001 From: Drew Davis Date: Sat, 21 Nov 2026 09:33:47 -0500 Subject: [PATCH 6/7] test(app): replace cloneElement in test helpers --- packages/app/package.json | 2 +- .../__tests__/InputControlled.test.tsx | 63 +++++++++++-------- .../components/__tests__/Sparkline.test.tsx | 24 +++---- scripts/ci/ratchet-baseline.json | 2 +- 4 files changed, 50 insertions(+), 41 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 37cf1791a0..c74acb3b20 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -14,7 +14,7 @@ "build:clickhouse": "NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js", "run:clickhouse": "test -d out && npx rimraf tmp && mkdir tmp && cp -r out tmp/clickstack && echo 'visit http://localhost:3000/clickstack to start' && npx serve tmp -l 3000 || echo 'run build:clickhouse first'", "start": "next start", - "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 541 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", + "lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 534 && yarn run -T oxfmt --check '**/*.{ts,tsx,css,scss}'", "lint:fix": "yarn run -T oxlint --fix && yarn run -T oxfmt '**/*.{ts,tsx,css,scss}'", "lint:styles": "stylelint **/*/*.{css,scss}", "ci:lint": "yarn lint && yarn tsc --noEmit && yarn lint:styles --quiet", diff --git a/packages/app/src/components/__tests__/InputControlled.test.tsx b/packages/app/src/components/__tests__/InputControlled.test.tsx index b3b64a74e3..044c86c07c 100644 --- a/packages/app/src/components/__tests__/InputControlled.test.tsx +++ b/packages/app/src/components/__tests__/InputControlled.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { useForm } from 'react-hook-form'; +import { Control, useForm } from 'react-hook-form'; import { fireEvent, screen, waitFor } from '@testing-library/react'; import { @@ -7,27 +7,34 @@ import { PasswordInputControlled, } from '@/components/InputControlled'; -// Test wrapper component that provides form context -function TestForm({ children }: { children: React.ReactElement }) { - const { control } = useForm({ +type TestFormValues = { testInput: string; testPassword: string }; + +function TestForm({ + children, +}: { + children: (control: Control) => React.ReactElement; +}) { + const { control } = useForm({ defaultValues: { testInput: '', testPassword: '', }, }); - return
{React.cloneElement(children, { control } as any)}
; + return
{children(control)}
; } describe('InputControlled', () => { it('renders input with correct props', () => { renderWithMantine( - + {control => ( + + )} , ); @@ -38,11 +45,13 @@ describe('InputControlled', () => { it('handles input changes', async () => { renderWithMantine( - + {control => ( + + )} , ); @@ -59,11 +68,13 @@ describe('PasswordInputControlled', () => { it('renders password input with correct props', () => { renderWithMantine( - + {control => ( + + )} , ); @@ -75,11 +86,13 @@ describe('PasswordInputControlled', () => { it('handles password input changes', async () => { renderWithMantine( - + {control => ( + + )} , ); diff --git a/packages/app/src/components/__tests__/Sparkline.test.tsx b/packages/app/src/components/__tests__/Sparkline.test.tsx index 70ed4c355f..1b49f5dcfb 100644 --- a/packages/app/src/components/__tests__/Sparkline.test.tsx +++ b/packages/app/src/components/__tests__/Sparkline.test.tsx @@ -4,26 +4,22 @@ import { Sparkline, type SparklinePoint } from '@/components/Sparkline'; // recharts `ResponsiveContainer` sizes itself from its parent via a // ResizeObserver, which is a no-op in jsdom (see setupTests), so it never -// reports a size and the chart never paints. Swap it for a fixed-size -// pass-through so the SVG renders and the variant can be asserted, and record -// the requested height so its forwarding can be asserted. The `mock` prefix -// lets the hoisted jest.mock factory reference it. +// reports a size and the chart never paints. Give it a fixed pixel size so the +// SVG renders and the variant can be asserted, and record the requested height +// so its forwarding can be asserted. The `mock` prefix lets the hoisted +// jest.mock factory reference it. const mockResponsiveContainerHeights: Array = []; jest.mock('recharts', () => { const actual = jest.requireActual('recharts'); - const { cloneElement } = jest.requireActual('react'); + const ActualResponsiveContainer = actual.ResponsiveContainer; return { ...actual, - ResponsiveContainer: ({ - children, - height, - }: { - children: React.ReactElement<{ width?: number; height?: number }>; - height?: number | string; - }) => { - mockResponsiveContainerHeights.push(height); - return cloneElement(children, { width: 300, height: 80 }); + ResponsiveContainer: ( + props: React.ComponentProps, + ) => { + mockResponsiveContainerHeights.push(props.height); + return ; }, }; }); diff --git a/scripts/ci/ratchet-baseline.json b/scripts/ci/ratchet-baseline.json index 9520c487d4..4a876fb9f5 100644 --- a/scripts/ci/ratchet-baseline.json +++ b/scripts/ci/ratchet-baseline.json @@ -6,7 +6,7 @@ "@source": 0 }, "app": { - "as-any": 204, + "as-any": 199, "ts-ignore": 0, "eslint-disable": 119, "@source": 0 From f2b9d3a3f34ff20102f5887ff72e72398b9748c4 Mon Sep 17 00:00:00 2001 From: Drew Davis Date: Sat, 21 Nov 2026 09:50:14 -0500 Subject: [PATCH 7/7] chore(app): promote fully fixed lint rules to errors --- packages/app/.oxlintrc.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/app/.oxlintrc.json b/packages/app/.oxlintrc.json index 5852d4f4d6..29b7097b3a 100644 --- a/packages/app/.oxlintrc.json +++ b/packages/app/.oxlintrc.json @@ -85,7 +85,7 @@ "scripts/**" ], "rules": { - "typescript/no-unsafe-function-type": "warn", + "typescript/no-unsafe-function-type": "error", "typescript/no-unsafe-type-assertion": "warn", "no-unused-expressions": "warn", "no-console": [ @@ -116,7 +116,7 @@ "nextjs/no-duplicate-head": "error", "nextjs/no-head-import-in-document": "error", "nextjs/no-script-component-in-head": "error", - "@eslint-react/jsx-key-before-spread": "warn", + "@eslint-react/jsx-key-before-spread": "error", "@eslint-react/jsx-no-comment-textnodes": "warn", "@eslint-react/no-access-state-in-setstate": "error", "@eslint-react/no-array-index-key": "warn", @@ -125,7 +125,7 @@ "@eslint-react/no-children-map": "warn", "@eslint-react/no-children-only": "warn", "@eslint-react/no-children-to-array": "warn", - "@eslint-react/no-clone-element": "warn", + "@eslint-react/no-clone-element": "error", "@eslint-react/no-component-will-mount": "error", "@eslint-react/no-component-will-receive-props": "error", "@eslint-react/no-component-will-update": "error", @@ -141,10 +141,10 @@ "@eslint-react/no-unsafe-component-will-mount": "warn", "@eslint-react/no-unsafe-component-will-receive-props": "warn", "@eslint-react/no-unsafe-component-will-update": "warn", - "@eslint-react/no-unnecessary-use-prefix": "warn", + "@eslint-react/no-unnecessary-use-prefix": "error", "@eslint-react/no-unused-class-component-members": "warn", "@eslint-react/no-use-context": "error", - "@eslint-react/use-state": "warn", + "@eslint-react/use-state": "error", "@eslint-react/rsc/function-definition": "error", "@eslint-react/dom/no-dangerously-set-innerhtml": "warn", "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error", @@ -163,7 +163,7 @@ "@eslint-react/web-api/no-leaked-resize-observer": "warn", "@eslint-react/web-api/no-leaked-timeout": "warn", "@eslint-react/naming-convention/context-name": "warn", - "@eslint-react/naming-convention/id-name": "warn", + "@eslint-react/naming-convention/id-name": "error", "@eslint-react/naming-convention/ref-name": "error", "@eslint-react/no-unstable-default-props": "error", "react-hook-form/no-use-watch": "error",