Skip to content

Commit f48aa88

Browse files
author
DavidQ
committed
Remove final active Phase-20 runtime hook from shared platform shell by deleting legacy preset decode/read/apply logic and init call, while preserving samplePresetPath workspace initialization flow (batch-50 PASS).
1 parent 878a366 commit f48aa88

3 files changed

Lines changed: 22 additions & 49 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Samples2Tools batch 50 summary
2+
Generated: 2026-04-24T22:55:13.374Z
3+
Purpose: remove final Phase-20 runtime wiring from shared tool platform shell.
4+
5+
Completed this batch:
6+
- Deleted legacy Phase-20 preset decode/read/apply functions from platformShell
7+
- Removed one-time Phase-20 preset apply call during platform shell init
8+
- Kept active samplePresetPath and workspace controller behavior intact
9+
10+
Primary validation artifact:
11+
- docs/dev/reports/samples2tools_batch_50_validation.txt (PASS)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Samples2Tools batch 50 validation
2+
Generated: 2026-04-24T22:55:13.374Z
3+
Scope: remove residual Phase-20 preset application hooks from shared platform shell runtime.
4+
5+
- [PASS] platformShell has no Phase-20 preset constants/hooks :: tools/shared/platformShell.js
6+
- [PASS] platformShell still initializes workspace controller watching :: tools/shared/platformShell.js
7+
- [PASS] platformShell still skips initial tool state apply for samplePresetPath flow :: tools/shared/platformShell.js
8+
9+
Checks: 3
10+
Failures: 0
11+
Result: PASS

tools/shared/platformShell.js

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const HEADER_EXPANDED_STORAGE_KEY = "toolboxaid.toolsPlatform.headerExpanded";
2222
const HEADER_EXPANDED_FALLBACK_TOOL = "tool-host";
2323
const TOOLS_PLATFORM_LOGGER = new Logger({ channel: "tools.platform", level: "debug" });
2424
const TOOLS_PLATFORM_BOOT_MS = Date.now();
25-
const APPLIED_PRESET_KEY = "__TOOLS_PLATFORM_PHASE20_PRESET_APPLIED__";
2625

2726
function getPageMode() {
2827
return document.body.dataset.toolsPlatformPage || "tool";
@@ -731,53 +730,6 @@ function ensureRuntimeMonitoring() {
731730
}, { once: true });
732731
}
733732

734-
function decodeSamplePresetPayload(encoded) {
735-
if (typeof encoded !== "string" || !encoded.trim()) {
736-
return null;
737-
}
738-
try {
739-
const base64 = encoded.replace(/-/g, "+").replace(/_/g, "/");
740-
const padded = `${base64}${"=".repeat((4 - (base64.length % 4)) % 4)}`;
741-
const jsonText = atob(padded);
742-
const parsed = JSON.parse(jsonText);
743-
return parsed && typeof parsed === "object" ? parsed : null;
744-
} catch {
745-
return null;
746-
}
747-
}
748-
749-
function readPhase20PresetFromLocation(currentToolId = "") {
750-
if (typeof window === "undefined") {
751-
return null;
752-
}
753-
const params = new URLSearchParams(window.location.search);
754-
const samplePreset = decodeSamplePresetPayload(params.get("samplePreset") || "");
755-
if (!samplePreset || samplePreset.toolId !== currentToolId || !samplePreset.state || typeof samplePreset.state !== "object") {
756-
return null;
757-
}
758-
return {
759-
sampleId: typeof samplePreset.sampleId === "string" ? samplePreset.sampleId : "",
760-
label: typeof samplePreset.label === "string" ? samplePreset.label : "",
761-
state: samplePreset.state
762-
};
763-
}
764-
765-
function maybeApplyPhase20Preset(currentToolId = "") {
766-
if (!workspaceController || !currentToolId || window[APPLIED_PRESET_KEY] === true) {
767-
return;
768-
}
769-
const preset = readPhase20PresetFromLocation(currentToolId);
770-
if (!preset) {
771-
return;
772-
}
773-
const label = preset.label || `Phase 20 sample ${preset.sampleId || "preset"}`;
774-
workspaceController.applyExternalToolState({
775-
state: preset.state,
776-
label
777-
});
778-
window[APPLIED_PRESET_KEY] = true;
779-
}
780-
781733
function initPlatformShell() {
782734
ensureRuntimeMonitoring();
783735

@@ -821,7 +773,6 @@ function initPlatformShell() {
821773
}
822774
});
823775
workspaceController.startWatching();
824-
maybeApplyPhase20Preset(currentToolId);
825776
}
826777

827778
renderShell(currentTool);

0 commit comments

Comments
 (0)