pinokiod 8.0.74 → 8.0.76
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/kernel/vault/automatic_scans.js +168 -58
- package/kernel/vault/registry_core.js +65 -23
- package/package.json +1 -1
- package/server/public/vault.css +34 -0
- package/server/public/vault.js +8 -4
- package/test/vault-automatic-scans.test.js +1325 -139
- package/test/vault-engine.test.js +7 -0
- package/test/vault-ui.test.js +62 -0
|
@@ -342,11 +342,15 @@ describe("Save Space engine", () => {
|
|
|
342
342
|
mode: "automatic"
|
|
343
343
|
}), { app: "demo", mode: "automatic" })
|
|
344
344
|
const launchPath = path.join(home, "api", "demo", "start.js")
|
|
345
|
+
const modelPath = path.join(home, "api", "demo", "model.bin")
|
|
345
346
|
vault.automaticScans.handleStarted(launchPath)
|
|
347
|
+
vault.automaticScans.recordChangedPath(modelPath)
|
|
346
348
|
await vault.automaticScans.handleStopped(launchPath)
|
|
347
349
|
assert.equal(vault.automaticScans.pendingStops.size, 0)
|
|
350
|
+
assert.equal(vault.automaticScans.changedPaths.has("demo"), false)
|
|
348
351
|
assert.deepEqual(vault.automaticScans.snapshot().rows, [])
|
|
349
352
|
|
|
353
|
+
vault.automaticScans.changedPaths.set("demo", new Set([modelPath]))
|
|
350
354
|
assert.equal((await vault.perform("scan", {
|
|
351
355
|
candidate_size: 0
|
|
352
356
|
})).started, true)
|
|
@@ -354,6 +358,9 @@ describe("Save Space engine", () => {
|
|
|
354
358
|
!vault.scanPromise && !vault.scanCompletionPromise)
|
|
355
359
|
|
|
356
360
|
assert.equal(await vault.globalScanReady(), true)
|
|
361
|
+
assert.equal(vault.automaticScans.changedPaths.has("demo"), false)
|
|
362
|
+
assert.equal(vault.automaticScans.active, null)
|
|
363
|
+
assert.equal(vault.automaticScans.entries.has("demo"), false)
|
|
357
364
|
await vault.automaticScans.scanFinished({
|
|
358
365
|
scopeId: null,
|
|
359
366
|
result: { outcome: "cancelled" },
|
package/test/vault-ui.test.js
CHANGED
|
@@ -548,6 +548,14 @@ describe("Save Space interface", () => {
|
|
|
548
548
|
/body\.vault-page \.vault-view-tabs\s*\{[^}]*padding:\s*0;/s)
|
|
549
549
|
assert.match(vaultCss,
|
|
550
550
|
/body\.dark\.vault-page\s*\{[^}]*--task-panel:\s*var\(--pinokio-sidebar-tabbar-bg\);/s)
|
|
551
|
+
assert.match(vaultCss,
|
|
552
|
+
/\.vault-view-tabs \.vault-nav-row\.attention\s*\{[^}]*background:/s)
|
|
553
|
+
assert.match(vaultCss,
|
|
554
|
+
/\.vault-view-tabs \.vault-nav-row\.attention \.vault-nav-name::before\s*\{[^}]*background:\s*var\(--vault-warning\);/s)
|
|
555
|
+
assert.match(vaultCss,
|
|
556
|
+
/\.vault-view-tabs \.vault-nav-row\.attention \.vault-nav-count\s*\{[^}]*background:/s)
|
|
557
|
+
assert.match(vaultCss,
|
|
558
|
+
/\.vault-view-tabs \.vault-nav-row\.attention\.selected\s*\{[^}]*border-bottom-color:\s*var\(--task-accent\);/s)
|
|
551
559
|
assert.match(vaultCss,
|
|
552
560
|
/\.vault-scan-control\s*>\s*\.vault-scan-action\s*\{[^}]*border-radius:\s*7px 0 0 7px;/s)
|
|
553
561
|
assert.match(vaultCss,
|
|
@@ -2551,6 +2559,60 @@ describe("Save Space interface", () => {
|
|
|
2551
2559
|
dom.window.close()
|
|
2552
2560
|
})
|
|
2553
2561
|
|
|
2562
|
+
test("actionable tabs highlight nonzero cleanup opportunities", async () => {
|
|
2563
|
+
const actionableStatus = fixture([
|
|
2564
|
+
item({
|
|
2565
|
+
path: "/pinokio/api/app/duplicate.bin",
|
|
2566
|
+
relative_path: "duplicate.bin",
|
|
2567
|
+
status: "duplicate",
|
|
2568
|
+
shareable: true
|
|
2569
|
+
}),
|
|
2570
|
+
item({
|
|
2571
|
+
path: "/pinokio/api/app/unused.bin",
|
|
2572
|
+
relative_path: "unused.bin",
|
|
2573
|
+
orphan: true
|
|
2574
|
+
})
|
|
2575
|
+
], {
|
|
2576
|
+
reclaimable: 4096
|
|
2577
|
+
})
|
|
2578
|
+
const { dom } = await makePage(actionableStatus)
|
|
2579
|
+
|
|
2580
|
+
for (const view of ["duplicates", "reclaimable"]) {
|
|
2581
|
+
const tab = dom.window.document.querySelector(`[data-view="${view}"]`)
|
|
2582
|
+
const count = tab.querySelector(".vault-nav-count")
|
|
2583
|
+
assert.equal(count.textContent.trim(), "1")
|
|
2584
|
+
assert.equal(tab.classList.contains("attention"), true)
|
|
2585
|
+
assert.equal(count.classList.contains("attention"), true)
|
|
2586
|
+
}
|
|
2587
|
+
dom.window.close()
|
|
2588
|
+
|
|
2589
|
+
const { dom: emptyDom } = await makePage(fixture([item()]))
|
|
2590
|
+
|
|
2591
|
+
for (const view of ["duplicates", "reclaimable"]) {
|
|
2592
|
+
const tab = emptyDom.window.document.querySelector(`[data-view="${view}"]`)
|
|
2593
|
+
const count = tab.querySelector(".vault-nav-count")
|
|
2594
|
+
assert.equal(count.textContent.trim(), "0")
|
|
2595
|
+
assert.equal(tab.classList.contains("attention"), false)
|
|
2596
|
+
assert.equal(count.classList.contains("attention"), false)
|
|
2597
|
+
}
|
|
2598
|
+
emptyDom.window.close()
|
|
2599
|
+
|
|
2600
|
+
const appStatus = fixture([item({
|
|
2601
|
+
status: "duplicate",
|
|
2602
|
+
shareable: true
|
|
2603
|
+
})])
|
|
2604
|
+
const { dom: appDom } = await makePage(appStatus, {
|
|
2605
|
+
appMode: true,
|
|
2606
|
+
scopeId: "app:app"
|
|
2607
|
+
})
|
|
2608
|
+
|
|
2609
|
+
assert.equal(appDom.window.document.querySelector(
|
|
2610
|
+
'[data-view="duplicates"]').classList.contains("attention"), true)
|
|
2611
|
+
assert.equal(appDom.window.document.querySelector(
|
|
2612
|
+
'[data-view="reclaimable"]'), null)
|
|
2613
|
+
appDom.window.close()
|
|
2614
|
+
})
|
|
2615
|
+
|
|
2554
2616
|
test("app setup remains visible during global scan progress", async () => {
|
|
2555
2617
|
let progressRequests = 0
|
|
2556
2618
|
const status = fixture([], {
|