perf(logs): Prevent search query builder rerenders on auto-refresh#110320
Conversation
Extract the logs search and filter UI into a memoized component and memoize query builder props so auto-refresh and table updates do not re-render the search query builder. Refs LOGS-601 Co-Authored-By: GPT-5 Codex <noreply@openai.com> Made-with: Cursor
Move search-only hooks into LogsSearchSection so query-builder props stay scoped to the search area instead of recomputing with table refresh state. This reduces unnecessary search bar rerenders while logs data updates. Made-with: Cursor
|
@sentry review |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| {}, | ||
| 'boolean', | ||
| HiddenLogSearchFields | ||
| ); |
There was a problem hiding this comment.
Duplicate attribute hooks double computation in performance PR
Low Severity
useLogItemAttributes is called three times each in both LogsSearchSection and LogsTabContent, totaling six calls. Each call internally runs useTraceItemAttributeConfig, which fetches and computes all three attribute types (string, number, boolean) regardless of the type argument — so the underlying computation runs twice. In a PR focused on reducing unnecessary work during auto-refresh, this duplication is counterproductive. The attributes could be fetched once in LogsTabContent and passed as props to LogsSearchSection, which would also reduce the number of hooks that can trigger re-renders inside the memoized component.
Additional Locations (1)
There was a problem hiding this comment.
Will look into in a follow up.


Summary
LogsSearchSectionso table refreshes and layout updates do not force the query builder subtree to rerender.tracesItemSearchQueryBuilderPropsinuseLogsSearchQueryBuilderPropsso provider props remain referentially stable between auto-refresh cycles.Refs LOGS-603
Made with Cursor