pinokiod 8.0.67 → 8.0.69
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
|
@@ -186,12 +186,21 @@
|
|
|
186
186
|
!event.data || typeof event.data !== "object") return
|
|
187
187
|
if (event.data.e === "vault-automatic-scan-state" &&
|
|
188
188
|
window.parent !== window && event.source === window.parent) {
|
|
189
|
+
const firstParentState = parentStateVersion === 0
|
|
189
190
|
parentStateVersion += 1
|
|
190
191
|
if (fallbackTimer !== null) {
|
|
191
192
|
window.clearTimeout(fallbackTimer)
|
|
192
193
|
fallbackTimer = null
|
|
193
194
|
}
|
|
194
|
-
|
|
195
|
+
const snapshot = normalizeSnapshot(event.data.snapshot)
|
|
196
|
+
const result = snapshot.rows.find((item) => item.app === app)
|
|
197
|
+
const currentSignature = status.dataset.resultSignature || ""
|
|
198
|
+
const parentSignature = result ? result.signature : ""
|
|
199
|
+
if (firstParentState && currentSignature && currentSignature !== parentSignature) {
|
|
200
|
+
loadState()
|
|
201
|
+
return
|
|
202
|
+
}
|
|
203
|
+
applySnapshot(snapshot)
|
|
195
204
|
relaySnapshot()
|
|
196
205
|
return
|
|
197
206
|
}
|
package/server/views/app.ejs
CHANGED
|
@@ -4115,13 +4115,10 @@ body.dark .disk-usage {
|
|
|
4115
4115
|
inset: 0;
|
|
4116
4116
|
z-index: 0;
|
|
4117
4117
|
border-radius: inherit;
|
|
4118
|
-
background:
|
|
4118
|
+
background: var(--pinokio-sidebar-notice-flash-bg);
|
|
4119
4119
|
opacity: 0;
|
|
4120
4120
|
pointer-events: none;
|
|
4121
4121
|
}
|
|
4122
|
-
body.dark .appcanvas.vertical > aside .menu-actions #save-space-tab::before {
|
|
4123
|
-
background: rgba(224, 165, 75, 0.18);
|
|
4124
|
-
}
|
|
4125
4122
|
.appcanvas.vertical > aside .menu-actions #save-space-tab > .tab {
|
|
4126
4123
|
position: relative;
|
|
4127
4124
|
z-index: 1;
|
|
@@ -4132,10 +4129,10 @@ body.dark .appcanvas.vertical > aside .menu-actions #save-space-tab::before {
|
|
|
4132
4129
|
justify-content: center;
|
|
4133
4130
|
flex: 0 0 auto;
|
|
4134
4131
|
padding: 1px 5px;
|
|
4135
|
-
border: 1px solid rgba(
|
|
4132
|
+
border: 1px solid rgba(255,255,255,0.28);
|
|
4136
4133
|
border-radius: 4px;
|
|
4137
|
-
color: #
|
|
4138
|
-
background:
|
|
4134
|
+
color: #fff;
|
|
4135
|
+
background: #b91c1c;
|
|
4139
4136
|
font-size: 10px;
|
|
4140
4137
|
font-weight: 600;
|
|
4141
4138
|
line-height: 1.2;
|
|
@@ -4146,9 +4143,9 @@ body.dark .appcanvas.vertical > aside .menu-actions #save-space-tab::before {
|
|
|
4146
4143
|
display: none;
|
|
4147
4144
|
}
|
|
4148
4145
|
body.dark .app-vault-result-badge {
|
|
4149
|
-
border-color: rgba(
|
|
4150
|
-
color: #
|
|
4151
|
-
background:
|
|
4146
|
+
border-color: rgba(255,255,255,0.22);
|
|
4147
|
+
color: #fff;
|
|
4148
|
+
background: #dc2626;
|
|
4152
4149
|
}
|
|
4153
4150
|
#save-space-tab.app-vault-result-attention::before {
|
|
4154
4151
|
animation: app-vault-result-attention 800ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
@@ -8573,7 +8570,7 @@ body.dark .pinokio-custom-terminal-header {
|
|
|
8573
8570
|
<i class="fa-solid fa-hard-drive menu-action-leading-icon"></i>
|
|
8574
8571
|
<div class='display'>Disk Saver</div>
|
|
8575
8572
|
<% if (vaultAutomaticSupported) { %>
|
|
8576
|
-
<span class="app-vault-result-badge" data-app-vault-result-badge title="
|
|
8573
|
+
<span class="app-vault-result-badge" data-app-vault-result-badge title="New possible duplicate matches found" aria-hidden="true" <%=vaultAutomaticResultSignature ? '' : 'hidden'%>>New</span>
|
|
8577
8574
|
<% } %>
|
|
8578
8575
|
<div class='flexible'></div>
|
|
8579
8576
|
<% if (vaultAutomaticSupported) { %>
|
|
@@ -435,9 +435,13 @@ test("the app sidebar mirrors the shared layout state without another event stre
|
|
|
435
435
|
assert.match(template, /data-app-vault-mode/)
|
|
436
436
|
assert.match(template, /data-app-vault-result-badge/)
|
|
437
437
|
assert.match(template,
|
|
438
|
-
/class="app-vault-result-badge"[\s\S]{0,200}>
|
|
438
|
+
/class="app-vault-result-badge"[\s\S]{0,200}>New<\/span>/)
|
|
439
439
|
assert.match(template,
|
|
440
|
-
/\.app-vault-result-badge\s*\{[^}]*
|
|
440
|
+
/\.app-vault-result-badge\s*\{[^}]*color:\s*#fff;[^}]*background:\s*#b91c1c;/s)
|
|
441
|
+
assert.match(template,
|
|
442
|
+
/body\.dark \.app-vault-result-badge\s*\{[^}]*background:\s*#dc2626;/s)
|
|
443
|
+
assert.match(template,
|
|
444
|
+
/#save-space-tab::before\s*\{[^}]*background:\s*var\(--pinokio-sidebar-notice-flash-bg\);/s)
|
|
441
445
|
assert.doesNotMatch(template,
|
|
442
446
|
/\.app-vault-result-badge\s*\{[^}]*border-radius:\s*50%/s)
|
|
443
447
|
assert.match(template, /app-vault-mode\.js/)
|
|
@@ -576,3 +580,61 @@ test("a late parent state is not overwritten by the app badge fallback", async (
|
|
|
576
580
|
dom.window.close()
|
|
577
581
|
parent.window.close()
|
|
578
582
|
})
|
|
583
|
+
|
|
584
|
+
test("a stale parent replay cannot clear a server-rendered result", async () => {
|
|
585
|
+
const script = await fs.promises.readFile(
|
|
586
|
+
path.join(root, "server", "public", "app-vault-mode.js"), "utf8")
|
|
587
|
+
const signature = "d".repeat(64)
|
|
588
|
+
const parent = new JSDOM("", { url: "http://localhost/" })
|
|
589
|
+
const dom = new JSDOM(`<a id="save-space-tab">
|
|
590
|
+
<span data-app-vault-result-badge></span>
|
|
591
|
+
<span data-app-vault-mode data-app="ComfyUI" data-mode="automatic"
|
|
592
|
+
data-ready="true" data-result-signature="${signature}">
|
|
593
|
+
<span data-app-vault-mode-label>Auto</span>
|
|
594
|
+
</span>
|
|
595
|
+
</a>`, {
|
|
596
|
+
runScripts: "outside-only",
|
|
597
|
+
url: "http://localhost/v/ComfyUI"
|
|
598
|
+
})
|
|
599
|
+
Object.defineProperty(dom.window, "parent", {
|
|
600
|
+
configurable: true,
|
|
601
|
+
value: parent.window
|
|
602
|
+
})
|
|
603
|
+
parent.window.postMessage = () => {}
|
|
604
|
+
const requests = []
|
|
605
|
+
dom.window.fetch = async (url) => {
|
|
606
|
+
requests.push(url)
|
|
607
|
+
return {
|
|
608
|
+
ok: true,
|
|
609
|
+
json: async () => ({
|
|
610
|
+
global_scan_ready: true,
|
|
611
|
+
rows: [{ app: "ComfyUI", state: "result", signature }],
|
|
612
|
+
settings: [{ app: "ComfyUI", mode: "automatic" }]
|
|
613
|
+
})
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
dom.window.eval(script)
|
|
618
|
+
dom.window.dispatchEvent(new dom.window.MessageEvent("message", {
|
|
619
|
+
source: parent.window,
|
|
620
|
+
origin: "http://localhost",
|
|
621
|
+
data: {
|
|
622
|
+
e: "vault-automatic-scan-state",
|
|
623
|
+
snapshot: {
|
|
624
|
+
global_scan_ready: true,
|
|
625
|
+
rows: [],
|
|
626
|
+
settings: []
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}))
|
|
630
|
+
|
|
631
|
+
await waitFor(() => requests.length === 1)
|
|
632
|
+
assert.deepEqual(requests, ["/info/vault/automatic-scans"])
|
|
633
|
+
assert.equal(dom.window.document.querySelector(
|
|
634
|
+
"[data-app-vault-result-badge]").hidden, false)
|
|
635
|
+
assert.equal(dom.window.document.querySelector(
|
|
636
|
+
"[data-app-vault-mode]").dataset.resultSignature, signature)
|
|
637
|
+
|
|
638
|
+
dom.window.close()
|
|
639
|
+
parent.window.close()
|
|
640
|
+
})
|