From 079990fd1b0d73704d07d49821261943e3a24bb7 Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Wed, 16 Nov 2022 15:45:45 -0500 Subject: [PATCH] Updates graph search - adds search history hint in search placeholder - adds `@me` filter to search helper --- src/webviews/apps/shared/components/search/search-box.ts | 2 +- src/webviews/apps/shared/components/search/search-input.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/webviews/apps/shared/components/search/search-box.ts b/src/webviews/apps/shared/components/search/search-box.ts index af17be6..b1f620f 100644 --- a/src/webviews/apps/shared/components/search/search-box.ts +++ b/src/webviews/apps/shared/components/search/search-box.ts @@ -187,7 +187,7 @@ export class SearchBox extends FASTElement { label = 'Search'; @attr - placeholder = 'Search commits, e.g. "Updates dependencies" author:eamodio'; + placeholder = 'Search commits (↑↓ for history), e.g. "Updates dependencies" author:eamodio'; @attr value = ''; diff --git a/src/webviews/apps/shared/components/search/search-input.ts b/src/webviews/apps/shared/components/search/search-input.ts index 13f93be..6392e5e 100644 --- a/src/webviews/apps/shared/components/search/search-input.ts +++ b/src/webviews/apps/shared/components/search/search-input.ts @@ -162,6 +162,9 @@ const template = html` + `; @@ -519,6 +522,10 @@ export class SearchInput extends FASTElement { this.value += `${this.value.length > 0 ? ' ' : ''}${token}`; window.requestAnimationFrame(() => { this.debouncedUpdateHelpText(); + // `@me` can be searched right away since it doesn't need additional text + if (token === '@me') { + this.debouncedEmitSearch(); + } this.input.focus(); }); }