️ perf(workbench): 隔离后台页签日志订阅

仅让活跃查询编辑器订阅 SQL 日志,并在侧栏命令搜索关闭时保持稳定空快照。

补充隐藏页签重绘、激活切换和最近日志顺序回归测试。
This commit is contained in:
Syngnat
2026-07-22 00:34:40 +08:00
parent 76e74a02fd
commit 26e980917f
6 changed files with 174 additions and 9 deletions

View File

@@ -212,6 +212,7 @@ const QUERY_EDITOR_MAC_FIND_WITH_SELECTION_GUARD_ACTION_ID = 'gonavi.suppressMac
const QUERY_EDITOR_AI_INLINE_DEBOUNCE_MS = 220;
const QUERY_EDITOR_AI_INLINE_CONTEXT_KEY = 'gonaviAiInlineSuggestionVisible';
const QUERY_EDITOR_IME_FALLBACK_DELAY_MS = 80;
const EMPTY_QUERY_EDITOR_SQL_LOGS: SqlLog[] = [];
const isOceanBaseOracleConnection = (config: any): boolean => {
const type = String(config?.type || '').trim().toLowerCase();
@@ -1392,8 +1393,8 @@ const QueryEditor: React.FC<{ tab: TabData; isActive?: boolean }> = ({ tab, isAc
);
const addSqlLog = useStore(state => state.addSqlLog);
const sqlLogCount = useStore(state => state.sqlLogs.length);
const sqlLogs = useStore(state => state.sqlLogs);
const sqlLogs = useStore(state => (isActive ? state.sqlLogs : EMPTY_QUERY_EDITOR_SQL_LOGS));
const sqlLogCount = sqlLogs.length;
const addTab = useStore(state => state.addTab);
const setActiveContext = useStore(state => state.setActiveContext);
const updateQueryTabDraft = useStore(state => state.updateQueryTabDraft);