Skip to content

RI-8158: vector set similarity form and table#5872

Open
dantovska wants to merge 16 commits into
feature/RI-8158/vector-set-similarity-1from
feature/RI-8158/vector-set-similarity-2
Open

RI-8158: vector set similarity form and table#5872
dantovska wants to merge 16 commits into
feature/RI-8158/vector-set-similarity-1from
feature/RI-8158/vector-set-similarity-2

Conversation

@dantovska
Copy link
Copy Markdown
Contributor

@dantovska dantovska commented May 8, 2026

What

Builds the similarity-search UI on top of the FE foundation landed in #vector-similarity-1 (slice + thunks + useSimilaritySearch hook).

  • Similarity search form (similarity-search-form/) — three self-contained components:
    • SimilaritySearchForm with vector / element mode toggle, vector or element input (with FP32 + numeric validation against the key's vectorDim), result count, filter expression, BE-built command preview, and a submit + reset action row.
    • CommandPreview — renders the BE-built VSIM preview the search would actually run, with copy-to-clipboard and a neutral placeholder while idle.
    • FilterSyntaxHelpPopover — inline help next to the filter field, listing supported operators and example expressions.
  • Submit button mirrors both the search and preview loading flags so the user can't dispatch a search before the preview has settled, and stays disabled until the form maps to a valid VSIM payload.
  • Reset button (IconButton to the left of "Find similar items") — clears the form's local state and dispatches the hook's resetSimilaritySearch to wipe slice state. The form also remounts on key change (key={keyName}), and the slice is cleared on key change / unmount, so the form is reset whenever the user navigates to another key, closes the key details, or otherwise leaves the view.
  • Similarity search results table (similarity-search-results/) — sorted by score with a "high match" highlight (HIGH_SIMILARITY_THRESHOLD = 0.85), reusing the existing Element rendering pipeline for compressor + view-format support. Replaces the regular vector-set element list in VectorSetDetails whenever a search has results.
  • Exposed bytesToBase64 and validateVector from vector-set-element-form/utils so the hook layer (from #vector-similarity-1) can build the BE payload from the form state without duplicating validation logic.
  • Re-exported QuantityCounter from @redis-ui/components via uiSrc/components/base/inputs.

Testing

Light Dark
image image
image image

Add vector set with elements + similarity search

Uploading Screen Recording 2026-05-08 at 14.22.07.mov…


Note

Medium Risk
Introduces new vector similarity-search UI and conditional rendering in VectorSetDetails, which changes user flows and relies on Redux slice/hook state; risk is mainly UI/state wiring regressions rather than security or data integrity.

Overview
Adds a vector set similarity search UI to key details: a new SimilaritySearchForm (vector/element mode, count + filter, reset, and a backend-driven command preview with copy) is rendered above the vector-set subheader.

Updates VectorSetDetails to swap the regular element list for a new SimilaritySearchResultsTable when similarity-search results exist, sorting by score and highlighting high-similarity matches.

Expands test coverage with new specs for the form, results formatting/sorting, and the details view’s conditional rendering, and re-exports QuantityCounter via the base inputs index for use in the form.

Reviewed by Cursor Bugbot for commit 4380b98. 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:45
@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-2 branch from b53a70e to 367f689 Compare May 8, 2026 06:49
@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.58% 15573/16821
🟡 Branches 74.65% 4879/6536
🟢 Functions 86.6% 2423/2798
🟢 Lines 92.41% 14884/16106

Test suite run success

3413 tests passing in 306 suites.

Report generated by 🧪jest coverage report action from 4380b98

@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.48% 17484/21997
🟡 Branches 61.94% 7993/12904
🟡 Functions 67.97% 2418/3557
🟡 Lines 79.04% 16441/20799

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 f546a1b. Configure here.

@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.74% 24446/29546
🟡 Branches 67.94% 10265/15110
🟡 Functions 77.89% 6599/8472
🟢 Lines 83.21% 23884/28705

Test suite run success

6867 tests passing in 793 suites.

Report generated by 🧪jest coverage report action from 4380b98

@dantovska dantovska force-pushed the feature/RI-8158/vector-set-similarity-1 branch from 62b579f to f78d4a7 Compare May 8, 2026 12:14
@dantovska dantovska force-pushed the feature/RI-8158/vector-set-similarity-2 branch from f546a1b to 95b3f98 Compare May 8, 2026 13:36
@dantovska dantovska force-pushed the feature/RI-8158/vector-set-similarity-2 branch 2 times, most recently from f34ed38 to 9681692 Compare May 10, 2026 20:25
@dantovska dantovska requested review from KrumTy and valkirilov May 11, 2026 11:14
@dantovska dantovska force-pushed the feature/RI-8158/vector-set-similarity-2 branch from 13af0a5 to f733fc4 Compare May 12, 2026 06:56
@dantovska dantovska force-pushed the feature/RI-8158/vector-set-similarity-1 branch from 1ea2152 to ae4b0ec Compare May 12, 2026 06:56
</ButtonGroup>
</FlexItem>
<FlexItem grow>
{state.mode === 'vector' ? (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I'm thinking of changing this to an enum, in case we use it in many places.


import { SimilaritySearchResultsTable } from './SimilaritySearchResultsTable'

faker.seed(8158)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need to fix the seeds for some reason?

@dantovska dantovska force-pushed the feature/RI-8158/vector-set-similarity-1 branch from ae4b0ec to 7e3e852 Compare May 12, 2026 11:27
@dantovska dantovska force-pushed the feature/RI-8158/vector-set-similarity-2 branch from f733fc4 to 4380b98 Compare May 12, 2026 11:27
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