Skip to content

Conversation

@artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Nov 18, 2025

Part of #2892

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

Goal: manipulate values from useSetting in hook instead of store with direct LS access

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: 66.12 MB | Main: 66.12 MB
Diff: 0.37 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.

@artemmufazalov artemmufazalov changed the title refactor(SavedQueries): move queries manipulations to hook fix(SavedQueries): move queries manipulations to hook Nov 18, 2025
@artemmufazalov
Copy link
Member Author

greptile-review

Copilot finished reviewing on behalf of artemmufazalov November 18, 2025 19:48
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 saved queries management by moving manipulation logic from Redux thunks with direct localStorage access into a React hook (useSavedQueries). The changes consolidate filtering, deletion, and saving operations into a single hook that uses the useSetting hook for state management.

  • Removes Redux thunks (deleteSavedQuery, saveQuery) from the queryActions slice
  • Consolidates saved queries logic in the useSavedQueries hook including filtering, deletion, and saving
  • Updates consuming components to use the new hook API instead of dispatching Redux actions

Reviewed Changes

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

Show a summary per file
File Description
src/store/reducers/queryActions/queryActions.ts Removed deleteSavedQuery and saveQuery thunks that directly accessed localStorage
src/containers/Tenant/Query/utils/useSavedQueries.tsx Added query manipulation functions (deleteSavedQuery, saveQuery) and consolidated filtering logic within the hook
src/containers/Tenant/Query/SavedQueries/SavedQueries.tsx Updated to destructure filteredSavedQueries and deleteSavedQuery from the hook instead of using separate hooks and Redux dispatch
src/containers/Tenant/Query/SaveQuery/SaveQuery.tsx Updated to use hook-based saveQuery function and pass it as props to the dialog instead of dispatching Redux actions
src/containers/Tenant/Query/QueryEditor/helpers.ts Updated to destructure savedQueries from the hook return value

@artemmufazalov artemmufazalov marked this pull request as ready for review November 18, 2025 20:20
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 18, 2025

Skipped: This PR does not contain any of your configured keywords: (greptile-review)

@artemmufazalov artemmufazalov added this pull request to the merge queue Nov 19, 2025
Merged via the queue into main with commit deed421 Nov 19, 2025
15 checks passed
@artemmufazalov artemmufazalov deleted the rework-saved-queries branch November 19, 2025 07:49
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