mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-22 08:53:46 +08:00
⚡️ perf(frontend): 优化长时运行下的搜索与缓存占用
- 为 V2 cmd+k 搜索预建索引并限制初始/宽泛结果数量 - 清理冷数据库树和 DataViewer 长生命周期快照缓存 - 收紧运行时 SQL 日志预算并在 hydration 时压缩旧缓存
This commit is contained in:
@@ -164,6 +164,14 @@ describe('DataViewer safe editing locator', () => {
|
||||
expect(source).toContain('data_viewer.sql_log.phase.sort_buffer_retry');
|
||||
});
|
||||
|
||||
it('caps viewer filter snapshots so long-running sessions do not retain unbounded table state', () => {
|
||||
const source = readFileSync(new URL('./DataViewer.tsx', import.meta.url), 'utf8');
|
||||
|
||||
expect(source).toContain('const MAX_VIEWER_FILTER_SNAPSHOTS = 64;');
|
||||
expect(source).toContain('const trimViewerFilterSnapshots = () => {');
|
||||
expect(source).toContain('setViewerFilterSnapshot(normalizedTabId, {');
|
||||
});
|
||||
|
||||
it('enables table preview editing after primary keys are loaded', async () => {
|
||||
backendApp.DBGetColumns.mockResolvedValue({
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user