search_pill: Rename non-user type to 'generic_operator'.

This change is meant to remove confusion between a pill's `type` being
"search" and its `operator` being "search".
This commit is contained in:
Evy Kassirer
2025-06-04 22:01:42 -07:00
committed by Tim Abbott
parent ca48ffccb8
commit 58f5f499fc
2 changed files with 3 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ export type SearchUserPill = {
type SearchPill =
| {
type: "search";
type: "generic_operator";
operator: string;
operand: string;
negated: boolean | undefined;
@@ -51,7 +51,7 @@ export function create_item_from_search_string(search_string: string): SearchPil
return undefined;
}
return {
type: "search",
type: "generic_operator",
operator: search_term.operator,
operand: search_term.operand,
negated: search_term.negated,

View File

@@ -407,7 +407,7 @@ run_test("set_search_bar_contents with duplicate pills", () => {
const pills = search.search_pill_widget._get_pills_for_testing();
assert.equal(pills.length, 1);
assert.deepEqual(pills[0].item, {
type: "search",
type: "generic_operator",
operator: "has",
operand: "attachment",
negated: false,