RI-8317 Detect and highlight large vector embeddings in the query editor#6215
Open
dantovska wants to merge 7 commits into
Open
RI-8317 Detect and highlight large vector embeddings in the query editor#6215dantovska wants to merge 7 commits into
dantovska wants to merge 7 commits into
Conversation
Contributor
Code Coverage - Frontend unit tests
Test suite run success7843 tests passing in 866 suites. Report generated by 🧪jest coverage report action from 415ca0c |
dantovska
force-pushed
the
fe/feature/RI-8317/detect-large-vector-embeddings
branch
from
July 20, 2026 10:33
d25aecb to
5a9bf1b
Compare
Add a pure, source-agnostic detector that scans query text and returns marks (range + metadata) for every large vector embedding it finds: binary FLOAT32 "\x" blobs (validated with isBinaryVector) and numeric arrays with >= 10 elements. Each mark carries range, format, byte size, dimensions, a first-3/last-2 preview, and the FT.SEARCH PARAMS argument name when applicable. Expose the marks through a useVectorEmbeddingMarks hook composed inside useQueryEditor, so both the Workbench and Vector Search editors receive them with no extra wiring. Recomputes on query change. Data only, no user-visible change yet; the collapse-rendering ticket consumes these marks. References: #RI-8317
Render a subtle inline background (plus a hover tooltip showing format, dimensions and byte size) behind every embedding surfaced by useVectorEmbeddingMarks. The new useVectorEmbeddingDecorations hook maps each mark's character range to a Monaco range and applies decorations, mirroring the existing useQueryDecorations pattern. Composed inside useQueryEditor, so both the Workbench and Vector Search editors show the highlight. Adds a themed .monaco-vector-embedding style. References: #RI-8317
Move the embedding highlight out of the shared CodeEditor into a self-contained VectorEmbeddingHighlight component (styles + detection + decoration logic) so it can grow independently. CodeEditor and useQueryEditor are no longer touched by embedding concerns; the component is rendered next to the editor in Workbench and Vector Search. Also move the VectorEmbeddingMark/VectorEmbeddingFormat types into a dedicated vectorEmbeddingUtils.types.ts and trim non-essential comments. References: #RI-8317
dantovska
force-pushed
the
fe/feature/RI-8317/detect-large-vector-embeddings
branch
from
July 20, 2026 10:51
5a9bf1b to
5a97a26
Compare
- i18n the embedding hover tooltip (en/bg) instead of a hardcoded English string, and stop exposing the raw format enum to users - extract a buildMark helper to remove duplication between the two detection branches - keep style import last and trim the highlight barrel to a single export References: #RI-8317
dantovska
force-pushed
the
fe/feature/RI-8317/detect-large-vector-embeddings
branch
from
July 20, 2026 11:00
5a97a26 to
5952bbb
Compare
Drop the border; keep just a neutral greyish background with a small radius behind detected embeddings. References: #RI-8317
dantovska
marked this pull request as ready for review
July 20, 2026 12:09
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 221b066167
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
PARAMS <nargs> counts the tokens that follow (each name and value), not name/value pairs, so the PARAMS lookup must iterate nargs / 2 pairs. Using nargs directly walked past the params list on multi-param queries and could stamp a bogus paramName on an embedding outside PARAMS. Add regression tests for multi-param and trailing non-param blobs. References: #RI-8317
valkirilov
reviewed
Jul 20, 2026
| --monaco-color-bg: ${bgColor}; | ||
| --monaco-color-params: ${colors.text.discovery200}; | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds detection for large vector embeddings in the query editor, plus a subtle highlight so they're visible.
utils/monaco/vectorEmbeddingUtils.ts):detectVectorEmbeddings(query)scans query text and returns a mark per embedding. Two formats:\xblobs, validated with the existingisBinaryVectorheuristic;Each mark carries range, format, byte size, dimensions, a first-3/last-2 preview, and the FT.SEARCH
PARAMSargument name when applicable (located viasplitQueryByArgs). Thresholds are named constants; marks/types live in their own file.useVectorEmbeddingMarkshook exposes the marks, recomputed on query change.VectorEmbeddingHighlight— a self-contained component (own styles + detection + Monaco decorations) rendered next to the editor in both Workbench and Vector Search. It paints a subtle grey background behind each embedding, with an i18n hover showing dimensions and byte size. The sharedCodeEditor/useQueryEditorare left untouched so the embedding logic can grow independently.Testing
Unit tests —
utils/tests/monaco/vectorEmbeddingUtils.spec.tscover both formats, multiple embeddings in one query, threshold edges, non-vector strings, andPARAMSname extraction:Manual — open a database → Workbench or Vector Search editor and paste the query below:
The
my_blobembedding value should render with a subtle grey background (slightly greyed out on both light and dark themes), and hovering it should show the dimensions and byte size.Closes #RI-8317
Note
Low Risk
Editor-only UI and pure string parsing; no server, auth, or query execution changes. Main risk is false-positive highlights on large numeric arrays or regex edge cases in unusual query text.
Overview
Adds detection and in-editor highlighting for large vector embeddings in Workbench and Vector Search query editors, without changing the shared
CodeEditor/useQueryEditorlifecycle.detectVectorEmbeddingsscans query text for binary FLOAT32\xblobs (via existingisBinaryVector) and numeric arrays with ≥10 elements, returning marks with range, dimensions, byte size, previews, and optional FT.SEARCHPARAMSargument names fromsplitQueryByArgs.A self-contained
VectorEmbeddingHighlightcomponent (hooks + global.monaco-vector-embeddingstyles) applies Monaco inline decorations and an i18n hover (dimensions / byte size). It is mounted next to the editor in WorkbenchQueryandVectorSearchEditor, sharingmonacoObjectsfrom query editor context.Unit coverage lives in
vectorEmbeddingUtils.spec.ts(thresholds, multiple embeddings, PARAMS mapping).Reviewed by Cursor Bugbot for commit 415ca0c. Bugbot is set up for automated code reviews on this repo. Configure here.