dsh-data-window 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +67 -0
- package/README.md +17 -3
- package/client.js +1760 -214
- package/docs/BRIDGE.md +6 -0
- package/docs/DETAIL.md +50 -5
- package/locale/en.json +64 -1
- package/locale/zh.json +64 -1
- package/package.json +1 -1
- package/src/client/00-css.js +204 -1
- package/src/client/05-icons.js +21 -0
- package/src/client/07-bridge.js +10 -1
- package/src/client/10-core.js +182 -64
- package/src/client/20-tree.js +51 -17
- package/src/client/27-favorites.js +331 -0
- package/src/client/30-editor.js +490 -94
- package/src/client/40-results.js +3 -0
- package/src/client/50-panel.js +203 -25
- package/src/client/63-schema.js +1 -0
- package/src/client/64-manual.js +6 -1
- package/src/client/65-ai.js +1 -0
- package/src/client/66-optimize.js +120 -1
- package/src/host/favorites.js +188 -0
- package/src/host/rpc.js +51 -0
- package/src/host/shared.js +10 -2
package/AGENTS.md
CHANGED
|
@@ -27,7 +27,7 @@ DataGrip 风格的 DSH 数据库窗口插件。本文件是这个工作区的**
|
|
|
27
27
|
| `src/host/manual.js` | 手动连接:全机共享一份 0600 条目文件(首次启动合并旧的按工作区文件)+ 环境/实例/库与连接目标表 |
|
|
28
28
|
| `src/host/catalog.js` | 本机已解析/已手动添加的连接目录(跨工作区去重,列表不含密码,保存时按 id 取密码) |
|
|
29
29
|
| `src/host/remembered.js` | 记住用户勾选的库(全机共享一份 0600 文件),下次发现时并进实例 |
|
|
30
|
-
| `src/host/shared.js` | 把各工作区发现结果 + 共享手动连接 + 共享勾选库拼成**同一棵树**,并返回本工作区的 `focus` |
|
|
30
|
+
| `src/host/shared.js` | 把各工作区发现结果 + 共享手动连接 + 共享勾选库拼成**同一棵树**,并返回本工作区的 `focus`;本项目发现出来的库带 `inWorkspace: true`(树是全机共享的,别的项目的库也会挂进来,`openSql` 靠这个标记选库) |
|
|
31
31
|
| `src/client/*.js` | 面板源码,`node build.mjs` 拼成单文件 `client.js` |
|
|
32
32
|
| `build.mjs` | 拼接 + 注入语言字典 + 未定义 helper 检查 + 去掉模块语法 |
|
|
33
33
|
| `locale/{en,zh}.json` | 显示名(`meta`)+ 全部界面文案,客户端把它内联进 bundle |
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,72 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.3] — 2026-11-26
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- The run log's height is dragged from the 5px divider above its title bar (drag up
|
|
8
|
+
to grow, double-click to reset to the default). The height is stored per browser
|
|
9
|
+
in `localStorage` and restored on the next open; it is clamped so the workbench
|
|
10
|
+
keeps a usable area in a small window.
|
|
11
|
+
- Saved SQL: the editor's context menu and a console tab's menu can collect a
|
|
12
|
+
statement under a unique name together with its schema and table. Entries live in
|
|
13
|
+
one machine-wide 0600 file (`storages/dsh-data-window/favorites/favorites.json`),
|
|
14
|
+
written atomically, and are shared by every workspace like the tree.
|
|
15
|
+
- The resource manager is split into two tabs like DataGrip's Database window: a
|
|
16
|
+
**Databases** tab with the configured tree and a ★ **Favorites** tab that groups
|
|
17
|
+
saved statements by schema and then table (with a count badge and its own reload
|
|
18
|
+
button). Saving a statement switches to the favorites tab, expands its
|
|
19
|
+
schema/table and selects the new entry. Double-click opens a statement in the
|
|
20
|
+
matching schema's workbench; the node's menu opens, copies, edits
|
|
21
|
+
(rename/schema/table) or deletes it.
|
|
22
|
+
- The workbench indexes saved statements behind `@`: typing `@` opens a picker
|
|
23
|
+
filtered by name, schema or table, and Enter/Tab (or a click) replaces the
|
|
24
|
+
`@keyword` token with the statement, leaving the caret after it.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Input-method composition no longer triggers commands: the Enter that confirms a
|
|
29
|
+
Chinese/Japanese candidate (and the Escape that cancels it) is left to the IME
|
|
30
|
+
instead of submitting the favorite dialog, blurring an edited result cell,
|
|
31
|
+
closing a dialog, picking an `@` suggestion or running a statement. A short
|
|
32
|
+
grace period after `compositionend` covers browsers that deliver the confirming
|
|
33
|
+
Enter as a plain key event.
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- The workspace refresh button moved from the top toolbar into the resource
|
|
38
|
+
manager's header, beside the AI and add-connection actions: the toolbar keeps the
|
|
39
|
+
workspace's identity and shell controls, and the explorer owns the actions that
|
|
40
|
+
act on its tree.
|
|
41
|
+
|
|
42
|
+
## [0.1.2] — 2026-11-26
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- SQL console tabs have a right-click menu: close, close others, close all, close
|
|
47
|
+
tabs to the left/right, copy the tab's reference (`schema.table` or `schema`), and
|
|
48
|
+
copy that reference into the chat composer when it is open (clipboard fallback
|
|
49
|
+
otherwise). Bulk closes pick the neighbouring tab and save the console snapshot
|
|
50
|
+
immediately. The menu reuses the code workspace's IDEA-style layout: icons,
|
|
51
|
+
separators, 27px rows, disabled side items, placement clamped to the panel.
|
|
52
|
+
- The create statement opens in a dialog with a copy button instead of a work tab;
|
|
53
|
+
the F4 / ⌘⇧D shortcut and the context-menu entry stay.
|
|
54
|
+
- Right-clicking a database (or F4 on it) reads every table's create statement with
|
|
55
|
+
`x/y` progress, one `-- table` block per statement, and marks the tables that
|
|
56
|
+
could not be read at the end of the script.
|
|
57
|
+
- The SQL optimization dialog is now a side-by-side diff: the original statement on
|
|
58
|
+
the left, the optimized one on the right, with changed tokens highlighted (red
|
|
59
|
+
left, green right) and synchronized scrolling. The comparison is token-based so a
|
|
60
|
+
model that collapses the statement into one line still diffs cleanly.
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
|
|
64
|
+
- Clicking a tree row only selects it now; expanding/collapsing belongs to the
|
|
65
|
+
twisty, while double-click opens the node (database console, table data, or the
|
|
66
|
+
list for an environment/instance).
|
|
67
|
+
- The DDL dialog keeps the server's formatting: long lines scroll horizontally
|
|
68
|
+
instead of wrapping, and the code box is the dialog's only scroll container.
|
|
69
|
+
|
|
3
70
|
## [0.1.1] — 2026-11-25
|
|
4
71
|
|
|
5
72
|
### Fixed
|
package/README.md
CHANGED
|
@@ -51,14 +51,28 @@ double-click on the divider restores its default width.
|
|
|
51
51
|
opens in a dialog with a copy button. Nothing is executed or written back.
|
|
52
52
|
- **Refresh structure** — right-click a connection, database or table to re-read
|
|
53
53
|
its structure (databases, tables or columns) without reloading the panel; an open
|
|
54
|
-
DDL
|
|
54
|
+
DDL view for that table. Metadata only, never a write.
|
|
55
|
+
- **Tab context menu** — right-click a console tab to close it, close the tabs on
|
|
56
|
+
either side (or all of them), copy its reference (`schema.table` or `schema`), or
|
|
57
|
+
put that reference into the chat composer when the chat input is open.
|
|
58
|
+
- **Saved SQL and a favorites tab** — right-click a statement in the editor (or a
|
|
59
|
+
console tab) and choose “Save SQL” to keep it under a unique name together with
|
|
60
|
+
its schema and table. The resource manager has two tabs like DataGrip's Database
|
|
61
|
+
window: the database tree and ★ Favorites, which groups the saved statements
|
|
62
|
+
schema → table → name; double-clicking one opens it in that schema's workbench.
|
|
63
|
+
Typing `@` in the editor indexes them by name, and the chosen statement is
|
|
64
|
+
inserted at the caret. Saving, renaming, copying and deleting never execute
|
|
65
|
+
anything.
|
|
55
66
|
- **Paging for LIMIT queries** — a statement ending in `LIMIT` gets previous/next
|
|
56
67
|
controls whose page size is that limit; the next page is built as
|
|
57
68
|
`… LIMIT n OFFSET m` and run without touching the editor. An empty next page ends
|
|
58
69
|
the paging in place, leaving only “previous” available.
|
|
59
|
-
- **Create statement in one keystroke** — `F4` or `⌘/Ctrl + Shift + D` on a table
|
|
70
|
+
- **Create statement in one keystroke** — `F4` or `⌘/Ctrl + Shift + D` on a table
|
|
71
|
+
opens it in a dialog with a copy button (no extra work tab); on a database the same
|
|
72
|
+
key (or the context menu) reads the create statement of every table in it.
|
|
60
73
|
- **One workbench per database**, kept as tabs, with a result grid, copy-as-TSV,
|
|
61
|
-
a row limit, a draggable editor/result split and a collapsible run log
|
|
74
|
+
a row limit, a draggable editor/result split and a collapsible run log whose
|
|
75
|
+
height is dragged from its top edge (double-click resets it). Opening a
|
|
62
76
|
table's rows never overwrites SQL you already typed: a second console is added
|
|
63
77
|
instead.
|
|
64
78
|
- **Export the page** — the result bar exports the current page (with any local cell
|