{{ message }}
Commit e8370f4
feat(library): document-style File menu for the saved-query Library (#29)
Reframes the saved-query collection as a named, savable document — "the
Library" — with a header File ▾ menu, an editable name, and an unsaved-changes
dot, replacing the Export/Import row hidden at the bottom of the Saved panel.
State (src/state.js):
- libraryName (persisted, key asb:libraryName) + libraryDirty (session-only).
- ops renameLibrary / newLibrary / replaceLibrary / appendLibrary /
markLibrarySaved; the existing saved-query mutators now mark the Library
dirty. New/Replace prune now-dangling tab→saved links; Replace adopts the
loaded file's base name and keeps original ids (lossless).
Serializers (src/core/saved-io.js):
- buildMarkdownDoc / buildSqlDoc — one-way "share" exports (### + fenced sql;
/* name + description */ comment + ;-delimited sql). JSON stays canonical.
UI:
- New src/ui/file-menu.js: the header File ▾ menu (New / Save JSON / Replace… /
Append… / Download Markdown / Download SQL + "N in Library" footer), the
inline-editable library title with a dirty dot, and Replace/New confirm
dialogs. JSON is the only importable format; imported SQL is never run.
- app.js mounts the controls in the header and exposes the download / saveStr /
FileReader / library-title seams; the obsolete exportSaved/importSavedFile
actions are removed. saved-history.js drops savedActions() and relabels the
tab "Library".
Tests stay at the per-file 100% statements/lines gate (branches ≥90, functions
≥95); adds tests/unit/file-menu.test.js. README documents the Library menu.
Builds on the descriptions pre-phase (#29 phase 1, PR #30).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AX4YR7RHKj7JfmS2AqnRrm1 parent 73f8182 commit e8370f4
13 files changed
Lines changed: 874 additions & 122 deletions
File tree
- src
- core
- ui
- tests
- helpers
- unit
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
| |||
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
| 127 | + | |
118 | 128 | | |
119 | 129 | | |
120 | 130 | | |
| |||
134 | 144 | | |
135 | 145 | | |
136 | 146 | | |
| 147 | + | |
137 | 148 | | |
138 | 149 | | |
139 | 150 | | |
| |||
142 | 153 | | |
143 | 154 | | |
144 | 155 | | |
| 156 | + | |
145 | 157 | | |
146 | 158 | | |
147 | 159 | | |
| |||
160 | 172 | | |
161 | 173 | | |
162 | 174 | | |
| 175 | + | |
163 | 176 | | |
164 | 177 | | |
165 | 178 | | |
| |||
168 | 181 | | |
169 | 182 | | |
170 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
171 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
172 | 244 | | |
173 | 245 | | |
174 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
287 | 360 | | |
288 | 361 | | |
289 | 362 | | |
| |||

0 commit comments