Browse Source

Updates graph search

- adds search history hint in search placeholder
- adds `@me` filter to search helper
main
Keith Daulton 2 years ago
parent
commit
079990fd1b
2 changed files with 8 additions and 1 deletions
  1. +1
    -1
      src/webviews/apps/shared/components/search/search-box.ts
  2. +7
    -0
      src/webviews/apps/shared/components/search/search-input.ts

+ 1
- 1
src/webviews/apps/shared/components/search/search-box.ts View File

@ -187,7 +187,7 @@ export class SearchBox extends FASTElement {
label = 'Search'; label = 'Search';
@attr @attr
placeholder = 'Search commits, e.g. "Updates dependencies" author:eamodio';
placeholder = 'Search commits (↑↓ for history), e.g. "Updates dependencies" author:eamodio';
@attr @attr
value = ''; value = '';

+ 7
- 0
src/webviews/apps/shared/components/search/search-input.ts View File

@ -162,6 +162,9 @@ const template = html`
<button class="helper-button" type="button" @click="${(x, _c) => x.handleInsertToken('change:')}"> <button class="helper-button" type="button" @click="${(x, _c) => x.handleInsertToken('change:')}">
Change <small>change: or ~:</small> Change <small>change: or ~:</small>
</button> </button>
<button class="helper-button" type="button" @click="${(x, _c) => x.handleInsertToken('@me')}">
My changes <small>@me</small>
</button>
</div> </div>
</template> </template>
`; `;
@ -519,6 +522,10 @@ export class SearchInput extends FASTElement {
this.value += `${this.value.length > 0 ? ' ' : ''}${token}`; this.value += `${this.value.length > 0 ? ' ' : ''}${token}`;
window.requestAnimationFrame(() => { window.requestAnimationFrame(() => {
this.debouncedUpdateHelpText(); this.debouncedUpdateHelpText();
// `@me` can be searched right away since it doesn't need additional text
if (token === '@me') {
this.debouncedEmitSearch();
}
this.input.focus(); this.input.focus();
}); });
} }

Loading…
Cancel
Save