pinokiod 8.0.107 → 8.0.108

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.107",
3
+ "version": "8.0.108",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -1833,6 +1833,13 @@ class Server {
1833
1833
  const dev_initial_tab = type === "browse" && req.query && req.query.pinokio_dev_tab === "files"
1834
1834
  ? "files"
1835
1835
  : "plugins"
1836
+ // Disk Saver hands one content group to another app: the page opens with
1837
+ // its Disk Saver tab selected and that group already expanded.
1838
+ const vault_initial_group = req.query &&
1839
+ typeof req.query.vault_group === "string" &&
1840
+ /^[a-f0-9]{64}$/i.test(req.query.vault_group)
1841
+ ? req.query.vault_group.toLowerCase()
1842
+ : null
1836
1843
 
1837
1844
  const registryEnabled = await this.isRegistryEnabled().catch(() => false)
1838
1845
  let community_url = ""
@@ -1956,6 +1963,7 @@ class Server {
1956
1963
  tabs: savedTabs,
1957
1964
  editor_tab: editor_tab,
1958
1965
  dev_initial_tab,
1966
+ vault_initial_group,
1959
1967
  config,
1960
1968
  protection_enabled: protectionPreference ? protectionPreference.protection_enabled !== false : false,
1961
1969
  autolaunch_app: autolaunchAppState,
@@ -238,7 +238,7 @@ const COPY = {
238
238
  show_more_copies: "Show {count} more copies",
239
239
  loading_locations: "Loading locations…",
240
240
  open_in_disk_saver: "Open this file in Disk Saver",
241
- open_location_confirm: "Open Disk Saver for {location}?",
241
+ open_location_confirm: "Open Disk Saver to review {location}?",
242
242
  open_location_accept: "Open",
243
243
  show_more_locations: "Show {count} more locations",
244
244
  making_separate: "Making file separate",
@@ -658,23 +658,22 @@ const confirmLeave = (message, confirmLabel) => new Promise((resolve) => {
658
658
  const openGlobalWorkspace = () => {
659
659
  window.parent.location.assign("/vault")
660
660
  }
661
- // A copy that belongs to another app opens that app's own workspace, where it
662
- // can actually be acted on; caches and external folders have no app page, so
663
- // they open the global one. Accepting replaces the parent window, because this
664
- // workspace can be embedded in an app page and navigating in place would nest a
665
- // second copy of the interface inside that frame.
661
+ // A copy in another app opens that app's page with its Disk Saver tab selected
662
+ // and the group expanded, because an app's workspace only exists inside that
663
+ // page; opening the workspace URL directly strands the user with no navigation.
664
+ // Locations that are not apps have no such page and open the global workspace.
665
+ // The label and kind travel with the row: an app workspace cannot look up
666
+ // sources belonging to other apps.
666
667
  const openContentGroup = async (group, kind, label) => {
667
- // The label and kind travel with the row: an app workspace cannot look up
668
- // sources belonging to other apps, so a lookup here would name every one of
669
- // them "unknown" and send them all to the global page.
670
- const app = kind === "app" && label ? label : null
671
- const name = label || COPY.unknown_location
672
668
  const accepted = await confirmLeave(
673
- COPY.open_location_confirm.replace("{location}", name),
669
+ COPY.open_location_confirm.replace(
670
+ "{location}", label || COPY.unknown_location),
674
671
  COPY.open_location_accept)
675
672
  if (!accepted) return
676
- const base = app ? `/vault/app/${encodeURIComponent(app)}` : "/vault"
677
- window.parent.location.assign(`${base}?group=${encodeURIComponent(group)}`)
673
+ const target = kind === "app" && label
674
+ ? `/pinokio/browser/${encodeURIComponent(label)}?vault_group=${encodeURIComponent(group)}`
675
+ : `/vault?group=${encodeURIComponent(group)}`
676
+ window.parent.location.assign(target)
678
677
  }
679
678
  const applyAutomaticScanSnapshot = (snapshot) => {
680
679
  if (!IS_APP_MODE || !AUTOMATIC_SUPPORTED) return
@@ -8694,7 +8694,7 @@ body.dark .pinokio-custom-terminal-header {
8694
8694
  <% const vaultAutomaticSupported = typeof vault_automatic_supported === 'undefined' || vault_automatic_supported === true %>
8695
8695
  <% const vaultAutomaticResultSignature = vaultAutomaticSupported && typeof vault_automatic_result_signature === 'string' ? vault_automatic_result_signature : '' %>
8696
8696
  <% const vaultSidebarLabel = !vaultGlobalScanReady ? 'Disk Saver — Set up required' : vaultAutomaticSupported ? `Disk Saver — ${vaultAutomaticMode === 'automatic' ? 'Automatic' : 'Manual'} checking${vaultAutomaticResultSignature ? ' — Duplicate files found' : ''}` : 'Disk Saver' %>
8697
- <a id='save-space-tab' data-mode="refresh" target="app-vault" href="/vault/app/<%=encodeURIComponent(name)%>" class="btn header-item frame-link<%=vaultAutomaticResultSignature ? ' app-vault-result-attention' : ''%>" data-index="vault" data-static="retain" data-tab-link-popover="false" aria-label="<%=vaultSidebarLabel%>">
8697
+ <a id='save-space-tab' data-mode="refresh" target="app-vault" href="/vault/app/<%=encodeURIComponent(name)%><%=typeof vault_initial_group === 'string' && vault_initial_group ? `?group=${vault_initial_group}` : ''%>" class="btn header-item frame-link<%=vaultAutomaticResultSignature ? ' app-vault-result-attention' : ''%>" data-index="vault" data-static="retain" data-tab-link-popover="false" aria-label="<%=vaultSidebarLabel%>">
8698
8698
  <div class='tab'>
8699
8699
  <i class="fa-solid fa-hard-drive menu-action-leading-icon"></i>
8700
8700
  <div class='display'>Disk Saver</div>
@@ -9183,6 +9183,14 @@ body.dark .pinokio-custom-terminal-header {
9183
9183
  window.history.replaceState(window.history.state, "", `${devTabUrl.pathname}${devTabUrl.search}${devTabUrl.hash}`)
9184
9184
  } catch (_) {}
9185
9185
  <% } %>
9186
+ <% if (typeof vault_initial_group === 'string' && vault_initial_group) { %>
9187
+ global_selector = "#save-space-tab.frame-link"
9188
+ try {
9189
+ const vaultTabUrl = new URL(window.location.href)
9190
+ vaultTabUrl.searchParams.delete("vault_group")
9191
+ window.history.replaceState(window.history.state, "", `${vaultTabUrl.pathname}${vaultTabUrl.search}${vaultTabUrl.hash}`)
9192
+ } catch (_) {}
9193
+ <% } %>
9186
9194
  let pendingSelectionRetry = null
9187
9195
  let pendingHomeSelectionRetry = null
9188
9196
  let initialWorkspaceDiskUsageRequested = false