Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds automatic scrolling to the selected row in the TopQueries drawer and standardizes row heights by replacing the truncated query component.
- Introduces
useScrollToSelectedhook and wires it intoTopQueriesDatawithdynamicInnerRef - Adds
dynamicRenderType: 'uniform'to table settings for fixed row heights - Creates
FixedHeightQuerycomponent (replacingTruncatedQuery) and corresponding styles
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/containers/Tenant/Diagnostics/TopQueries/utils.ts | Added dynamicRenderType: 'uniform' to table settings |
| src/containers/Tenant/Diagnostics/TopQueries/hooks/useScrollToSelected.ts | New hook to scroll the react-list to the selected row |
| src/containers/Tenant/Diagnostics/TopQueries/columns/columns.tsx | Swapped out TruncatedQuery for FixedHeightQuery |
| src/containers/Tenant/Diagnostics/TopQueries/TopQueriesData.tsx | Integrated scroll hook, updated settings to use dynamicInnerRef |
| src/components/FixedHeightQuery/FixedHeightQuery.tsx | New component for rendering queries with fixed height and optional clipboard |
| src/components/FixedHeightQuery/FixedHeightQuery.scss | Styles for the fixed-height query display |
Comments suppressed due to low confidence (3)
src/containers/Tenant/Diagnostics/TopQueries/hooks/useScrollToSelected.ts:25
- Consider adding unit tests for this custom hook to verify scrolling logic (visible range check, fallback behavior) under different scenarios.
export function useScrollToSelected({selectedRow, rows, reactListRef}: UseScrollToSelectedParams) {
src/containers/Tenant/Diagnostics/TopQueries/columns/columns.tsx:5
- The
YDBSyntaxHighlighterimport is no longer used after replacingTruncatedQuery, consider removing this unused import.
import {YDBSyntaxHighlighter} from '../../../../../components/SyntaxHighlighter/YDBSyntaxHighlighter';
src/components/FixedHeightQuery/FixedHeightQuery.tsx:20
- [nitpick] Add a JSDoc comment above the
FixedHeightQuerycomponent to describe its purpose and the meaning of its props (lines,hasClipboardButton, etc.).
export const FixedHeightQuery = ({
artemmufazalov
suggested changes
Jun 5, 2025
Collaborator
Author
|
@artemmufazalov fixed issues, added couple of tests |
|
|
||
| // Get the number of rows and select a row that requires scrolling (should be 100 from mock) | ||
| const rowCount = await diagnostics.table.getRowCount(); | ||
| expect(rowCount).toBe(8); // Verify we have the expected 100 rows from mock |
Member
There was a problem hiding this comment.
Why it is 8 if you request 100 rows?
Collaborator
Author
There was a problem hiding this comment.
because virtualized table has only 8 rows in dom
| await page.goto(clipboardText); | ||
| await page.waitForTimeout(1000); | ||
|
|
||
| const firstVisibleRowIndex = 4; |
Collaborator
Author
|
@artemmufazalov have I answered your questions? |
artemmufazalov
approved these changes
Jun 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #2173
Stand
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ✨2 ⏭️1
✨ New Tests (2)
⏭️ Skipped Tests (1)
Bundle Size: 🔺
Current: 83.76 MB | Main: 83.76 MB
Diff: +7.77 KB (0.01%)
ℹ️ CI Information