Skip to content

feat(TopicData): add tab for topic data #2145

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Merged
merged 21 commits into from
Apr 30, 2025
Merged

feat(TopicData): add tab for topic data #2145

merged 21 commits into from
Apr 30, 2025

Conversation

Raubzeug
Copy link
Contributor

@Raubzeug Raubzeug commented Apr 12, 2025

Stand

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
318 317 0 1 0

😟 No changes in tests. 😕

Bundle Size: 🔺

Current: 83.46 MB | Main: 83.38 MB
Diff: +0.08 MB (0.10%)

⚠️ Bundle size increased. Please review.

ℹ️ 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.

@Raubzeug Raubzeug requested a review from Copilot April 12, 2025 15:59
Copy link
Contributor

@Copilot 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.

Copilot reviewed 46 out of 50 changed files in this pull request and generated 2 comments.

Files not reviewed (4)
  • src/components/EmptyState/EmptyState.scss: Language not supported
  • src/components/MultilineTableHeader/MultilineTableHeader.scss: Language not supported
  • src/components/PaginatedTable/PaginatedTable.scss: Language not supported
  • src/containers/Tenant/Diagnostics/Partitions/Headers/Headers.scss: Language not supported

<div className={b('head-cell-content')}>{content}</div>
{column.note && (
<HelpMark
placement={columnAlignToHelpMarkPlacement[column.align]}
Copy link
Preview

Copilot AI Apr 12, 2025

Choose a reason for hiding this comment

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

If column.align is undefined or not one of 'left', 'right', or 'center', this mapping will return undefined. Consider providing a default placement value to prevent potential runtime issues.

Suggested change
placement={columnAlignToHelpMarkPlacement[column.align]}
placement={columnAlignToHelpMarkPlacement[column.align] ?? 'top'}

Copilot uses AI. Check for mistakes.


import './MultilineTableHeader.scss';

const b = cn('ydb-mulitiline-table-header');
Copy link
Preview

Copilot AI Apr 12, 2025

Choose a reason for hiding this comment

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

There appears to be a typo in the class name 'ydb-mulitiline-table-header'; consider renaming it to 'ydb-multiline-table-header' for clarity.

Suggested change
const b = cn('ydb-mulitiline-table-header');
const b = cn('ydb-multiline-table-header');

Copilot uses AI. Check for mistakes.

@Raubzeug Raubzeug changed the title Ydb topic data feat(TopicData): add tab for topic data Apr 12, 2025
@Raubzeug Raubzeug linked an issue Apr 12, 2025 that may be closed by this pull request
@Raubzeug Raubzeug requested a review from Copilot April 12, 2025 16:09
Copy link
Contributor

@Copilot 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.

Copilot reviewed 46 out of 50 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • src/components/EmptyState/EmptyState.scss: Language not supported
  • src/components/MultilineTableHeader/MultilineTableHeader.scss: Language not supported
  • src/components/PaginatedTable/PaginatedTable.scss: Language not supported
  • src/containers/Tenant/Diagnostics/Partitions/Headers/Headers.scss: Language not supported
Comments suppressed due to low confidence (1)

src/components/PaginatedTable/TableHead.tsx:138

  • The 'align' property is used to determine the HelpMark placement but is not declared in the Column interface. Consider adding an optional 'align' field to the Column type with a default value to ensure consistent behavior.
placement={columnAlignToHelpMarkPlacement[column.align]}

<FullValue value={fullValue} onClose={() => setFullValue(undefined)} />
<ResizeablePaginatedTable
//if any filter change, we need to initiate a new table component to ensure correct start offset calculations in generateTopicDataGetter
key={topicDataFilter + selectedOffset + startTimestamp + selectedPartition}
Copy link
Member

@artemmufazalov artemmufazalov Apr 14, 2025

Choose a reason for hiding this comment

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

Table chunks are reset every time value in filters changes, why do you need key here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of logic inside generateTopicDataGetter https://github.com/ydb-platform/ydb-embedded-ui/pull/2145/files/c38c503b6fcc6c99e35da4324056d8374ccb5c03#diff-55d62e69373cb3d825abe22e33d121b8cda18477596ea4d1038a5560934ac1f4 ! Every time we should calculate initial offset, and table offset should be reset to 0.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But there is already

parentRef.current.scrollTo(0, 0);

in React.useLayoutEffect in PaginatedTable

shouldnt this be enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made a little improvement to PaginatedTable, so it does't refetch previous active chunks when filters changes. So the key is not needed any more.

import {cn} from '../../utils/cn';
import {DebouncedInput} from '../DebouncedInput/DebouncedInput';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think we need search component now - we can use DebouncedInput directly where Search was used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We definitely can, but it will require to pass similar props in a lot of places where was used. Do you think it is really needed?

import type {TextInputProps} from '@gravity-ui/uikit';
import {TextInput} from '@gravity-ui/uikit';

interface SearchProps extends TextInputProps {
Copy link
Collaborator

Choose a reason for hiding this comment

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

DebouncedInputProps ?

@@ -5,11 +5,12 @@
flex-grow: 1;

height: 100%;
margin-right: -20px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

calc(-1 * var(--g-spacing-5))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it seems we don't need it at all

{TopicDataFilterValues.TIMESTAMP}
</RadioButton.Option>
<RadioButton.Option value="OFFSET">
{TopicDataFilterValues.OFFSET}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose value in RadioButton should be TopicDataFilterValues.OFFSET and text i18(...)

according to current project rules

{TopicDataFilterValues.OFFSET}
</RadioButton.Option>
</RadioButton>
{topicDataFilter === 'OFFSET' && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

here and below too

&__table {
@include mixins.freeze-nth-column(1);
// padding-right: 0;
Copy link
Member

Choose a reason for hiding this comment

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

Comment

@Raubzeug
Copy link
Contributor Author

@astandrik @artemmufazalov stand redeployed

Copy link
Contributor

@Copilot 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 adds a new "Data" tab for topic data diagnostics and enhances related page linking and filtering logic for topic and database entity types.

  • Updated diagnostics pages to include the new topicData tab
  • Refactored page lookup logic to handle topic data and database feature flags
  • Replaced TextInput with a DebouncedInput component for better search handling

Reviewed Changes

Copilot reviewed 45 out of 48 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/containers/Tenant/Diagnostics/DiagnosticsPages.ts Added topicData tab and updated pages filtering logic
src/containers/Tenant/Diagnostics/Diagnostics.tsx Integrated topicData rendering with updated diagnostics page linking
src/containers/Storage/shared.ts Removed unused paginated table error message helper
src/containers/Storage/PaginatedStorageNodes.tsx Updated import usage for error message rendering
src/containers/Storage/PaginatedStorageGroups.tsx Updated import usage for error message rendering
src/containers/Storage/EmptyFilter/EmptyFilter.tsx Modified to allow an optional custom image for empty filters
src/components/Search/Search.tsx Replaced TextInput with DebouncedInput for improved debounced search input
src/components/PaginatedTable/useScrollBasedChunks.ts Adjusted active chunks calculation logic
src/components/PaginatedTable/types.ts Added a note property to the Column type
src/components/PaginatedTable/TableHead.tsx Added HelpMark support for displaying column notes
src/components/PaginatedTable/TableChunk.tsx Updated offset calculation to include startOffset
src/components/PaginatedTable/PaginatedTable.tsx Introduced startOffset prop and refined filters update and dependency
src/components/MultilineTableHeader/MultilineTableHeader.tsx New component for rendering multi-line table headers
src/components/MetricChart/getDefaultDataFormatter.ts Replaced numeric conversion helper with a safer version
src/components/DebouncedInput/DebouncedInput.tsx New debounced input component implementation
Files not reviewed (3)
  • src/components/EmptyState/EmptyState.scss: Language not supported
  • src/components/MultilineTableHeader/MultilineTableHeader.scss: Language not supported
  • src/components/PaginatedTable/PaginatedTable.scss: Language not supported

@@ -30,6 +30,7 @@ interface TableChunkProps<T, F> {
sortParams?: SortParams;
isActive: boolean;
tableName: string;
startOffset: number;
Copy link
Collaborator

Choose a reason for hiding this comment

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

mb its possible to set startOffset as rowIndex?

@Raubzeug
Copy link
Contributor Author

@artemmufazalov @astandrik final version is here, stand redeployed!

@Raubzeug
Copy link
Contributor Author

@astandrik @artemmufazalov final version is here, stand redeployed!

@Raubzeug Raubzeug added this pull request to the merge queue Apr 30, 2025
Merged via the queue into main with commit 4c25054 Apr 30, 2025
7 checks passed
@Raubzeug Raubzeug deleted the ydb-topic-data branch April 30, 2025 15:07
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Topic data - highlight found offset Tab Data in topic's Diagnostics
3 participants