Skip to content

Conversation

@artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Nov 6, 2025

Part of #2892

Stand: https://nda.ya.ru/t/c9IJGZLG7MWD5i

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: 47.15 MB | Main: 47.15 MB
Diff: 3.05 KB (-0.01%)

✅ Bundle size decreased.

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

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 the problem filter functionality from Redux state management to URL query parameters using the use-query-params library. The changes remove centralized Redux state for filtering and replace it with URL-based state management, making the filter state shareable via URLs and more aligned with the project's move towards use-query-params.

  • Removed problemFilter from Redux settings state and replaced with URL-based withProblems boolean parameter
  • Migrated tenants filtering logic from Redux selectors to local component state with filter utility functions
  • Updated ProblemFilter component to work with boolean values instead of string enums and added i18n support

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils/nodes.ts Removed getProblemParamValue helper function no longer needed after refactoring
src/utils/hooks/useWithProblemsQueryParam.ts New hook to manage withProblems URL parameter with BooleanParam
src/store/state-url-mapping.ts Removed problemFilter from global redux-location-state params and cleaned up unused tenants search mapping
src/store/reducers/tenants/types.ts Removed TenantsState and TenantsStateSlice interfaces as tenants state is no longer in Redux
src/store/reducers/tenants/tenants.ts Removed Redux slice for tenants, keeping only the RTK Query API endpoints
src/store/reducers/tenants/selectors.ts Deleted file - filtering logic migrated to new filters.ts utility file
src/store/reducers/tenants/filters.ts New file with pure filtering functions for tenants (by problems, search, domain)
src/store/reducers/settings/types.ts Removed ProblemFilterValue type and problemFilter from SettingsState
src/store/reducers/settings/settings.ts Removed ProblemFilterValues constant, changeFilter action, and selectProblemFilter selector
src/store/reducers/settings/hooks.ts Deleted file - useProblemFilter hook replaced by URL param hooks
src/store/reducers/nodes/types.ts Changed problemFilter field to withProblems boolean in NodesFilters interface
src/store/reducers/index.ts Removed tenants reducer from root reducer as it no longer manages Redux state
src/containers/Tenants/useTenantsQueryParams.ts New hook managing both withProblems and search URL parameters for Tenants page
src/containers/Tenants/Tenants.tsx Refactored to use URL params instead of Redux, with local useMemo for filtering logic
src/containers/Tenant/Diagnostics/Network/Network.tsx Updated to use useWithProblemsQueryParam hook instead of Redux state
src/containers/Nodes/useNodesPageQueryParams.ts Added withProblems BooleanParam to existing query params management
src/containers/Nodes/getNodes.ts Changed parameter from problemFilter to withProblems boolean
src/containers/Nodes/PaginatedNodes/PaginatedNodes.tsx Updated to use withProblems from URL params instead of Redux
src/containers/Nodes/PaginatedNodes/NodesComponent.tsx Updated to destructure withProblems from useNodesPageQueryParams
src/containers/Nodes/PaginatedNodes/GroupedNodesComponent.tsx Changed hardcoded 'All' to false for withProblems parameter
src/containers/Nodes/NodesTable.tsx Changed prop type from ProblemFilterValue to boolean
src/containers/Nodes/NodesControls/NodesControls.tsx Updated to use URL param hook instead of Redux for problem filter
src/components/ProblemFilter/index.ts Deleted barrel export file
src/components/ProblemFilter/i18n/index.ts New i18n configuration for ProblemFilter component
src/components/ProblemFilter/i18n/en.json New i18n translations for "all" and "with-problems" options
src/components/ProblemFilter/ProblemFilter.tsx Refactored to use boolean value and onChange, with string-to-boolean conversion and i18n
Comments suppressed due to low confidence (1)

src/containers/Tenant/Diagnostics/Network/Network.tsx:96

  • The Checkbox onUpdate callbacks should be memoized using React.useCallback according to the project's mandatory React performance patterns. All event handlers should be wrapped with useCallback:
const handleShowIdChange = React.useCallback(() => {
    setShowId(!showId);
}, [showId]);

const handleShowRacksChange = React.useCallback(() => {
    setShowRacks(!showRacks);
}, [showRacks]);

Then use them:

<Checkbox onUpdate={handleShowIdChange} checked={showId}>
    ID
</Checkbox>
<Checkbox onUpdate={handleShowRacksChange} checked={showRacks}>
    Racks
</Checkbox>
                                    <div className={b('checkbox-wrapper')}>
                                        <Checkbox
                                            onUpdate={() => {
                                                setShowId(!showId);
                                            }}
                                            checked={showId}
                                        >
                                            ID
                                        </Checkbox>
                                    </div>
                                    <div className={b('checkbox-wrapper')}>
                                        <Checkbox
                                            onUpdate={() => {
                                                setShowRacks(!showRacks);
                                            }}
                                            checked={showRacks}
                                        >
                                            Racks
                                        </Checkbox>
                                    </div>

@artemmufazalov artemmufazalov marked this pull request as ready for review November 6, 2025 08:18
@@ -0,0 +1,4 @@
{
"all": "All",
"with-problems": "With problems"
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

26 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@artemmufazalov artemmufazalov added this pull request to the merge queue Nov 6, 2025
Merged via the queue into main with commit 73a104e Nov 6, 2025
7 checks passed
@artemmufazalov artemmufazalov deleted the problem-filter-to-query branch November 6, 2025 10:07
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.

3 participants