Skip to content

Commit

Permalink
Updates graph search
Browse files Browse the repository at this point in the history
- adds search history hint in search placeholder
- adds `@me` filter to search helper
  • Loading branch information
d13 committed Nov 16, 2022
1 parent 4be5db1 commit 079990f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/webviews/apps/shared/components/search/search-box.ts
Expand Up @@ -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 = '';
Expand Down
7 changes: 7 additions & 0 deletions src/webviews/apps/shared/components/search/search-input.ts
Expand Up @@ -162,6 +162,9 @@ const template = html<SearchInput>`
<button class="helper-button" type="button" @click="${(x, _c) => x.handleInsertToken('change:')}">
Change <small>change: or ~:</small>
</button>
<button class="helper-button" type="button" @click="${(x, _c) => x.handleInsertToken('@me')}">
My changes <small>@me</small>
</button>
</div>
</template>
`;
Expand Down Expand Up @@ -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();
});
}
Expand Down

0 comments on commit 079990f

Please sign in to comment.