🐛 fix(workbench): 修复结果区切换与对象设计字段定义

- 修复手动隐藏结果区后快捷键无法再次显示的问题

- 补全 Dameng/Oracle-like 字段长度、精度和可空标识

- 增加 SQL 编辑器、字段元数据和对象设计回归测试
This commit is contained in:
Syngnat
2026-06-10 15:51:03 +08:00
parent 1d1d8d21cd
commit c9d0bce153
8 changed files with 244 additions and 15 deletions

View File

@@ -1766,6 +1766,16 @@ const resolveEventTargetNode = (target: EventTarget | null): Node | null => (
typeof Node !== 'undefined' && target instanceof Node ? target : null
);
const isDocumentLevelShortcutTarget = (targetNode: Node | null): boolean => {
if (!targetNode) {
return true;
}
if (typeof document === 'undefined') {
return false;
}
return targetNode === document.body || targetNode === document.documentElement;
};
const clearQueryEditorLinkDecorations = (
editor: any,
decorationIdsRef: React.MutableRefObject<string[]>,
@@ -5004,7 +5014,7 @@ const QueryEditor: React.FC<{ tab: TabData; isActive?: boolean }> = ({ tab, isAc
const targetNode = resolveEventTargetNode(event.target);
const editorHasFocus = !!editor?.hasTextFocus?.();
const inQueryEditor = !!(targetNode && queryEditorRootRef.current?.contains(targetNode));
if (!editorHasFocus && !inQueryEditor) {
if (!editorHasFocus && !inQueryEditor && !isDocumentLevelShortcutTarget(targetNode)) {
return;
}