Skip to content

RED-195979: Gate vector search enhancements behind vs-enhancements flag - #6291

Open
dantovska wants to merge 12 commits into
mainfrom
fe/feature/dev-vs-enhancements-flag
Open

RED-195979: Gate vector search enhancements behind vs-enhancements flag#6291
dantovska wants to merge 12 commits into
mainfrom
fe/feature/dev-vs-enhancements-flag

Conversation

@dantovska

@dantovska dantovska commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Adds a new vectorSearchEnhancements feature flag and puts the three vector search enhancement tickets behind it:

  • RI-8317 / RI-8326 — detecting, highlighting and collapsing large vector embeddings in the query editor. The VectorEmbeddingHighlight component (which owns all three behaviors) is gated in both the Vector Search editor and the Workbench editor.
  • RI-8171 — creating an index when the database has no data. This changed existing behavior in place, so when the flag is off the pre-enhancement create-index flow is faithfully restored (legacy keys-probe gating on the welcome screen and create-index menu, browse-only mode, original button label and tooltips). The manual-creation UI stays hidden because isManualCreation is forced false.

Registered as a regular, switchable flag (SwitchableFlagStrategy): backend features-config.json (flag: true, perc: [[0, 100]], filters: []) / KnownFeatures / known-features / feature-flag.provider, and FE FeatureFlags enum + features.ts + isVectorSearchEnhancementsEnabledSelector. Enabled by default for all users; overridable per-user via ~/.redis-insight/config.json.

Note: a few i18n keys removed by RI-8171 were re-added (plus a temporary useMyDatabaseLegacy label) to support the flag-off path — remove them when the flag is eventually retired.

Testing

  1. With the flag on (default): large embeddings are highlighted/collapsed in the Vector Search and Workbench editors; manual index creation with no data works (key-type selector, command view); welcome/list actions use the "Create index" copy and stay enabled.
  2. With the flag toggled off (via config.json): the legacy UX is restored — the welcome "Use data from my database" button is disabled with a tooltip when the DB has no Hash/JSON keys, the create-index menu's "Use existing data" is likewise gated, browse-only routing, and no embedding highlight/collapse.

Automated: npm run type-check (no new errors), ESLint clean, affected UI + backend feature specs pass, plus a Playwright flag on/off scenario.


Closes RI-8171
Closes RI-8317
Closes RI-8326


Note

Medium Risk
Multiple vector-search entry and create-index code paths branch on the flag, so incorrect gating could change UX or editor query text; the unmount restore mitigates leaving collapsed placeholders in the editor.

Overview
Introduces vectorSearchEnhancements as a switchable feature flag (API config + UI selector, enabled by default). When on, Vector Search and Workbench render VectorEmbeddingHighlight, and the enhanced create-index path applies (e.g. manual creation when the DB has no Hash/JSON keys, “Create index” copy, keys probe on the browse flow). When off, the prior behavior is restored: bounded useHasExistingKeys only on vector-search entry routes, disabled welcome/list actions with tooltips when no keys, browse-only create index, and legacy button labels (re-added i18n strings).

useVectorEmbeddingCollapse now expands collapsed embeddings and clears decorations on unmount so toggling the flag at runtime does not leave placeholder chips in the Monaco model. useHasExistingKeys gains an optional bounded scan (count/scanThreshold of 1) and probe-based loading so re-enabling triggers a fresh scan.

Tests cover flag gating (including Playwright welcome on/off) and the collapse unmount behavior; Monaco mocks pick up getFullModelRange / isDisposed.

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

@dantovska
dantovska requested a review from a team as a code owner July 24, 2026 13:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 000027950e

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

Comment thread redisinsight/api/config/features-config.json Outdated
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 93.15% 16527/17743
🟡 Branches 75.37% 5303/7036
🟢 Functions 87.46% 2532/2895
🟢 Lines 93% 15804/16993

Test suite run success

3721 tests passing in 322 suites.

Report generated by 🧪jest coverage report action from 2475779

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.91% 18363/22979
🟡 Branches 62.22% 8553/13745
🟡 Functions 67.93% 2498/3677
🟡 Lines 79.53% 17293/21743

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 815a747c66

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

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.29% 28205/33865
🟡 Branches 69.41% 12037/17341
🟡 Functions 78.28% 7473/9546
🟢 Lines 83.76% 27447/32770

Test suite run success

7885 tests passing in 871 suites.

Report generated by 🧪jest coverage report action from 2475779

Comment thread redisinsight/ui/src/slices/app/features.ts
@dantovska dantovska self-assigned this Jul 24, 2026
@dantovska dantovska changed the title RI-8171/RI-8317/RI-8326 Gate vector search enhancements behind dev-vs-enhancements flag RED-195979: Gate vector search enhancements behind dev-vs-enhancements flag Jul 25, 2026
valkirilov
valkirilov previously approved these changes Jul 27, 2026
Comment thread redisinsight/api/config/features-config.json Outdated
Comment thread redisinsight/api/config/features-config.json Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c55c1bcce6

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using default effort and found 1 potential issue.

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

Comment thread redisinsight/api/config/features-config.json

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f6083a3a3a

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

KrumTy
KrumTy previously approved these changes Jul 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa52f91496

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

@dantovska dantovska changed the title RED-195979: Gate vector search enhancements behind dev-vs-enhancements flag RED-195979: Gate vector search enhancements behind vs-enhancements flag Jul 27, 2026
dantovska and others added 8 commits July 27, 2026 16:51
…flag

Add the dev-vs-enhancements dev feature flag and hide the RI-8171,
RI-8317 and RI-8326 vector search enhancements behind it.

- RI-8317/8326: gate the embedding highlight/collapse (VectorEmbeddingHighlight)
  in both the Vector Search and Workbench editors.
- RI-8171: restore the pre-enhancement create-index flow when the flag is
  off (legacy keys probe gating, browse-only mode, original labels/tooltips).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- e2e: welcome-screen entry differs with the flag on ("Create index",
  enabled) vs off (legacy "Use data from my database", disabled without
  keys); enable the flag for the no-keys manual-creation e2e spec.
- unit: assert the query editor embedding highlight is gated by the flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- features-config: add explicit `filters: []` to the dev flag. Without it
  CommonFlagStrategy's `filter(undefined)` throws and returns the inverted
  fallback (`!flag`), which would enable the flag for everyone by default.
- useHasExistingKeys: derive `loading` from the pending probe so it is true
  from the first render a probe is needed, avoiding a one-frame manual-creation
  flash when the flag resolves after the create-index page mounts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- useHasExistingKeys: include `encoding` in the probe key so an
  encoding-triggered re-check surfaces `loading` (was stuck false).
- VectorSearchProvider/welcome/list: propagate the probe `error` and keep
  the legacy "existing data" entry available on a failed/inconclusive probe
  instead of wrongly reporting "no keys", matching the create-index page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Match the peer dev-flag selector convention (isDevLanguage/isArray) by
returning true from isVectorSearchEnhancementsEnabledSelector in development,
and route the embedding-highlight gate through the same selector instead of
FeatureFlagComponent so both halves of the feature toggle consistently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Rename dev-vs-enhancements → vectorSearchEnhancements (regular camelCase flag).
- Register with SwitchableFlagStrategy; config flag:true, perc [[0,100]],
  filters:[] so it is on by default and user-overridable via config.json.
- Drop explanatory comments now that the code is self-explanatory.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- useHasExistingKeys: clear the completed-probe marker when disabled so a
  re-enable for the same instance/route/encoding (e.g. the switchable flag
  toggled at runtime) re-scans and shows loading instead of stale results.
- Drop the dead commented-out isDevelopment branch from the selector.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dantovska and others added 3 commits July 27, 2026 16:51
…ment

Restore the `isDevelopment` bypass so the selector matches the peer
dev-flag selectors (isArray/isDevLanguage). e2e/prod builds are non-dev,
so the flag still governs there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Only the welcome and list entry points consume useHasExistingKeys, but the
provider wraps every vector-search route. Gate the probe on the base route
so navigating to create-index/query pages no longer fires unused key scans.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ount

- i18n: move welcome.checkingKeys / welcome.noKeysFound into alphabetical
  order in en/bg locales (i18n convention).
- useVectorEmbeddingCollapse: on unmount (e.g. the switchable flag turned off
  at runtime) expand collapsed embeddings back into the model and clear the
  decorations, so the editor is never left with an inert placeholder chip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dantovska
dantovska force-pushed the fe/feature/dev-vs-enhancements-flag branch from b293cd6 to bd99314 Compare July 27, 2026 13:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd99314442

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

The entry-route probe that gates the legacy "existing data" flow only needs
to know whether any Hash/JSON key exists, so run it with count:1 and
scanThreshold:1 instead of walking the default 10k-key threshold. The
create-index browse-flow probe keeps its thorough scan.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants