Skip to content

Commit 05f6e41

Browse files
author
DavidQ
committed
Continued with another cleanup slice and removed leftover Phase 20 compatibility code from Workspace Manager runtime.
Updated: - Removed legacy Phase 20 preset decoder/query paths and fallback state injection in: - [main.js](C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\tools\Workspace Manager\main.js) Validation: - [samples2tools_batch_46_validation.txt](C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\docs\dev\reports\samples2tools_batch_46_validation.txt) (`PASS`) - [samples2tools_batch_46_summary.txt](C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\docs\dev\reports\samples2tools_batch_46_summary.txt) What stayed intact: - Tool JSON state mounting flow - Workspace game host context flow Commit comment: `Remove residual Phase-20 compatibility from Workspace Manager by deleting samplePreset decode/query fallback paths while preserving current tool state mount and workspace game host context flows (batch-46 PASS).`
1 parent 37f0269 commit 05f6e41

3 files changed

Lines changed: 22 additions & 37 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Samples2Tools batch 46 summary
2+
Generated: 2026-04-24T22:43:44.280Z
3+
Purpose: eliminate leftover Phase-20 host preset code and keep runtime focused on current Workspace flows.
4+
5+
Completed this batch:
6+
- Removed phase20 samplePreset decode/query fallback functions from Workspace Manager
7+
- Removed phase20-based optional tool state auto-injection path
8+
- Kept tool JSON-state mount flow and game host context flow intact
9+
10+
Primary validation artifact:
11+
- docs/dev/reports/samples2tools_batch_46_validation.txt (PASS)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Samples2Tools batch 46 validation
2+
Generated: 2026-04-24T22:43:44.280Z
3+
Scope: remove residual Phase-20 compatibility paths from Workspace Manager runtime.
4+
5+
- [PASS] Workspace Manager main has no legacy phase20 decode/query helpers :: tools/Workspace Manager/main.js
6+
- [PASS] Workspace Manager still supports normal tool mount state injection from UI JSON :: tools/Workspace Manager/main.js
7+
- [PASS] Workspace Manager still supports game host context wiring :: tools/Workspace Manager/main.js
8+
9+
Checks: 3
10+
Failures: 0
11+
Result: PASS

tools/Workspace Manager/main.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,6 @@ const hasAvailableTools = toolIds.length > 0;
2727
let currentGameFrame = null;
2828
let currentGameHostContextId = "";
2929

30-
function decodeSamplePresetPayload(encoded) {
31-
if (typeof encoded !== "string" || !encoded.trim()) {
32-
return null;
33-
}
34-
try {
35-
const base64 = encoded.replace(/-/g, "+").replace(/_/g, "/");
36-
const padded = `${base64}${"=".repeat((4 - (base64.length % 4)) % 4)}`;
37-
const jsonText = atob(padded);
38-
const parsed = JSON.parse(jsonText);
39-
return parsed && typeof parsed === "object" ? parsed : null;
40-
} catch {
41-
return null;
42-
}
43-
}
44-
45-
function readPhase20PresetFromQuery() {
46-
const url = new URL(window.location.href);
47-
const parsed = decodeSamplePresetPayload(url.searchParams.get("samplePreset") || "");
48-
if (!parsed || typeof parsed.state !== "object") {
49-
return null;
50-
}
51-
return {
52-
toolId: typeof parsed.toolId === "string" ? parsed.toolId : "",
53-
sampleId: typeof parsed.sampleId === "string" ? parsed.sampleId : "",
54-
label: typeof parsed.label === "string" ? parsed.label : "",
55-
state: parsed.state
56-
};
57-
}
58-
59-
const phase20Preset = readPhase20PresetFromQuery();
60-
6130
function readSelectedToolId() {
6231
return refs.toolSelect instanceof HTMLSelectElement ? refs.toolSelect.value : "";
6332
}
@@ -344,9 +313,6 @@ function mountSelectedTool(source = "manual") {
344313
}
345314
}
346315
}
347-
if (!optionalState && phase20Preset && (phase20Preset.toolId === toolId || phase20Preset.toolId === "workspace-manager")) {
348-
optionalState = phase20Preset.state;
349-
}
350316
updateSwitchMeta();
351317
updateStandaloneHref(toolId);
352318
writeQueryToolId(toolId, source === "init");
@@ -361,9 +327,6 @@ function mountSelectedTool(source = "manual") {
361327
},
362328
state: optionalState
363329
});
364-
if (phase20Preset && (phase20Preset.toolId === toolId || phase20Preset.toolId === "workspace-manager")) {
365-
writeStatus(`Mounting ${toolId} with preset ${phase20Preset.sampleId || phase20Preset.label || "state"}.`);
366-
}
367330
syncControlState();
368331
}
369332

0 commit comments

Comments
 (0)