pinokiod 8.0.63 → 8.0.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "8.0.63",
3
+ "version": "8.0.65",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1308,7 +1308,6 @@
1308
1308
  }
1309
1309
  };
1310
1310
  eventSource.onerror = () => {
1311
- resetCards();
1312
1311
  loadState();
1313
1312
  };
1314
1313
  }
@@ -2232,6 +2232,8 @@ const renderNormalOverview = () => {
2232
2232
  const activeScan = scanActive(data.scan)
2233
2233
  const scanning = scanMatchesContext(data.scan)
2234
2234
  const busyElsewhere = activeScan && !scanning
2235
+ const actionableDuplicates = Math.max(0, Number(
2236
+ data.inventory && data.inventory.shareable_duplicates) || 0)
2235
2237
  const metrics = el("vault-metrics")
2236
2238
  const existingModeMenu = el("vault-auto-mode")
2237
2239
  const modeMenuOpen = !!(existingModeMenu && existingModeMenu.open) ||
@@ -2313,7 +2315,8 @@ const renderNormalOverview = () => {
2313
2315
  ? `<i class="fa-solid fa-circle-notch fa-spin"></i>${esc(COPY.scanning)}`
2314
2316
  : `<i class="fa-solid fa-rotate"></i>${esc(idleScanLabel)}`
2315
2317
  const firstScan = !last && !activeScan
2316
- scanButton.classList.toggle("primary", firstScan)
2318
+ const scanIsPrimary = firstScan || (!activeScan && !actionableDuplicates)
2319
+ scanButton.classList.toggle("primary", scanIsPrimary)
2317
2320
  scanButton.disabled = busyElsewhere || state.scanCancelRequested
2318
2321
  if (state.automaticReviewRequested && !activeScan &&
2319
2322
  !scanButton.disabled) {
@@ -582,7 +582,17 @@ test("an empty automatic check briefly confirms completion", async () => {
582
582
  assert.equal(revealTimers.length, revealsBeforeFocusedCompletion + 1)
583
583
  assert.equal(completionTimers.length, timersBeforeFocusedCompletion,
584
584
  "completion dismissal cannot start before its result is revealed")
585
+ eventSources[0].onerror()
586
+ await new Promise((resolve) => nativeSetTimeout(resolve, 0))
587
+ assert.equal(tray.hidden, false,
588
+ "a reconnect cannot erase a pending completion reveal")
589
+ assert.equal(tray.querySelector(".vault-auto-scan-close"), focusedClose)
590
+ assert.equal(tray.querySelector(
591
+ '.vault-auto-scan-row[data-state="complete"]'), null)
585
592
  revealTimers.at(-1).callback()
593
+ const focusedCompleted = tray.querySelector(
594
+ '.vault-auto-scan-row[data-state="complete"]')
595
+ assert.ok(focusedCompleted)
586
596
  assert.equal(completionTimers.length, timersBeforeFocusedCompletion,
587
597
  "completion does not start its timer while focus is already in the card")
588
598
  focusedClose.dispatchEvent(new dom.window.FocusEvent("focusout", {
@@ -590,10 +600,8 @@ test("an empty automatic check briefly confirms completion", async () => {
590
600
  relatedTarget: null
591
601
  }))
592
602
  assert.equal(completionTimers.length, timersBeforeFocusedCompletion + 1)
593
- eventSources[0].onerror()
594
- await new Promise((resolve) => nativeSetTimeout(resolve, 0))
595
- assert.equal(tray.hidden, true,
596
- "a reconnect drops presentation-only completion state")
603
+ completionTimers.at(-1).callback()
604
+ assert.equal(tray.hidden, true)
597
605
 
598
606
  send({
599
607
  enabled: true,
@@ -654,7 +654,7 @@ describe("Save Space interface", () => {
654
654
  assert.match(document.getElementById("btn-scan").textContent,
655
655
  /Scan again/)
656
656
  assert.equal(document.getElementById("btn-scan").classList
657
- .contains("primary"), false)
657
+ .contains("primary"), true)
658
658
  assert.equal(document.querySelector("#vault-scan-size-menu > summary")
659
659
  .classList.contains("primary"), false)
660
660
  assert.match(document.getElementById("vault-scan-size-label").textContent,
@@ -751,6 +751,10 @@ describe("Save Space interface", () => {
751
751
  /Cannot deduplicate\s*1/)
752
752
  assert.match(document.querySelector("#vault-status-filter").textContent,
753
753
  /Cannot deduplicate/)
754
+ assert.equal(document.getElementById("btn-review-metric").classList
755
+ .contains("primary"), true)
756
+ assert.equal(document.getElementById("btn-scan").classList
757
+ .contains("primary"), false)
754
758
 
755
759
  document.querySelector('[data-view="duplicates"]').click()
756
760
  await waitFor(() => document.querySelector(
@@ -759,7 +763,10 @@ describe("Save Space interface", () => {
759
763
  /duplicate\.bin/)
760
764
  assert.doesNotMatch(document.querySelector(".vault-table").textContent,
761
765
  /blocked\.bin/)
762
- assert.ok(document.querySelector("[data-deduplicate-all]"))
766
+ assert.equal(document.querySelector("[data-deduplicate-all]")
767
+ .classList.contains("primary"), true)
768
+ assert.equal(document.getElementById("btn-scan").classList
769
+ .contains("primary"), false)
763
770
 
764
771
  document.querySelector('[data-view="unavailable"]').click()
765
772
  await waitFor(() => document.querySelector(
@@ -2221,6 +2228,37 @@ describe("Save Space interface", () => {
2221
2228
  dom.window.close()
2222
2229
  })
2223
2230
 
2231
+ test("a completed app workspace keeps Scan again primary", async () => {
2232
+ const { dom } = await makePage(fixture([]), {
2233
+ appMode: true,
2234
+ scopeId: "app:app"
2235
+ })
2236
+ const document = dom.window.document
2237
+
2238
+ assert.match(document.getElementById("btn-scan").textContent,
2239
+ /Scan again/)
2240
+ assert.equal(document.getElementById("btn-scan").classList
2241
+ .contains("primary"), true)
2242
+
2243
+ dom.window.close()
2244
+ })
2245
+
2246
+ test("an app with duplicates keeps Scan again secondary", async () => {
2247
+ const duplicate = item({ status: "duplicate", shareable: true })
2248
+ const { dom } = await makePage(fixture([duplicate]), {
2249
+ appMode: true,
2250
+ scopeId: "app:app"
2251
+ })
2252
+ const document = dom.window.document
2253
+
2254
+ assert.equal(document.getElementById("btn-review-metric").classList
2255
+ .contains("primary"), true)
2256
+ assert.equal(document.getElementById("btn-scan").classList
2257
+ .contains("primary"), false)
2258
+
2259
+ dom.window.close()
2260
+ })
2261
+
2224
2262
  test("an app without a global baseline shows setup and opens global Disk Saver", async () => {
2225
2263
  const status = fixture([], {
2226
2264
  global_scan_ready: false,