Skip to content

Conversation

@DaryaVorontsova
Copy link
Contributor

@DaryaVorontsova DaryaVorontsova commented Dec 1, 2025

Stand: https://nda.ya.ru/t/VsEVE-UU7Nw5yn

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
378 375 0 1 2
Test Changes Summary ⏭️2

⏭️ Skipped Tests (2)

  1. Scroll to row, get shareable link, navigate to URL and verify row is scrolled into view (tenant/diagnostics/tabs/queries.test.ts)
  2. Copy result button copies to clipboard (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: ✅

Current: 62.33 MB | Main: 62.33 MB
Diff: +2.88 KB (0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@DaryaVorontsova DaryaVorontsova linked an issue Dec 1, 2025 that may be closed by this pull request
2 tasks
@DaryaVorontsova DaryaVorontsova marked this pull request as draft December 1, 2025 11:28
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

22 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@DaryaVorontsova DaryaVorontsova marked this pull request as ready for review December 1, 2025 12:07
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. src/utils/tableUtils/getRequiredDataFields.ts, line 7 (link)

    logic: potential runtime error if column doesn't exist in columnsToFields

    columnFields will be undefined if the column key doesn't exist, causing forEach to throw. Add null check:

23 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

}

export function bytesToMB(bytes?: number | string, fractionDigits?: number) {
function formatMbWithMaxFractionDigits(value: number, fractionDigits?: number): string {
Copy link
Member

@artemmufazalov artemmufazalov Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not formatBytes from src/utils/bytesParsers/formatBytes.ts suit you? It has precision and it properly formats number inside


//sort ids to prevent refetch if only order was changed
const columnsIds = columns.map((column) => column.name).toSorted();
const columnsIds = React.useMemo(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be if !useColumnsIdsInRequest, columnsIds will be []? To avoid nullish coalescing in getNodes фтв getGroups

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

23 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

18 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@astandrik astandrik requested a review from Copilot December 2, 2025 08:55
Copilot finished reviewing on behalf of astandrik December 2, 2025 08:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors byte formatting in the Node Network table and optimizes the PaginatedTable component to prevent unnecessary data refetches when toggling column visibility.

  • Consolidates the UNBREAKABLE_GAP constant to a single location in constants.ts
  • Replaces direct bytesToMB calls with the more robust formatBytes utility for consistent byte value formatting
  • Adds useColumnsIdsInRequest flag to PaginatedTable to control whether column IDs trigger refetches (defaults to true for backward compatibility, set to false for Node Network table)

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/utils.ts Removes UNBREAKABLE_GAP export (moved to constants.ts)
src/utils/constants.ts Adds UNBREAKABLE_GAP constant (renamed from NON_BREAKING_SPACE)
src/utils/numeral.ts Updates import to use UNBREAKABLE_GAP from constants
src/utils/dataFormatters/formatNumber.ts Updates import to use UNBREAKABLE_GAP from constants
src/utils/dataFormatters/dataFormatters.ts Updates import to use UNBREAKABLE_GAP from constants
src/utils/bytesParsers/formatBytes.ts Updates import to use UNBREAKABLE_GAP from constants
src/utils/dataFormatters/test/*.test.ts Updates test imports to use UNBREAKABLE_GAP from constants
src/utils/bytesParsers/test/formatBytes.test.ts Updates test import to use UNBREAKABLE_GAP from constants
src/components/nodesColumns/test/utils.test.ts Updates test import to use UNBREAKABLE_GAP from constants
src/containers/Tenant/Diagnostics/TenantOverview/MetricsTabs/components/PlaceholderTab.tsx Updates to use UNBREAKABLE_GAP instead of NON_BREAKING_SPACE
src/containers/Node/NodeNetwork/columns.ts Replaces bytesToMB with formatBytes utility for byte columns
src/containers/Node/NodeNetwork/NodeNetworkTable.tsx Disables column-based refetching with useColumnsIdsInRequest={false}
src/components/PaginatedTable/PaginatedTable.tsx Adds useColumnsIdsInRequest prop with default value true
src/components/PaginatedTable/TableChunksRenderer.tsx Threads useColumnsIdsInRequest through to child components
src/components/PaginatedTable/TableChunk.tsx Conditionally includes columnsIds in request based on useColumnsIdsInRequest flag

onDataFetched: (data?: PaginatedTableData<T>) => void;

keepCache?: boolean;
useColumnsIdsInRequest?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to name this prop something like "preserveColsOrderInRequest"

useColumnsIdsInRequest is

looks like hook name
doesnt explicitly state how they are actually used

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

22 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

astandrik
astandrik previously approved these changes Dec 2, 2025
@astandrik
Copy link
Collaborator

astandrik commented Dec 2, 2025

btw is it intentional that in NODE_PEERS column order changing triggers refetch?

If its not - we could completely erase these checks and always preserve columns order for fetching

@astandrik
Copy link
Collaborator

astandrik commented Dec 2, 2025

(actually I meant something like raising columns order logics somewhere to actual fetch functions - for fetch logics (which is column ordering condition) to be closely wired to actual fetches, but current approach is ok too)

@DaryaVorontsova
Copy link
Contributor Author

Actually I had to avoid refetching every time when we add or remove a column in the table of peers, because backend for /peers doesn't support passing "required columns" (unlike other handlers like /nodes, etc.). And my idea is: if we have the peers table, we keep the columnsIds array unchanged (it is always empty) -> changing visible columns doesn’t trigger a new request to the backend )))

@astandrik
Copy link
Collaborator

Actually I had to avoid refetching every time when we add or remove a column in the table of peers, because backend for /peers doesn't support passing "required columns" (unlike other handlers like /nodes, etc.). And my idea is: if we have the peers table, we keep the columnsIds array unchanged (it is always empty) -> changing visible columns doesn’t trigger a new request to the backend )))

I mean what will change if we make [PAGINATED_TABLE_IDS.NODE_PEERS]: true
(I dont know the answer - just asking)

@DaryaVorontsova
Copy link
Contributor Author

DaryaVorontsova commented Dec 2, 2025

In this case changing visible columns will trigger a request to the backend for the peers table with array of columnsIds - so, it is unnecessary, I guess

@astandrik
Copy link
Collaborator

Okay now I see, thanks
In this case my comment about renaming is incorrect - hasColumnsIdsInRequest was better - because we always preserve order when we use columnIds

enums for table names is great idea though - much better than strings

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

22 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

22 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@DaryaVorontsova DaryaVorontsova added this pull request to the merge queue Dec 3, 2025
Merged via the queue into main with commit aeaaf3c Dec 3, 2025
9 checks passed
@DaryaVorontsova DaryaVorontsova deleted the fix-network branch December 3, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix network tab for node page

5 participants