Skip to content

Commit 9ef350c

Browse files
committed
small package stuff
1 parent 2b04cbf commit 9ef350c

File tree

3 files changed

+57
-3
lines changed

3 files changed

+57
-3
lines changed

apps/array/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@
102102
"@tanstack/react-query": "^5.90.2",
103103
"@tanstack/react-virtual": "^3.13.12",
104104
"@tiptap/core": "^3.13.0",
105+
"@tiptap/extension-mention": "^3.13.0",
105106
"@tiptap/extension-placeholder": "^3.13.0",
106107
"@tiptap/pm": "^3.13.0",
107108
"@tiptap/react": "^3.13.0",
108109
"@tiptap/starter-kit": "^3.13.0",
110+
"@tiptap/suggestion": "^3.13.0",
109111
"@trpc/client": "^11.8.0",
110112
"@trpc/react-query": "^11.8.0",
111113
"@trpc/server": "^11.8.0",
@@ -142,6 +144,7 @@
142144
"reflect-metadata": "^0.2.2",
143145
"remark-gfm": "^4.0.1",
144146
"sonner": "^2.0.7",
147+
"tippy.js": "^6.3.7",
145148
"trpc-electron": "^0.1.2",
146149
"uuid": "^9.0.1",
147150
"vscode-icons-js": "^11.6.1",

apps/array/src/renderer/features/message-editor/tiptap/FileMention.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ import { SuggestionList, type SuggestionListRef } from "./SuggestionList";
99
function createSuggestion(
1010
sessionId: string,
1111
): Partial<SuggestionOptions<FileSuggestionItem>> {
12+
let lastItems: FileSuggestionItem[] = [];
13+
1214
return {
1315
char: "@",
1416
allowSpaces: false,
1517
startOfLine: false,
1618

1719
items: async ({ query }): Promise<FileSuggestionItem[]> => {
1820
if (!sessionId) return [];
19-
return getFileSuggestions(sessionId, query);
21+
const results = await getFileSuggestions(sessionId, query);
22+
lastItems = results;
23+
return results;
2024
},
2125

2226
render: () => {
@@ -25,9 +29,10 @@ function createSuggestion(
2529

2630
return {
2731
onStart: (props) => {
32+
const items = props.items.length > 0 ? props.items : lastItems;
2833
component = new ReactRenderer(SuggestionList, {
2934
props: {
30-
items: props.items,
35+
items,
3136
command: props.command,
3237
},
3338
editor: props.editor,
@@ -48,8 +53,9 @@ function createSuggestion(
4853
},
4954

5055
onUpdate: (props) => {
56+
const items = props.items.length > 0 ? props.items : lastItems;
5157
component?.updateProps({
52-
items: props.items,
58+
items,
5359
command: props.command,
5460
});
5561

pnpm-lock.yaml

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)