Skip to content

Hide Vector Set similarity command preview behind a CLI toggle#5979

Open
dantovska wants to merge 13 commits into
mainfrom
fe/feature/vector-set-similarity-preview-toggle
Open

Hide Vector Set similarity command preview behind a CLI toggle#5979
dantovska wants to merge 13 commits into
mainfrom
fe/feature/vector-set-similarity-preview-toggle

Conversation

@dantovska
Copy link
Copy Markdown
Contributor

@dantovska dantovska commented May 28, 2026

What

Stacks on top of #5977. Reworks the similarity-search form's bottom row.

  • Reorder: Find similar items → Reset → CLI toggle → (optional) command preview.
  • Preview hidden by default. A new CLI icon-button toggles it; pressed state shows a filled background. When hidden, the preview pipeline is fully stopped — no debounced dispatches, no in-flight requests, no slice updates.
  • New `cancelSimilaritySearchPreview` helper on `useSimilaritySearch` cancels the debounce, aborts the in-flight preview, and clears the preview slice — used on toggle-off.
  • Action row has a fixed `min-height` matching the expanded preview so toggling no longer shifts the surrounding layout.
  • New `VECTOR_SET_SIMILARITY_SEARCH_COMMAND_PREVIEW_TOGGLED` telemetry event fires on every click with `state: 'shown' | 'hidden'`.

Testing

  • Open a vector set; the preview is hidden by default. Form, Find similar, Reset all still work.
  • Click the CLI toggle: preview appears showing the "Redis Command Preview" placeholder when the form is incomplete, the live VSIM command when valid.
  • Edit the form while the preview is on — command updates (debounced).
  • Toggle off — preview disappears, no further preview requests fire.
  • Layout doesn't shift between toggled states.
  • Confirm `VECTOR_SET_SIMILARITY_SEARCH_COMMAND_PREVIEW_TOGGLED` fires twice with the right `state` value.
  • `yarn lint:ui` ✅, `yarn type-check` ✅, similarity-search-form jest suite (27 tests) ✅.

🤖 Generated with Claude Code


Note

Low Risk
UI-only changes to the similarity search form and preview hook; no auth, data, or API contract changes beyond fewer optional preview requests when hidden.

Overview
The Vector Set similarity search form no longer shows the VSIM command preview by default. A CLI icon toggle reveals it; when hidden, runSimilaritySearchPreview is not called on form edits, so no debounced preview traffic runs in the background.

useSimilaritySearch adds cancelSimilaritySearchPreview, which cancels the debounce, aborts in-flight preview requests, and clears the preview slice without clearing search results—invoked when the user toggles the preview off. The bottom action row uses a fixed min-height so showing/hiding the preview does not shift layout. VECTOR_SET_SIMILARITY_SEARCH_COMMAND_PREVIEW_TOGGLED telemetry records shown / hidden on each toggle. Form tests cover default-hidden UI, preview gating, cancel on toggle-off, and telemetry.

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

dantovska and others added 5 commits May 28, 2026 13:35
…onsCell

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…t leak across key navigation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ey disappear from the table immediately

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dantovska dantovska requested a review from a team as a code owner May 28, 2026 12:28
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 28, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@dantovska dantovska removed the AI-Made label May 28, 2026
@dantovska dantovska self-assigned this May 28, 2026
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 2 potential issues.

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 409cc51. Configure here.

data-testid={`${TEST_ID}-submit`}
>
Find similar items
</PrimaryButton>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Submit button lost its loading spinner indicator

Medium Severity

The PrimaryButton previously received a loading={submitLoading} prop that displayed a spinner icon during in-flight requests. During the refactoring, submitLoading was renamed to isLoading and is still computed, but the loading prop was dropped from the JSX. The comment on isLoading ("so the user can see we are still resolving the command") confirms visual feedback was intended. Users now see a disabled button with no indication that work is in progress.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 409cc51. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it was causing a temporary flitch, which i didn't think is good. so this is fine

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 82.96% 24954/30078
🟡 Branches 68.23% 10491/15375
🟡 Functions 78.15% 6728/8609
🟢 Lines 83.42% 24363/29206

Test suite run success

7036 tests passing in 807 suites.

Report generated by 🧪jest coverage report action from d389d1f

dantovska and others added 2 commits May 28, 2026 17:47
…stConfig via table meta

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…Data with focused hook specs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dantovska dantovska force-pushed the fe/feature/vector-set-similarity-preview-toggle branch from fd03fe1 to eb2d004 Compare May 28, 2026 14:48
dantovska and others added 6 commits May 28, 2026 18:06
…ableMinWidth, emptyMessage)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…button

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ift on preview toggle

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…elemetry

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… as a plain IconButton

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dantovska dantovska force-pushed the fe/feature/vector-set-similarity-preview-toggle branch from eb2d004 to d389d1f Compare May 28, 2026 15:06
Base automatically changed from fe/feature/vector-set-similarity-actions to main May 29, 2026 11:09
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.

1 participant