pinokiod 8.0.49 → 8.0.50

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.49",
3
+ "version": "8.0.50",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -473,16 +473,26 @@ body[data-vault-mode="app"] .vault-overview {
473
473
  .vault-cloud-warning .vault-text-button { margin-left: auto; }
474
474
  .vault-cleanup-notice {
475
475
  flex: 0 0 auto;
476
- background: color-mix(in srgb, var(--task-accent) 5%, var(--task-panel));
476
+ border-bottom-color: color-mix(in srgb, var(--vault-warning) 45%, var(--task-border));
477
+ background: color-mix(in srgb, var(--vault-warning) 16%, var(--task-panel));
477
478
  }
478
- .vault-cleanup-notice > i { color: var(--task-accent); }
479
+ .vault-cleanup-notice > i { color: var(--vault-warning); }
479
480
  .vault-cleanup-notice strong { flex: 0 0 auto; font-weight: 650; }
480
481
  .vault-cleanup-notice-detail {
481
482
  min-width: 0;
482
483
  flex: 1 1 auto;
483
- color: var(--task-muted);
484
+ color: color-mix(in srgb, var(--task-text) 78%, var(--vault-warning));
485
+ }
486
+ .vault-cleanup-notice .vault-button {
487
+ flex: 0 0 auto;
488
+ margin-left: auto;
489
+ border-color: color-mix(in srgb, var(--vault-warning) 70%, var(--task-border-strong));
490
+ background: var(--task-panel);
491
+ font-weight: 650;
492
+ }
493
+ .vault-cleanup-notice .vault-button:hover {
494
+ background: color-mix(in srgb, var(--vault-warning) 12%, var(--task-panel));
484
495
  }
485
- .vault-cleanup-notice .vault-button { flex: 0 0 auto; margin-left: auto; }
486
496
  .vault-explorer {
487
497
  display: grid;
488
498
  min-height: 0;
@@ -22,11 +22,12 @@ const COPY = {
22
22
  external_other_disk: "Added to Locations. It can be scanned, but files on this disk cannot be deduplicated with files in your Pinokio folder.",
23
23
  pinokio_folder: "Pinokio folder",
24
24
  save_space: "Save space",
25
- disk_space_saved: "of disk space saved",
26
- saved_for_app: "{size} saved for this app",
27
- before: "Before",
28
- before_help: "Estimated size of every scanned location if each app stored its own copy. File Explorer may count deduplicated files differently.",
29
- after: "After",
25
+ disk_space_freed: "of disk space freed",
26
+ sharing_saves_for_app: "Sharing saves {size} for this app",
27
+ without_sharing: "Without sharing",
28
+ without_sharing_help: "Estimated size of every scanned location if each app stored its own copy. File Explorer may count deduplicated files differently.",
29
+ on_disk: "On disk",
30
+ app_share: "This app’s share",
30
31
  effective_help: "For deduplicated files, disk usage is divided evenly among every location using them.",
31
32
  nothing_more_to_save: "Nothing else to save",
32
33
  more_can_be_saved: "{size} more can be saved",
@@ -36,7 +37,8 @@ const COPY = {
36
37
  find_savings: "Scan to find duplicate files and save disk space",
37
38
  find_app_savings: "Scan this app to find duplicate files and save disk space",
38
39
  storage_details: "Storage details",
39
- saved_by_actions: "Saved by your actions",
40
+ kept_deduplicated: "Kept deduplicated",
41
+ already_shared: "Already shared before Save space",
40
42
  last_scanned: "Last scanned",
41
43
  never: "Never",
42
44
  scan: "Scan now",
@@ -939,23 +941,31 @@ const renderOverview = () => {
939
941
  (!!last || beforeBytes > 0 || afterBytes > 0 || Number(data.pending_bytes) > 0)
940
942
  const afterRatio = beforeBytes ? Math.min(100, (afterBytes / beforeBytes) * 100) : 0
941
943
  const pendingBytes = Math.max(0, Number(data.pending_bytes) || 0)
944
+ // The headline reports bytes actually freed by user actions, so it always
945
+ // survives a comparison against the OS file manager. Sharing that already
946
+ // existed when a scan adopted it (package-manager hardlinks, earlier runs)
947
+ // never changed free space and stays out of this number.
948
+ const freedBytes = Math.max(0, Number(data.lifetime_bytes_saved) || 0)
949
+ const sharedNow = Math.max(0, Number(data.saved_by_sharing) || 0)
942
950
  const headline = hasComparison
943
951
  ? (IS_APP_MODE
944
- ? COPY.saved_for_app.replace("{size}", fmt(Math.max(0, beforeBytes - afterBytes)))
945
- : `${fmt(data.saved_by_sharing)} ${COPY.disk_space_saved}`)
952
+ ? COPY.sharing_saves_for_app.replace("{size}", fmt(Math.max(0, beforeBytes - afterBytes)))
953
+ : `${fmt(freedBytes)} ${COPY.disk_space_freed}`)
946
954
  : (IS_APP_MODE ? COPY.find_app_savings : COPY.find_savings)
947
- const help = IS_APP_MODE ? COPY.effective_help : COPY.before_help
955
+ const beforeLabel = COPY.without_sharing
956
+ const afterLabel = IS_APP_MODE ? COPY.app_share : COPY.on_disk
957
+ const help = IS_APP_MODE ? COPY.effective_help : COPY.without_sharing_help
948
958
  const helpId = IS_APP_MODE ? "vault-after-help" : "vault-before-help"
949
959
  const helpMarkup = `<span class="vault-compare-info" tabindex="0" aria-describedby="${helpId}"><i class="fa-regular fa-circle-question" aria-hidden="true"></i><span class="vault-compare-tooltip" id="${helpId}" role="tooltip">${esc(help)}</span></span>`
950
960
  const comparison = hasComparison ? `
951
- <div class="vault-comparison" aria-label="${attr(`${COPY.before}: ${fmt(beforeBytes)}. ${COPY.after}: ${fmt(afterBytes)}.`)}">
961
+ <div class="vault-comparison" aria-label="${attr(`${beforeLabel}: ${fmt(beforeBytes)}. ${afterLabel}: ${fmt(afterBytes)}.`)}">
952
962
  <div class="vault-compare-row">
953
- <span class="vault-compare-label">${esc(COPY.before)}${IS_APP_MODE ? "" : helpMarkup}</span>
963
+ <span class="vault-compare-label">${esc(beforeLabel)}${IS_APP_MODE ? "" : helpMarkup}</span>
954
964
  <span class="vault-compare-track"><span class="vault-compare-fill before"></span></span>
955
965
  <span class="vault-compare-value">${fmt(beforeBytes)}</span>
956
966
  </div>
957
967
  <div class="vault-compare-row">
958
- <span class="vault-compare-label">${esc(COPY.after)}${IS_APP_MODE ? helpMarkup : ""}</span>
968
+ <span class="vault-compare-label">${esc(afterLabel)}${IS_APP_MODE ? helpMarkup : ""}</span>
959
969
  <span class="vault-compare-track"><span class="vault-compare-fill after" style="--vault-after-ratio:${afterRatio.toFixed(2)}%"></span></span>
960
970
  <span class="vault-compare-value">${fmt(afterBytes)}</span>
961
971
  </div>
@@ -976,10 +986,14 @@ const renderOverview = () => {
976
986
  const storageDetails = !IS_APP_MODE && el("vault-storage-details")
977
987
  if (storageDetails) {
978
988
  const homeBytes = last ? (last.home_bytes_total == null ? last.bytes_total : last.home_bytes_total) : null
989
+ // Clamped because deleting linked files later shrinks the live sharing
990
+ // total without touching the lifetime counter.
991
+ const alreadyShared = Math.max(0, sharedNow - freedBytes)
979
992
  storageDetails.innerHTML = `<div class="vault-advanced-title">${esc(COPY.storage_details)}</div>
980
993
  <dl class="vault-storage-list">
981
994
  <div><dt>${esc(COPY.pinokio_folder)}</dt><dd>${homeBytes == null ? "—" : fmt(homeBytes)}</dd></div>
982
- <div><dt>${esc(COPY.saved_by_actions)}</dt><dd>${fmt(data.lifetime_bytes_saved)}</dd></div>
995
+ <div><dt>${esc(COPY.kept_deduplicated)}</dt><dd>${fmt(sharedNow)}</dd></div>
996
+ <div><dt>${esc(COPY.already_shared)}</dt><dd>${fmt(alreadyShared)}</dd></div>
983
997
  </dl>`
984
998
  }
985
999
  }
@@ -1260,11 +1260,11 @@ describe('vault dashboard backend (phase 4)', () => {
1260
1260
 
1261
1261
  test('repair is advanced, metrics distinguish detected and explicit savings, and refresh retries', async () => {
1262
1262
  const vaultPage = await vaultPageSource()
1263
- assert.match(vaultPage, /disk_space_saved:\s*"of disk space saved"/)
1264
- assert.match(vaultPage, /before_help:\s*"Estimated size of every scanned location if each app stored its own copy\. File Explorer may count deduplicated files differently\."/)
1263
+ assert.match(vaultPage, /disk_space_freed:\s*"of disk space freed"/)
1264
+ assert.match(vaultPage, /without_sharing_help:\s*"Estimated size of every scanned location if each app stored its own copy\. File Explorer may count deduplicated files differently\."/)
1265
1265
  assert.match(vaultPage, /nothing_more_to_save:\s*"Nothing else to save"/)
1266
1266
  assert.match(vaultPage, /more_can_be_saved:\s*"\{size\} more can be saved"/)
1267
- assert.match(vaultPage, /fmt\(data\.saved_by_sharing\)/)
1267
+ assert.match(vaultPage, /Number\(data\.saved_by_sharing\)/)
1268
1268
  assert.match(vaultPage, /Number\(data\.bytes_without_sharing\)/)
1269
1269
  assert.match(vaultPage, /Number\(data\.bytes_on_disk\)/)
1270
1270
  assert.match(vaultPage, /Number\(data\.pending_bytes\)/)
@@ -1276,7 +1276,8 @@ describe('vault dashboard backend (phase 4)', () => {
1276
1276
  assert.match(vaultPage, /candidate_size:\s*candidateSize\(\)/)
1277
1277
  assert.match(vaultPage, /localStorage\.setItem\(candidateSizeKey/)
1278
1278
  assert.match(vaultPage, /id='vault-storage-details'/)
1279
- assert.match(vaultPage, /fmt\(data\.lifetime_bytes_saved\)/)
1279
+ assert.match(vaultPage, /Number\(data\.lifetime_bytes_saved\)/)
1280
+ assert.match(vaultPage, /Math\.max\(0, sharedNow - freedBytes\)/)
1280
1281
  assert.match(vaultPage, /repair_index:\s*"Repair index"/)
1281
1282
  assert.match(vaultPage, /<details class='vault-advanced'/)
1282
1283
  assert.doesNotMatch(vaultPage, /id='btn-rebuild'/)
@@ -1525,7 +1526,7 @@ describe('vault dashboard backend (phase 4)', () => {
1525
1526
  await runVaultScript(dom)
1526
1527
  await new Promise((resolve) => setTimeout(resolve, 25))
1527
1528
 
1528
- assert.strictEqual(dom.window.document.querySelector('.vault-summary-value').textContent, '4.51 GB saved for this app')
1529
+ assert.strictEqual(dom.window.document.querySelector('.vault-summary-value').textContent, 'Sharing saves 4.51 GB for this app')
1529
1530
  assert.deepStrictEqual([...dom.window.document.querySelectorAll('.vault-compare-value')].map((node) => node.textContent), ['7.09 GB', '2.58 GB'])
1530
1531
  assert.match(dom.window.document.querySelector('.vault-compare-fill.after').getAttribute('style'), /--vault-after-ratio:36\.36%/)
1531
1532
  assert.strictEqual(dom.window.document.getElementById('vault-after-help').textContent,
@@ -1601,8 +1602,8 @@ describe('vault dashboard backend (phase 4)', () => {
1601
1602
  await runVaultScript(dom)
1602
1603
  await new Promise((resolve) => setTimeout(resolve, 25))
1603
1604
 
1604
- assert.strictEqual(dom.window.document.querySelector('.vault-summary-value').textContent, '256.95 GB of disk space saved')
1605
- assert.deepStrictEqual([...dom.window.document.querySelectorAll('.vault-compare-label')].map((node) => node.firstChild.textContent.trim()), ['Before', 'After'])
1605
+ assert.strictEqual(dom.window.document.querySelector('.vault-summary-value').textContent, '258.77 GB of disk space freed')
1606
+ assert.deepStrictEqual([...dom.window.document.querySelectorAll('.vault-compare-label')].map((node) => node.firstChild.textContent.trim()), ['Without sharing', 'On disk'])
1606
1607
  assert.deepStrictEqual([...dom.window.document.querySelectorAll('.vault-compare-value')].map((node) => node.textContent), ['661.75 GB', '404.8 GB'])
1607
1608
  assert.match(dom.window.document.querySelector('.vault-compare-fill.after').getAttribute('style'), /--vault-after-ratio:61\.17%/)
1608
1609
  assert.strictEqual(dom.window.document.getElementById('vault-before-help').textContent,
@@ -1613,7 +1614,10 @@ describe('vault dashboard backend (phase 4)', () => {
1613
1614
  assert.strictEqual(dom.window.document.getElementById('btn-review-metric').classList.contains('primary'), true)
1614
1615
  assert.strictEqual(dom.window.document.getElementById('btn-scan').classList.contains('primary'), false)
1615
1616
  assert.match(dom.window.document.getElementById('vault-storage-details').textContent, /Pinokio folder\s*166\.22 GB/)
1616
- assert.match(dom.window.document.getElementById('vault-storage-details').textContent, /Saved by your actions\s*258\.77 GB/)
1617
+ assert.match(dom.window.document.getElementById('vault-storage-details').textContent, /Kept deduplicated\s*256\.95 GB/)
1618
+ // lifetime (241) exceeds live sharing (239.3) here, so the clamp keeps
1619
+ // the pre-existing figure at zero instead of going negative.
1620
+ assert.match(dom.window.document.getElementById('vault-storage-details').textContent, /Already shared before Save space\s*0 B/)
1617
1621
  const cleanupNotice = dom.window.document.getElementById('vault-cleanup-notice')
1618
1622
  assert.strictEqual(cleanupNotice.classList.contains('show'), true)
1619
1623
  assert.match(cleanupNotice.textContent, /ready to clean up/)
@@ -1684,7 +1688,7 @@ describe('vault dashboard backend (phase 4)', () => {
1684
1688
  await new Promise((resolve) => setTimeout(resolve, 25))
1685
1689
 
1686
1690
  assert.strictEqual(dom.window.document.querySelector('.vault-summary-value').textContent,
1687
- '3 GB of disk space saved')
1691
+ '3 GB of disk space freed')
1688
1692
  assert.deepStrictEqual(
1689
1693
  [...dom.window.document.querySelectorAll('.vault-compare-value')].map((node) => node.textContent),
1690
1694
  ['10 GB', '7 GB'])