Skip to content

RI-8158: vector set similarity thunks and hooks#5871

Open
dantovska wants to merge 9 commits into
be/feature/RI-8159/vector-set-similarityfrom
feature/RI-8158/vector-set-similarity-1
Open

RI-8158: vector set similarity thunks and hooks#5871
dantovska wants to merge 9 commits into
be/feature/RI-8159/vector-set-similarityfrom
feature/RI-8158/vector-set-similarity-1

Conversation

@dantovska
Copy link
Copy Markdown
Contributor

@dantovska dantovska commented May 8, 2026

What

Adds the FE foundation for the vector-set similarity search feature — Redux state, thunks, and the consumer hook — without yet wiring up any UI components.

  • API endpoints: registered VECTOR_SET_SIMILARITY_SEARCH and VECTOR_SET_SIMILARITY_SEARCH_PREVIEW constants.
  • Vector-set slice (slices/browser/vectorSet.ts): added two new sub-slices — similaritySearch (results + loading/error) and similaritySearchPreview (BE-built VSIM command preview + loading/error) — with their load*/Success/Failure/clear* actions and selectors. Added the fetchVectorSetSimilaritySearch and fetchVectorSetSimilaritySearchPreview thunks. Both slices share the same payload shape since the FE only fires a preview once the form is valid.
  • Interfaces (slices/interfaces/vectorSet.ts): introduced VectorSetSimilaritySearchPayload, VectorSetSimilarityMatch, VectorSetSimilaritySearchResponse, and the matching slice-state + preview types.
  • useSimilaritySearch hook: pure form-state → BE-payload mapper plus debounced preview dispatch. Cancels and clears the preview slice when the form state can't map to a valid VSIM payload, and clears both slices when the selected key changes or the consumer unmounts.
  • Comprehensive Jest coverage for all of the above (slice reducers/selectors/thunks and every hook branch).
    The form/results components that consume this layer are intentionally not part of this PR — they are coming in a follow-up.

Testing

Following PR


Note

Medium Risk
Adds new Redux sub-slices and async thunks (including abortable preview requests) plus new hook logic, which can affect browser state management and request lifecycles. Also changes several existing vector-set thunks to fail with a default error message on non-2xx statuses, potentially altering user-visible error handling.

Overview
Lays the FE groundwork for Vector Set similarity search by adding new API endpoints plus Redux state/actions/selectors and thunks to execute similarity search and fetch a debounced, abortable backend-built VSIM command preview.

Introduces useSimilaritySearch (form-state→payload mapping, debounced preview dispatch, and automatic reset on key change/unmount) and useSimilaritySearchResults (exposes matches/hasResults), and exports them from the vector-set hooks index.

Refactors vector parsing helpers by exporting bytesToBase64 and validateVector for reuse, and expands Jest coverage for the new slice logic/thunks/hooks (including abort/cancel behavior).

Reviewed by Cursor Bugbot for commit 1ea2152. Bugbot is set up for automated code reviews on this repo. Configure here.

@dantovska dantovska self-assigned this May 8, 2026
@dantovska dantovska requested a review from a team as a code owner May 8, 2026 06:40
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 8, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@dantovska dantovska force-pushed the feature/RI-8158/vector-set-similarity-1 branch from 4262cf1 to f721686 Compare May 8, 2026 06:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 92.57% 15553/16802
🟡 Branches 74.67% 4882/6538
🟢 Functions 86.5% 2422/2800
🟢 Lines 92.4% 14869/16092

Test suite run success

3413 tests passing in 306 suites.

Report generated by 🧪jest coverage report action from 1ea2152

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.41% 17433/21953
🟡 Branches 61.88% 7967/12874
🟡 Functions 67.89% 2417/3560
🟡 Lines 78.97% 16397/20762

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 82.66% 24314/29415
🟡 Branches 67.88% 10228/15068
🟡 Functions 77.8% 6555/8425
🟢 Lines 83.13% 23760/28583

Test suite run success

6826 tests passing in 789 suites.

Report generated by 🧪jest coverage report action from 1ea2152

Comment thread redisinsight/ui/src/slices/browser/vectorSet.ts
Comment thread redisinsight/ui/src/slices/browser/vectorSet.ts
@dantovska dantovska force-pushed the feature/RI-8158/vector-set-similarity-1 branch from 62b579f to f78d4a7 Compare May 8, 2026 12:14
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f78d4a7. Configure here.

Comment thread redisinsight/ui/src/slices/browser/vectorSet.ts
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.

2 participants