Skip to content

Conversation

@LDrago27
Copy link
Collaborator

Description

Currently there is an issue while inserting the first query snippet suggestion, the first character was being truncated.

Previously we used to computed what was the difference between the suggestion and typed word and using only the difference to insert the suggestion. However this had an issue when we were starting a query initially the replace range wasn't correct, this caused the first character to be truncated.

In this change instead of doing the above we are doing a token based comparison for insertText, where we skip all the fully matching tokens and only insert the partially matching and non matching tokens.

Issues Resolved

Screenshot

Testing the changes

Meeting+Recording+-+Sahoo.+Suchit+Instant+Meeting.38.mp4

Changelog

  • fix: First character being trimmed during Query Snippet Insertion

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@LDrago27 LDrago27 added the OSD Changes being merged by the OSD team label Nov 11, 2025
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.76%. Comparing base (b9341e5) to head (74b2ec2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10901      +/-   ##
==========================================
- Coverage   60.76%   60.76%   -0.01%     
==========================================
  Files        4533     4533              
  Lines      122164   122171       +7     
  Branches    20471    20472       +1     
==========================================
+ Hits        74232    74234       +2     
- Misses      42695    42698       +3     
- Partials     5237     5239       +2     
Flag Coverage Δ
Linux_1 26.57% <10.00%> (-0.01%) ⬇️
Linux_2 38.92% <ø> (ø)
Linux_3 39.43% <100.00%> (+<0.01%) ⬆️
Linux_4 ?
Windows_1 26.58% <10.00%> (-0.01%) ⬇️
Windows_2 38.90% <ø> (ø)
Windows_3 39.44% <100.00%> (+<0.01%) ⬆️
Windows_4 33.75% <10.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LDrago27 LDrago27 removed the OSD Changes being merged by the OSD team label Nov 11, 2025
@LDrago27 LDrago27 merged commit 500198b into opensearch-project:main Nov 11, 2025
132 of 135 checks passed
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.

5 participants