4646 >
4747 <div class =" mention-popup" >
4848 <!-- 文件列表 -->
49- <div v-if =" mentionItems.files.length > 0" class =" mention-group" >
49+ <div v-if =" mentionItems.files.length > 0 || showFileSearchPrompt " class =" mention-group" >
5050 <div class =" mention-group-title" >文件</div >
51- <div
52- v-for =" (item, index) in mentionItems.files"
53- :key =" 'file-' + item.value"
54- :class =" ['mention-item', { active: isItemSelected('file', index) }]"
55- @click =" insertMention(item)"
56- >
57- {{ item.label }}
51+ <div v-if =" showFileSearchPrompt" class =" mention-search-placeholder" >
52+ 输入相关内容以搜索文件
5853 </div >
54+ <template v-else >
55+ <div
56+ v-for =" (item, index) in mentionItems.files"
57+ :key =" 'file-' + item.value"
58+ :class =" ['mention-item', { active: isItemSelected('file', index) }]"
59+ @click =" insertMention(item)"
60+ >
61+ {{ item.label }}
62+ </div >
63+ </template >
5964 </div >
6065
6166 <!-- 知识库列表 -->
@@ -252,7 +257,6 @@ const updateMentionItems = (query = '') => {
252257
253258 const lowerQuery = query .toLowerCase ()
254259 const { files = [], knowledgeBases = [], mcps = [], skills = [], subagents = [] } = props .mention
255- const workspacePrefix = ' /home/gem/user-data/workspace/'
256260
257261 const filterItems = (list ) =>
258262 list .filter ((item ) => {
@@ -273,7 +277,7 @@ const updateMentionItems = (query = '') => {
273277
274278 const filterFileItems = (list ) => {
275279 if (! query) {
276- return list . filter (( item ) => ! String ( item . value || ' ' ). startsWith (workspacePrefix))
280+ return []
277281 }
278282 return filterItems (list)
279283 }
@@ -372,9 +376,14 @@ const isItemSelected = (type, index) => {
372376}
373377
374378// 是否有任何候选项
379+ const showFileSearchPrompt = computed (() => {
380+ return Boolean (props .mention ? .files ? .length ) && ! mentionQuery .value
381+ })
382+
375383const hasAnyItems = computed (() => {
376384 const items = mentionItems .value
377385 return (
386+ showFileSearchPrompt .value ||
378387 items .files .length > 0 ||
379388 items .knowledgeBases .length > 0 ||
380389 items .mcps .length > 0 ||
@@ -883,5 +892,11 @@ defineExpose({
883892 color: var (-- gray- 400 );
884893 font- size: 13px ;
885894 }
895+
896+ .mention - search- placeholder {
897+ padding: 4px 8px ;
898+ color: var (-- gray- 400 );
899+ font- size: 13px ;
900+ }
886901}
887902< / style>
0 commit comments