Skip to content

Commit 902875f

Browse files
author
DavidQ
committed
Continue rollback of unstable Workspace V2 changes while preserving safe UI cleanup only - PR_26128_003-continue-yesterday-rollback
1 parent 1ba386c commit 902875f

8 files changed

Lines changed: 85 additions & 330 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PR_26128_003 Continued Rollback Review
2+
3+
## Scope
4+
- Continued the Workspace V2 / Preview Generator rollback after `PR_26127_019`.
5+
- Removed the Preview Generator V2 workspace direct-write path that used absolute `repoPath` hydration and `/__workspace-manager-v2/write-preview`.
6+
- Removed Workspace Manager V2 UI gating and status text that treated manifest `repoPath` as required for Preview Generator launches.
7+
- Removed the Playwright repo server's private preview-write endpoint and write capture maps from workspace V2 validation.
8+
9+
## Preserved
10+
- `tools/session-inspector/**` is present as actual tool/runtime files and was left unchanged.
11+
- Workspace Manager V2 and Preview Generator V2 still launch from the Workspace Manager V2 flow through sessionStorage workspace context.
12+
- Accordion behavior checks remain covered by `tests/playwright/tools/WorkspaceManagerV2.spec.mjs`.
13+
- Schema files, sample JSON, and roadmap content were not modified.
14+
15+
## Validation
16+
- `npm run test:workspace-v2` -> PASS, 10 tests.
17+
- Targeted Workspace Manager V2 launch validation -> PASS.
18+
- Targeted Preview Generator V2 launch validation -> PASS.
19+
- Targeted Session Inspector launch validation -> PASS.
20+
- Verified the private workspace preview write endpoint now returns 404 in the targeted launch validation.
21+
- Verified Git changed files include actual runtime/test changes, not report-only changes.
22+
23+
## Skipped
24+
- Full samples smoke test was skipped by request. This rollback changes Workspace V2 / Preview Generator launch and write plumbing only; the required targeted launch checks and workspace V2 suite cover the affected surface.
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
# PR_26128_001 Rollback Preserved Items
1+
# PR_26128_003 Rollback Preserved Items
22

33
## Preserved Baseline
4-
- Preserved the committed Workspace Manager V2 accordion behavior in `tools/workspace-manager-v2/js/controls/AccordionSection.js`.
5-
- Preserved committed Workspace Manager V2 layout and non-runtime UI consistency updates in `tools/workspace-manager-v2/index.html` and `tools/workspace-manager-v2/styles/workspaceManagerV2.css`.
6-
- Preserved the committed Preview Generator V2 baseline where Workspace Manager launches hydrate from session context and tools-mode repo picking remains local to Preview Generator V2.
7-
- Preserved existing schema files exactly; no `tools/schemas/**` files were changed by this rollback.
8-
- Preserved sample JSON exactly; no `games/**`, `samples/**`, or sample manifest JSON files were changed by this rollback.
9-
- Preserved roadmap content exactly; no roadmap files were changed by this rollback.
4+
- Preserved Workspace Manager V2 accordion behavior; existing accordion validation remains in `tests/playwright/tools/WorkspaceManagerV2.spec.mjs`.
5+
- Preserved rename/move cleanup and cosmetic/layout-only UI consistency work outside the unstable direct-write path.
6+
- Preserved Workspace Manager V2 sessionStorage launch context for first-class tools.
7+
- Preserved Preview Generator V2 tools-mode repo picking as local Preview Generator behavior.
8+
- Preserved existing schema files exactly; no `tools/schemas/**` files were changed.
9+
- Preserved sample JSON exactly; no `games/**`, `samples/**`, or sample manifest JSON files were changed.
10+
- Preserved roadmap content exactly; no roadmap files were changed.
1011

1112
## Session Inspector Note
12-
- `tools/session-inspector/**` is not present in this checkout after rollback, and no files under that path were available to preserve or modify.
13+
- `tools/session-inspector/**` is present as actual tool/runtime files and was preserved unchanged in this rollback.
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# PR_26128_001 Rollback Removed Items
1+
# PR_26128_003 Rollback Removed Items
22

33
## Removed Runtime Rewrites
4-
- Removed the uncommitted Workspace Manager V2 repo scan/select rewrite that added `selectRepoButton`, `activeRepoSummary`, `selectRepoRoot`, repo handle persistence, and `/__repo/games` coupling.
5-
- Removed the uncommitted Preview Generator V2 node write mode rewrite that added `/__preview-generator-v2/write-preview`, `/__repo/status`, persisted repo handle restore, and node endpoint write selection.
6-
- Removed the uncommitted shared `tools/common/RepoHandleStore.js` coupling and `tools/preview-generator-v2/PreviewGeneratorV2RepoHandleStore.js` wrapper.
7-
- Removed the uncommitted `scripts/workspace-v2-dev-server.mjs` dev server and the related `package.json` `dev-tools` / `dev:workspace-v2` script additions.
8-
- Removed the uncommitted storage debug page replacement under `tests/index.html`, `tests/storage-debug.css`, and `tests/storage-debug.js`.
9-
- Removed the uncommitted Workspace V2 test rewrites that depended on node-backed repo selection, storage debug persistence, and persisted browser directory handles.
4+
- Removed Preview Generator V2 workspace absolute `repoPath` hydration used for direct preview writes.
5+
- Removed Preview Generator V2 `/__workspace-manager-v2/write-preview` fetch calls and `X-Workspace-Preview-*` headers.
6+
- Removed Preview Generator V2 direct-write validation, absolute path resolution, direct-write logging, and direct-write fallback handling.
7+
- Removed Workspace Manager V2 summary copy that asked users to select a repo before direct preview writes.
8+
- Removed Workspace Manager V2 preview tile `repoPathReady` gating and the `Select Repo` preview tile status.
9+
- Removed the Playwright repo server's private preview-write endpoint and preview write capture maps.
1010

1111
## Restored Baseline Behavior
12-
- Workspace Manager V2 now uses the committed static game list and sessionStorage-based workspace context flow.
13-
- Preview Generator V2 workspace launch uses the committed session-context repoPath hydration path and no longer depends on the removed node dev-tools server.
14-
- Preview Generator V2 tools-mode repo picking remains scoped to Preview Generator V2 and is not shared through IndexedDB or Workspace Manager V2 auto-wiring.
12+
- Workspace Manager V2 launches Preview Generator V2 with display-only workspace context.
13+
- Preview Generator V2 workspace launches hydrate the selected game, asset folder, preview target, and preview image without writing files.
14+
- Preview Generator V2 preview writes require the normal Preview Generator repo folder selection path.
15+
- Workspace Manager V2 no longer exposes runtime coupling for Preview Generator V2 writes.

tests/helpers/playwrightRepoServer.mjs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,62 +23,17 @@ function isInsideRepoRoot(absolutePath) {
2323
}
2424

2525
export async function startRepoServer() {
26-
const previewWrites = new Map();
27-
const previewAbsoluteWrites = new Map();
2826
const server = http.createServer(async (request, response) => {
2927
try {
3028
const requestUrl = new URL(request.url || "/", "http://127.0.0.1");
3129
const decodedPath = decodeURIComponent(requestUrl.pathname);
32-
if (request.method === "PUT" && decodedPath === "/__workspace-manager-v2/write-preview") {
33-
const absoluteWritePath = String(request.headers["x-workspace-preview-absolute-path"] || "");
34-
const relativeWritePath = String(request.headers["x-workspace-preview-relative-path"] || "");
35-
const resolvedWritePath = path.resolve(absoluteWritePath);
36-
const repoRelativePath = relativeWritePath
37-
? relativeWritePath.replaceAll("\\", "/").replace(/^\/+/, "")
38-
: path.relative(repoRoot, resolvedWritePath).replaceAll("\\", "/");
39-
if (!absoluteWritePath || !isInsideRepoRoot(resolvedWritePath)) {
40-
response.statusCode = 403;
41-
response.end("Preview write path must be inside the repo root.");
42-
return;
43-
}
44-
if (!repoRelativePath || repoRelativePath.startsWith("..") || path.isAbsolute(repoRelativePath)) {
45-
response.statusCode = 400;
46-
response.end("Preview write relative path is invalid.");
47-
return;
48-
}
49-
const bodyChunks = [];
50-
for await (const chunk of request) {
51-
bodyChunks.push(chunk);
52-
}
53-
const body = Buffer.concat(bodyChunks).toString("utf8");
54-
previewWrites.set(repoRelativePath, body);
55-
previewAbsoluteWrites.set(resolvedWritePath, body);
56-
response.statusCode = 200;
57-
response.setHeader("Content-Type", "text/plain; charset=utf-8");
58-
response.end("OK");
59-
return;
60-
}
6130
const normalizedPath = path.normalize(decodedPath).replace(/^(\.\.[/\\])+/, "");
6231
const absolutePath = path.resolve(repoRoot, `.${normalizedPath}`);
6332
if (!isInsideRepoRoot(absolutePath)) {
6433
response.statusCode = 403;
6534
response.end("Forbidden");
6635
return;
6736
}
68-
if (request.method === "PUT") {
69-
const bodyChunks = [];
70-
for await (const chunk of request) {
71-
bodyChunks.push(chunk);
72-
}
73-
const repoRelativePath = normalizedPath
74-
.replaceAll("\\", "/")
75-
.replace(/^\/+/, "");
76-
previewWrites.set(repoRelativePath, Buffer.concat(bodyChunks).toString("utf8"));
77-
response.statusCode = 200;
78-
response.setHeader("Content-Type", "text/plain; charset=utf-8");
79-
response.end("OK");
80-
return;
81-
}
8237
let targetPath = absolutePath;
8338
const stat = await fs.stat(targetPath).catch(() => null);
8439
if (stat && stat.isDirectory()) {
@@ -107,8 +62,6 @@ export async function startRepoServer() {
10762
return {
10863
baseUrl: `http://127.0.0.1:${address.port}`,
10964
repoRoot,
110-
previewAbsoluteWrites,
111-
previewWrites,
11265
close: async () => {
11366
await new Promise((resolve, reject) => {
11467
const forceClose = setTimeout(() => {

0 commit comments

Comments
 (0)