feat(frontend): 升级 DataGrid 组件并引入高性能拖拽交互

- 实现基于原生 DOM 事件的零渲染列宽拖拽,彻底解决卡顿与误触排序问题
- 查询编辑器集成 DataGrid,支持 SQL 结果直接编辑与事务提交
- 侧边栏新增上下文感知的 "新建查询" 快捷入口
- 优化 TabManager 渲染逻辑与全局布局,消除不必要的滚动条
This commit is contained in:
杨国锋
2026-02-02 11:32:49 +08:00
parent e0181cc7ac
commit af91c916c3
33 changed files with 2020 additions and 1618 deletions

View File

@@ -6,6 +6,7 @@ interface AppState {
connections: SavedConnection[];
tabs: TabData[];
activeTabId: string | null;
activeContext: { connectionId: string; dbName: string } | null;
savedQueries: SavedQuery[];
darkMode: boolean;
sqlFormatOptions: { keywordCase: 'upper' | 'lower' };
@@ -16,6 +17,7 @@ interface AppState {
addTab: (tab: TabData) => void;
closeTab: (id: string) => void;
setActiveTab: (id: string) => void;
setActiveContext: (context: { connectionId: string; dbName: string } | null) => void;
saveQuery: (query: SavedQuery) => void;
deleteQuery: (id: string) => void;
@@ -30,6 +32,7 @@ export const useStore = create<AppState>()(
connections: [],
tabs: [],
activeTabId: null,
activeContext: null,
savedQueries: [],
darkMode: false,
sqlFormatOptions: { keywordCase: 'upper' },
@@ -58,6 +61,7 @@ export const useStore = create<AppState>()(
}),
setActiveTab: (id) => set({ activeTabId: id }),
setActiveContext: (context) => set({ activeContext: context }),
saveQuery: (query) => set((state) => {
// If query with same ID exists, update it