Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Jul 5, 2025

Description

This PR restores the search score threshold slider feature that was accidentally deleted in PR #5041

Problem

  1. The search score threshold slider was removed from the CodeIndexPopover component
  2. When the slider existed, setting the value to 0 would cause it to reset to the default value (0.4) upon saving
  3. The value was not being properly persisted in the global state

Changes Made

  • Added missing field to WebviewMessage type: Added codebaseIndexSearchMinScore to the codeIndexSettings interface
  • Fixed state persistence: Updated saveCodeIndexSettingsAtomic handler to include codebaseIndexSearchMinScore when saving to global state
  • Initialized field in ExtensionStateContext: Added codebaseIndexSearchMinScore: undefined to the default state
  • Fixed falsy value handling: Changed all logical OR operators to nullish coalescing operators in CodeIndexPopover.tsx to properly handle 0 values
  • Verified schema: Confirmed that codebaseIndexSearchMinScore is already defined in the codebaseIndexConfigSchema

Testing

  • All existing tests pass
  • Manually tested setting the search score threshold to 0
  • Verified the value persists after saving settings
  • Confirmed the slider displays the correct value after reopening the popover

Related Issues

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No breaking changes
  • All tests pass

Important

Restores search score threshold slider and fixes persistence of codebaseIndexSearchMinScore in CodeIndexPopover and global state.

  • Behavior:
    • Restores search score threshold slider in CodeIndexPopover.tsx.
    • Fixes persistence of codebaseIndexSearchMinScore in global state via saveCodeIndexSettingsAtomic in webviewMessageHandler.ts.
    • Handles 0 values correctly using nullish coalescing in CodeIndexPopover.tsx.
  • State Management:
    • Adds codebaseIndexSearchMinScore to WebviewMessage type in WebviewMessage.ts.
    • Initializes codebaseIndexSearchMinScore in ExtensionStateContext.tsx.
  • Schema:
    • Confirms codebaseIndexSearchMinScore is defined in codebaseIndexConfigSchema in codebase-index.ts.

This description was created by Ellipsis for ec55274. You can customize this summary. It will automatically update as commits are pushed.

…5041)

- Add codebaseIndexSearchMinScore to WebviewMessage type definition
- Include codebaseIndexSearchMinScore in saveCodeIndexSettingsAtomic handler
- Initialize codebaseIndexSearchMinScore in ExtensionStateContext
- Fix logical OR operators to use nullish coalescing for proper 0 value handling
- Ensure search threshold values persist correctly when saving settings

This restores the deleted feature from PR #5041 and fixes the issue where
the search score threshold value was being reset upon saving.
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners July 5, 2025 02:56
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working UI/UX UI/UX related or focused labels Jul 5, 2025
@daniel-lxs daniel-lxs changed the title fix: restore search score threshold slider and fix value persistence fix: restore search score threshold slider Jul 5, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jul 5, 2025

No security or compliance issues detected. Reviewed everything up to ec55274.

Security Overview
  • 🔎 Scanned files: 5 changed file(s)
Detected Code Changes
Change Type Relevant files
Bug Fix ► codebase-index.ts
    Add search score constants
► webviewMessageHandler.ts
    Add codebaseIndexSearchMinScore to settings handler
► WebviewMessage.ts
    Add codebaseIndexSearchMinScore type
► CodeIndexPopover.tsx
    Restore search score threshold slider and value persistence
► ExtensionStateContext.tsx
    Initialize codebaseIndexSearchMinScore

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 5, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 5, 2025
@mrubens mrubens merged commit 49af895 into main Jul 5, 2025
33 of 34 checks passed
@mrubens mrubens deleted the fix/issue-5041-restore-search-threshold-slider branch July 5, 2025 12:04
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 5, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants