nsarrazin HF Staff commited on
Commit
05aaf48
·
1 Parent(s): d0d8a0e

feat(tools): ux improvement assistant tool picker

Browse files
src/lib/components/AssistantToolPicker.svelte CHANGED
@@ -110,17 +110,23 @@
110
  <div
111
  class="invisible absolute z-10 mt-1 w-full rounded border border-gray-300 bg-white shadow-lg group-focus-within:visible"
112
  >
113
- {#each suggestions as suggestion}
114
- <button
115
- on:click|stopPropagation|preventDefault={() => addValue(suggestion)}
116
- class="w-full cursor-pointer px-3 py-2 text-left hover:bg-blue-500 hover:text-white"
117
- >
118
- {suggestion.displayName}
119
- {#if suggestion.createdByName}
120
- <span class="text-xs text-gray-500"> by {suggestion.createdByName}</span>
121
- {/if}
122
- </button>
123
- {/each}
 
 
 
 
 
 
124
  </div>
125
  {/if}
126
  </div>
 
110
  <div
111
  class="invisible absolute z-10 mt-1 w-full rounded border border-gray-300 bg-white shadow-lg group-focus-within:visible"
112
  >
113
+ {#if inputValue === ""}
114
+ <p class="px-3 py-2 text-left text-xs text-gray-500">
115
+ Start typing to search for tools...
116
+ </p>
117
+ {:else}
118
+ {#each suggestions as suggestion}
119
+ <button
120
+ on:click|stopPropagation|preventDefault={() => addValue(suggestion)}
121
+ class="w-full cursor-pointer px-3 py-2 text-left hover:bg-blue-500 hover:text-white"
122
+ >
123
+ {suggestion.displayName}
124
+ {#if suggestion.createdByName}
125
+ <span class="text-xs text-gray-500"> by {suggestion.createdByName}</span>
126
+ {/if}
127
+ </button>
128
+ {/each}
129
+ {/if}
130
  </div>
131
  {/if}
132
  </div>