Skip to content

Commit c010582

Browse files
author
DavidQ
committed
Add Workspace JSON copy, auto-hydrate Preview Generator repo path, and align game manifests - PR_26127_010-workspace-json-copy-and-game-manifest-updates
1 parent adb2bc2 commit c010582

12 files changed

Lines changed: 542 additions & 420 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# PR_26127_010 Workspace JSON Copy And Game Manifest Updates
2+
3+
## Summary
4+
- Read `docs/dev/PROJECT_INSTRUCTIONS.md` before implementation.
5+
- Updated Workspace Manager V2 Workspace JSON to use a readonly textarea with a `[copy]` action in the accordion header.
6+
- Copy now writes the current textarea value to the clipboard, falls back to selection copy when available, and logs clear success/failure to Status.
7+
- Aligned `games/GravityWell/game.manifest.json` and `games/pong/game.manifest.json` to `tools/schemas/workspace.manifest.schema.json`.
8+
- Updated Preview Generator V2 workspace launch hydration so repo selection comes from the workspace manifest repo root and Generate enables without manually clicking Pick Repo Folder when the launch context is valid.
9+
- Kept Workspace Manager V2 launch target source constrained to Games during workspace launch.
10+
11+
## Manifest Notes
12+
- Gravity Well and Pong manifests now use `documentKind: "workspace-manifest"`.
13+
- Required tool payloads are limited to `palette-manager-v2` and `asset-manager-v2`.
14+
- Image assets use the current asset object structure with `type`, `kind`, `role`, `path`, and `source`.
15+
- Preview-role image assets are represented in the Asset Manager V2 asset registry rather than a standalone manifest preview path.
16+
- No deprecated `asset-browser`, `palette-browser`, root wrapper context, or sample/tool workspace roots were added.
17+
18+
## Workspace JSON Copy Notes
19+
- `[copy]` copies the current Workspace JSON textarea content, not a cached manifest value.
20+
- Clipboard API success logs `OK Copied Workspace JSON to clipboard (...)`.
21+
- Clipboard API absence or failure is not silent; Status logs `FAIL Workspace JSON copy failed: ...`.
22+
- The Workspace JSON accordion was adjusted so the header and copy button remain clickable after the Tools control expands.
23+
24+
## Preview Launch Notes
25+
- Preview Generator V2 reads the workspace manifest repo root into Repo selected during Workspace Manager V2 launch.
26+
- Preview target hydration uses the manifest-selected preview image source and generated output target.
27+
- Generate Image enables when repo root context, Games target source, asset folder, and preview image path validate.
28+
- When the browser has a workspace repo root string but no File System Access directory handle, generation logs that output will download because direct path writes are unavailable from browser context.
29+
30+
## Validation
31+
- `npm run test:workspace-v2` passed: 25/25 Playwright tests.
32+
- `games/GravityWell/game.manifest.json` validated against `tools/schemas/workspace.manifest.schema.json`: valid.
33+
- `games/pong/game.manifest.json` validated against `tools/schemas/workspace.manifest.schema.json`: valid.
34+
- Syntax checks passed for changed Workspace Manager V2, Preview Generator V2, and Playwright helper JavaScript.
35+
36+
## Manual Validation
37+
- Open Workspace Manager V2, load Asteroids, Gravity Well, and Pong, and confirm Workspace JSON reflects the selected manifest.
38+
- Use Workspace JSON `[copy]` and confirm Status logs success; test a blocked clipboard environment and confirm Status logs failure.
39+
- Launch Preview Generator V2 from Workspace Manager V2 and confirm Repo selected is the repo root context, target source shows Games only, preview target is hydrated, and Generate Image is enabled.
40+
- Full samples smoke test skipped because this PR is Workspace/Preview launch and manifest scoped.

games/GravityWell/game.manifest.json

Lines changed: 76 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,88 @@
11
{
2-
"schema": "html-js-gaming.game-manifest",
2+
"$schema": "tools/schemas/workspace.manifest.schema.json",
3+
"documentKind": "workspace-manifest",
4+
"schema": "html-js-gaming.project",
35
"version": 1,
4-
"game": {
5-
"id": "GravityWell",
6-
"name": "Gravity Well",
7-
"folder": "GravityWell"
8-
},
9-
"launch": {
10-
"directPath": "/games/GravityWell/index.html",
11-
"workspaceManagerPath": "/tools/Workspace%20Manager/index.html?gameId=GravityWell&mount=game",
12-
"workspaceManagerOptional": true
13-
},
6+
"id": "workspace-manager-v2-GravityWell",
7+
"name": "Gravity Well Workspace Manager V2 Context",
8+
"gameId": "GravityWell",
9+
"gameRoot": "games/GravityWell/",
10+
"assetsPath": "games/GravityWell/assets",
11+
"repoRoot": "HTML-JavaScript-Gaming",
1412
"tools": {
15-
"asset-browser": {
16-
"assets": {
17-
"image.gravitywell.preview": {
18-
"path": "games/GravityWell/assets/images/preview.svg",
19-
"kind": "image",
20-
"source": "workspace-manager"
21-
}
22-
},
23-
"schema": "html-js-gaming.tool.asset-browser",
13+
"palette-manager-v2": {
14+
"$schema": "tools/schemas/tools/palette-manager-v2.schema.json",
15+
"schema": "html-js-gaming.palette",
2416
"version": 1,
25-
"name": "Asset Browser",
26-
"source": "manifest"
27-
},
28-
"primitive-skin-editor": {
29-
"skins": [],
30-
"schema": "html-js-gaming.tool.primitive-skin-editor",
31-
"version": 1,
32-
"name": "Primitive Skin Editor",
33-
"source": "manifest"
34-
},
35-
"svg-asset-studio": {
36-
"schema": "html-js-gaming.tool.svg-asset-studio",
37-
"version": 1,
38-
"name": "SVG Asset Studio",
17+
"name": "Gravity Well Palette",
3918
"source": "manifest",
40-
"vectors": {
41-
"vector.gravitywell.ship": {
42-
"id": "vector.gravitywell.ship",
43-
"type": "vector",
44-
"source": {
45-
"kind": "runtime-shape",
46-
"origin": "games/GravityWell/game/GravityWellWorld.js::SHIP_SHAPE"
47-
},
48-
"geometry": {
49-
"viewBox": "-16 -16 32 32",
50-
"paths": [
51-
{
52-
"d": "M 0 -16 L 11 14 L 0 8 L -11 14 Z"
53-
}
54-
]
55-
},
56-
"style": {
57-
"stroke": true,
58-
"fill": false
59-
}
19+
"swatches": [
20+
{
21+
"symbol": "!",
22+
"hex": "#081121",
23+
"name": "Background"
24+
},
25+
{
26+
"symbol": "#",
27+
"hex": "#1D4ED8",
28+
"name": "Gravity Blue"
29+
},
30+
{
31+
"symbol": "$",
32+
"hex": "#1E293B",
33+
"name": "Planet Shadow"
34+
},
35+
{
36+
"symbol": "%",
37+
"hex": "#244266",
38+
"name": "Arena Border"
39+
},
40+
{
41+
"symbol": "&",
42+
"hex": "#F8FAFC",
43+
"name": "Ship White"
44+
},
45+
{
46+
"symbol": "(",
47+
"hex": "#FBBF24",
48+
"name": "Thrust Amber"
49+
},
50+
{
51+
"symbol": ")",
52+
"hex": "#60A5FA",
53+
"name": "HUD Blue"
54+
},
55+
{
56+
"symbol": "*",
57+
"hex": "#CBD5E1",
58+
"name": "HUD Muted"
59+
},
60+
{
61+
"symbol": "+",
62+
"hex": "#38BDF8",
63+
"name": "Gravity Cyan"
64+
},
65+
{
66+
"symbol": "0",
67+
"hex": "#FB7185",
68+
"name": "Gravity Rose"
6069
}
61-
}
70+
]
6271
},
63-
"palette-browser": {
64-
"schema": "html-js-gaming.tool.palette-browser",
72+
"asset-manager-v2": {
73+
"$schema": "tools/schemas/tools/asset-manager-v2.schema.json",
74+
"schema": "html-js-gaming.asset-manager-v2",
6575
"version": 1,
66-
"name": "Palette Browser",
76+
"name": "Gravity Well Asset Manager V2 Registry",
6777
"source": "manifest",
68-
"palette": {
69-
"schema": "html-js-gaming.palette",
70-
"version": 1,
71-
"name": "Gravity Well Palette",
72-
"source": "manifest-and-runtime-color-scan",
73-
"swatches": [
74-
{
75-
"symbol": "0",
76-
"hex": "#1D4ED8",
77-
"name": "Color 1"
78-
},
79-
{
80-
"symbol": "1",
81-
"hex": "#1E293B",
82-
"name": "Color 2"
83-
},
84-
{
85-
"symbol": "2",
86-
"hex": "#081121",
87-
"name": "Color 3"
88-
},
89-
{
90-
"symbol": "3",
91-
"hex": "#244266",
92-
"name": "Color 4"
93-
},
94-
{
95-
"symbol": "4",
96-
"hex": "#F8FAFC",
97-
"name": "Color 5"
98-
},
99-
{
100-
"symbol": "5",
101-
"hex": "#FBBF24",
102-
"name": "Color 6"
103-
},
104-
{
105-
"symbol": "6",
106-
"hex": "#60A5FA",
107-
"name": "Color 7"
108-
},
109-
{
110-
"symbol": "7",
111-
"hex": "#CBD5E1",
112-
"name": "Color 8"
113-
},
114-
{
115-
"symbol": "8",
116-
"hex": "#38BDF8",
117-
"name": "Color 9"
118-
},
119-
{
120-
"symbol": "9",
121-
"hex": "#FB7185",
122-
"name": "Color 10"
123-
}
124-
]
78+
"assets": {
79+
"assets.image.preview.preview": {
80+
"path": "assets/images/preview.svg",
81+
"type": "image",
82+
"kind": "svg",
83+
"role": "preview",
84+
"source": "manifest"
85+
}
12586
}
12687
}
12788
}

0 commit comments

Comments
 (0)