@allbluecn/web-app 0.27.3 → 0.27.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -115,6 +115,7 @@ export function QuickCapturePanel({ initialMode }: { initialMode: QuickCaptureMo
|
|
|
115
115
|
const savingRef = useRef(false)
|
|
116
116
|
const tiptapEditorRef = useRef<any>(null)
|
|
117
117
|
const editorWrapRef = useRef<HTMLDivElement | null>(null)
|
|
118
|
+
const titleInputRef = useRef<HTMLInputElement | null>(null)
|
|
118
119
|
|
|
119
120
|
const { model: aiModel, setModel: setAiModel, groups: aiGroups } = useStoryAiModel()
|
|
120
121
|
// 项目花名册:listProjectsBriefFn 内部先 ensureBuiltinIndependentProject,
|
|
@@ -186,6 +187,21 @@ export function QuickCapturePanel({ initialMode }: { initialMode: QuickCaptureMo
|
|
|
186
187
|
setMounted(true)
|
|
187
188
|
}, [])
|
|
188
189
|
|
|
190
|
+
// 焦点管理:面板每次获得焦点(showInactive + webContents.focus / 用户切回)
|
|
191
|
+
// 时把焦点放到标题框。否则焦点停在第一个可聚焦元素(顶部图钉按钮)——表现为
|
|
192
|
+
// 图钉出现 focus ring、Enter/Esc 落到按钮上(快捷键像失效)。用户正在其他
|
|
193
|
+
// 输入控件里编辑时不抢焦点。
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
const focusTitle = () => {
|
|
196
|
+
const active = document.activeElement
|
|
197
|
+
if (active && active !== document.body && active !== titleInputRef.current) return
|
|
198
|
+
titleInputRef.current?.focus()
|
|
199
|
+
}
|
|
200
|
+
focusTitle()
|
|
201
|
+
window.addEventListener('focus', focusTitle)
|
|
202
|
+
return () => window.removeEventListener('focus', focusTitle)
|
|
203
|
+
}, [])
|
|
204
|
+
|
|
189
205
|
useEffect(() => {
|
|
190
206
|
const bridge = getDesktopBridge()
|
|
191
207
|
void bridge
|
|
@@ -449,6 +465,7 @@ export function QuickCapturePanel({ initialMode }: { initialMode: QuickCaptureMo
|
|
|
449
465
|
|
|
450
466
|
<Input
|
|
451
467
|
autoFocus
|
|
468
|
+
ref={titleInputRef}
|
|
452
469
|
value={name}
|
|
453
470
|
onChange={(e) => setName(e.target.value)}
|
|
454
471
|
onKeyDown={handleTitleKeyDown}
|
|
@@ -58,13 +58,15 @@ interface MentionItemProps {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export const MentionDropdownMenu = (props: MentionDropdownMenuProps) => {
|
|
61
|
+
// useEditorServices 是 hook(内部 useContext),必须在组件渲染期调用——
|
|
62
|
+
// 放进 queryFn 会在 react-query 的异步上下文里触发 Invalid hook call,被
|
|
63
|
+
// query 全局 onError 捕获成「请求失败」toast(每次编辑器挂载即触发:
|
|
64
|
+
// mini 面板 / 创建需求弹窗 / 需求详情都会复现)。
|
|
65
|
+
const es = useEditorServices() ?? {}
|
|
66
|
+
const { mentionUserSource } = es
|
|
61
67
|
const { data: teamUsers = [] } = useQuery({
|
|
62
68
|
queryKey: ['teamUsers'],
|
|
63
|
-
queryFn: () =>
|
|
64
|
-
const es = useEditorServices() ?? {}
|
|
65
|
-
const { mentionUserSource } = es
|
|
66
|
-
return mentionUserSource?.listUsers?.() ?? []
|
|
67
|
-
},
|
|
69
|
+
queryFn: () => mentionUserSource?.listUsers?.() ?? [],
|
|
68
70
|
staleTime: 60_000,
|
|
69
71
|
})
|
|
70
72
|
|
|
@@ -112,7 +112,7 @@ export const SDK_GROUPS: SdkGroup[] = [
|
|
|
112
112
|
"items": [
|
|
113
113
|
{
|
|
114
114
|
"name": "@allbluecn/web-app",
|
|
115
|
-
"version": "v0.27.
|
|
115
|
+
"version": "v0.27.4",
|
|
116
116
|
"lastUpdate": "Nov 5, 2026",
|
|
117
117
|
"source": "apps/web/package.json",
|
|
118
118
|
"docsUrl": "https://github.com/allbluecn/allblue"
|