🐛 fix(sql-editor): 修复对象超链接侧栏定位与样式

- 侧栏定位 fallback 统一按限定名解析,兼容 schema.object 与对象名、大小写差异

- 补充视图、函数、触发器超链接定位事件与树节点匹配回归测试

- 将 SQL 编辑器超链接改为蓝色实线下划线,并补充暗色主题样式断言
This commit is contained in:
Syngnat
2026-06-04 11:41:54 +08:00
parent 02faa4586b
commit 9d39440438
4 changed files with 153 additions and 9 deletions

View File

@@ -1079,6 +1079,13 @@ describe('QueryEditor external SQL save', () => {
expect(lastDecorationCall?.[1]?.[0]?.options?.inlineClassName).toBe('gonavi-query-editor-link-hint');
});
it('keeps query editor hyperlink decorations blue with a solid underline', () => {
const css = readFileSync(new URL('../App.css', import.meta.url), 'utf8');
expect(css).toMatch(/\.gonavi-query-editor-link-hint\s*\{[^}]*color:\s*#1677ff\s*!important;[^}]*text-decoration:\s*underline;[^}]*text-decoration-style:\s*solid;[^}]*text-decoration-color:\s*currentColor;/s);
expect(css).toMatch(/body\[data-theme='dark'\]\s+\.gonavi-query-editor-link-hint\s*\{[^}]*color:\s*#69b1ff\s*!important;/s);
});
it('opens a view tab on ctrl left click inside the editor', async () => {
editorState.value = 'select * from reporting.active_users';
autoFetchState.visible = true;
@@ -1209,6 +1216,24 @@ describe('QueryEditor external SQL save', () => {
schemaName: 'reporting',
sidebarLocateKey: 'conn-1-main-routine-reporting.refresh_stats',
});
expect((window as any).dispatchEvent).toHaveBeenCalledWith(expect.objectContaining({
type: 'gonavi:locate-sidebar-object',
detail: expect.objectContaining({
tabId: 'conn-1-main-trigger-audit.users_bi-audit.users',
triggerName: 'audit.users_bi',
schemaName: 'audit',
objectGroup: 'triggers',
}),
}));
expect((window as any).dispatchEvent).toHaveBeenCalledWith(expect.objectContaining({
type: 'gonavi:locate-sidebar-object',
detail: expect.objectContaining({
tabId: 'conn-1-main-routine-reporting.refresh_stats',
routineName: 'reporting.refresh_stats',
schemaName: 'reporting',
objectGroup: 'routines',
}),
}));
});
it('switches current database on cmd left click for database identifiers', async () => {