Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sanity): do not perform incremental search for exact tokens #7972

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

juice49
Copy link
Contributor

@juice49 juice49 commented Dec 6, 2024

Description

When using the textSearch or (upcoming) groq2024 search strategy, Studio provides an incremental (aka search-as-you-type) experience by appending a wildcard * operator to the final plain (e.g. non-negation) token found in the search query.

Currently, Studio appends this wildcard even if the token is an exact match (encased in quote marks). This behaviour is incorrect. It is both unexpected from a UX perspective to have an exact match token automatically given a wildcard suffix, and unsupported by the groq2024 search backend.

What to review

  • Does the approach seem reasonable?

Testing

  • Tested various search queries.
  • Updated unit tests in packages/sanity/src/core/search/text-search/createTextSearch.test.ts.

Copy link

vercel bot commented Dec 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 9:30am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 9:30am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 9:30am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 9:30am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Dec 9, 2024 9:30am

Copy link
Contributor

github-actions bot commented Dec 6, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Dec 6, 2024

⚡️ Editor Performance Report

Updated Mon, 09 Dec 2024 09:33:47 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 22.2 efps (45ms) 25.0 efps (40ms) -5ms (-11.1%)
article (body) 53.5 efps (19ms) 63.3 efps (16ms) -3ms (-15.5%)
article (string inside object) 25.0 efps (40ms) 25.0 efps (40ms) +0ms (-/-%)
article (string inside array) 21.7 efps (46ms) 23.3 efps (43ms) -3ms (-6.5%)
recipe (name) 40.0 efps (25ms) 43.5 efps (23ms) -2ms (-8.0%)
recipe (description) 47.6 efps (21ms) 52.6 efps (19ms) -2ms (-9.5%)
recipe (instructions) 99.9+ efps (7ms) 99.9+ efps (7ms) +0ms (-/-%)
synthetic (title) 17.5 efps (57ms) 17.5 efps (57ms) +0ms (-/-%)
synthetic (string inside object) 17.9 efps (56ms) 18.9 efps (53ms) -3ms (-5.4%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 45ms 51ms 64ms 184ms 231ms 11.9s
article (body) 19ms 23ms 39ms 99ms 118ms 5.7s
article (string inside object) 40ms 41ms 43ms 189ms 136ms 7.1s
article (string inside array) 46ms 49ms 57ms 94ms 375ms 7.6s
recipe (name) 25ms 26ms 34ms 48ms 0ms 8.4s
recipe (description) 21ms 22ms 24ms 30ms 0ms 4.9s
recipe (instructions) 7ms 10ms 11ms 21ms 0ms 3.4s
synthetic (title) 57ms 60ms 72ms 224ms 495ms 14.5s
synthetic (string inside object) 56ms 59ms 68ms 100ms 348ms 7.9s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 40ms 42ms 47ms 182ms 213ms 13.6s
article (body) 16ms 18ms 21ms 87ms 204ms 5.4s
article (string inside object) 40ms 43ms 46ms 176ms 166ms 6.8s
article (string inside array) 43ms 46ms 50ms 170ms 140ms 7.0s
recipe (name) 23ms 25ms 39ms 45ms 3ms 7.5s
recipe (description) 19ms 21ms 23ms 42ms 0ms 4.7s
recipe (instructions) 7ms 10ms 12ms 36ms 0ms 3.7s
synthetic (title) 57ms 60ms 65ms 109ms 771ms 14.8s
synthetic (string inside object) 53ms 56ms 66ms 486ms 963ms 8.9s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

Copy link
Contributor

github-actions bot commented Dec 6, 2024

Component Testing Report Updated Dec 9, 2024 9:31 AM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 9s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 38s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 53s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 28s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 15s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 2m 33s 1 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 10s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 2m 52s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 46s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 13s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 41s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 53s 12 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

@juice49 juice49 marked this pull request as ready for review December 6, 2024 14:40
@juice49 juice49 requested a review from a team as a code owner December 6, 2024 14:40
@juice49 juice49 requested review from rexxars and removed request for a team December 6, 2024 14:40
Copy link
Contributor

@pedrobonamin pedrobonamin left a comment

Choose a reason for hiding this comment

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

Thanks for this @juice49 , it looks good to me and it's well explained by the added tests.

@juice49 juice49 added this pull request to the merge queue Dec 9, 2024
Merged via the queue into next with commit 9fba9b7 Dec 9, 2024
57 checks passed
@juice49 juice49 deleted the fix/incremental-search-exact-token branch December 9, 2024 15:13
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.

2 participants