feat(query-editor): 新增编辑器内搜索入口

- 在查询编辑器工具栏新增搜索入口并直连 Monaco 查找\n- 接管 Ctrl/Cmd+F,优先打开编辑器内搜索而不是浏览器默认查找\n- 补充多语言文案与静态测试覆盖\n\nFixes #539
This commit is contained in:
Syngnat
2026-06-29 20:00:27 +08:00
parent a7fdab5bb2
commit 93006d8423
11 changed files with 171 additions and 0 deletions

View File

@@ -80,6 +80,19 @@ describe('QueryEditorToolbar layout', () => {
expect(transactionDelayCss).toContain('flex: 0 0 104px !important;');
});
it('keeps editor search action grouped with formatting actions', () => {
const toolbarSource = readFileSync(new URL('./QueryEditorToolbar.tsx', import.meta.url), 'utf8');
const formatActionPairStart = toolbarSource.indexOf('SearchOutlined');
const formatActionPairEnd = toolbarSource.indexOf('!isV2Ui && (');
const formatActionPairSource = toolbarSource.slice(formatActionPairStart, formatActionPairEnd);
expect(toolbarSource).toContain('SearchOutlined');
expect(formatActionPairSource).toContain('query_editor.action.find_in_editor');
expect(formatActionPairSource).toContain('query_editor.action.find_in_editor_with_shortcut');
expect(formatActionPairSource).toContain('onClick={onFindInEditor}');
expect(formatActionPairSource).toContain('FormatPainterOutlined');
});
it('shows delayed full-name tooltips for truncated connection and database selectors', () => {
const toolbarSource = readFileSync(new URL('./QueryEditorToolbar.tsx', import.meta.url), 'utf8');
const css = readV2ThemeCss();