🐛 fix(query-editor): 优化工具栏长名称提示与片段弹窗布局

- SQL 编辑器连接和数据库选择器支持悬浮延迟显示完整名称
- SQL 片段管理嵌入工具中心时隐藏重复标题
- 缩小片段操作按钮并拆分滚动区域,避免底部内容被遮挡
- 补充工具栏和片段弹窗源码级回归断言
This commit is contained in:
Syngnat
2026-06-25 18:42:11 +08:00
parent aebe9bab54
commit 8a56367d02
7 changed files with 237 additions and 40 deletions

View File

@@ -7478,6 +7478,10 @@ describe('QueryEditor external SQL save', () => {
expect(toolbarSource).toContain('gn-v2-query-toolbar-actions');
expect(toolbarSource).toContain('gn-v2-query-toolbar-connection-select');
expect(toolbarSource).toContain('gn-v2-query-toolbar-database-select');
expect(toolbarSource).toContain('FULL_NAME_TOOLTIP_DELAY_SECONDS = 1');
expect(toolbarSource).toContain('mouseEnterDelay={FULL_NAME_TOOLTIP_DELAY_SECONDS}');
expect(toolbarSource).toContain('optionRender={(option) => renderFullNameSelectTooltip(option.data.fullName)}');
expect(toolbarSource).toContain('labelRender={(option) => renderFullNameSelectTooltip(option.label ?? option.value)}');
expect(toolbarSource).toContain('gn-v2-query-toolbar-max-rows-select');
expect(toolbarSource).toContain('QueryEditorTransactionSettings');
expect(transactionSettingsSource).toContain('gn-v2-query-toolbar-transaction-mode-select');
@@ -7556,10 +7560,12 @@ describe('QueryEditor external SQL save', () => {
expect(modalSource).toContain('data-sql-snippet-action-row="true"');
expect(modalSource).toContain('data-sql-snippet-content-region="true"');
expect(modalSource).toContain('data-sql-snippet-editor-scroll-region="true"');
expect(modalSource).toContain("maxHeight: snippetModalBodyMaxHeight");
expect(modalSource).toContain('maxHeight: embedded ? snippetModalEmbeddedBodyMaxHeight : snippetModalBodyMaxHeight');
expect(modalSource).toContain('data-sql-snippet-syntax-reference-scroll-region="true"');
expect(modalSource).toContain('data-sql-snippet-editor-panel-scroll-region="true"');
expect(modalSource).toContain("flex: '0 0 auto'");
expect(modalSource).toContain("size=\"large\"");
expect(modalSource).toContain('minWidth: 96');
expect(modalSource).toContain("size=\"middle\"");
expect(modalSource).toContain('minWidth: 84');
expect(modalSource).toContain('syntaxHelp');
expect(modalSource).toContain("t('snippet_settings.syntax_reference.label')");
expect(source).toContain('s.syntaxHelp || s.description || s.body');