getsentry / getsentry/sentry

Improve smart search bar functionality for quoted values

Open
#44,543 2 comments 0 reactions 0 assignees View on GitHub
Component: Core Frontend (React)
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
1d 5h
Merged PRs (30d)
624

Description

### Problem Statement

The fact that there are spaces in some values makes it hard to use the smart search sometimes (reported in Discover). If I have a transaction called `GET /api/whatever`, I might be inclined to start typing `transaction:GET /`, but that doesn't work because we really need quotes around the whole thing.

If I start with a double quote and get to a space, the token turns red and alerts me that there is an issue (but this is confusing because I'm not done yet).

https://user-images.githubusercontent.com/22846452/218589591-facd7391-dfb0-4391-b1db-f8ada4e77b77.mov

In this case the autocomplete isn't showing me potential values because it's looking to start adding another key.

### Solution Brainstorm

A potential solution is that if the user starts adding a `"` then we automatically add the closing `"` and put the cursor between the two. This is nice because it maintains the autocomplete suggestions.

I don't really have a solution for when you type without quotes. Maybe its possible to get the parser to greedily group characters together unless it appears to be a field/tag/operator? That could have conflicts with values that look like field/tag/operators though. It also doesn't seem easy to make it dynamic for all custom tags in a project.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.