Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
503 changes: 503 additions & 0 deletions assets/toolbox/sprites/js/index.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# PR_26177_CHARLIE_018-sprites-testable-mvp-completion

Team: Charlie

Status: PASS

## Scope

Completed the Sprites MVP to a manually testable state without splitting additional PRs.

Implemented:
- Toolbox Sprites entry is active/clickable through the source-controlled registry.
- `/toolbox/sprites/index.html` loads a Theme V2 Sprites workspace.
- Removed placeholder-era visible wording including `Not implemented yet.`, `Setup`, `Plan sprite creation`, `future rebuild work`, and placeholder Workspace/Inspector/Output sections.
- Sprites uses Web UI -> API/service contract -> asset repository.
- Sprite list/create/edit/archive flows are API-backed through `/api/toolbox/sprites`.
- Guest save attempts redirect to `account/sign-in.html`.
- Preview/metadata surface shows product-safe metadata and explicit unavailable preview state.
- Palette/Colors remains reusable color SSoT; Sprites stores `paletteColorKey` only.
- Search/filter/status/category/tag controls are available.
- Reference protection disables destructive delete and shows explicit unavailable Object/World reference state.

## Changed Files

- `assets/toolbox/sprites/js/index.js`
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
- `src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js`
- `src/dev-runtime/server/local-api-router.mjs`
- `src/shared/toolbox/tool-metadata-inventory.js`
- `tests/dev-runtime/SpritesAssetRepository.test.mjs`
- `tests/playwright/tools/SpritesToolMvp.spec.mjs`
- `tests/playwright/tools/ToolboxRoutePages.spec.mjs`
- `toolbox/sprites/index.html`

## Validation

PASS `node ./scripts/run-node-test-files.mjs tests/dev-runtime/SpritesAssetRepository.test.mjs`

PASS `npx playwright test tests/playwright/tools/SpritesToolMvp.spec.mjs --workers=1 --reporter=list`

PASS `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --workers=1 --reporter=list`

PASS `git diff --check`

PASS static scan for inline style/script/event handler usage in Sprites HTML/JS.

PASS static scan for forbidden Sprites persistence patterns in Sprites HTML/JS.

## Notes

- No `start_of_day` files changed.
- No browser storage product-data SSoT introduced.
- No MEM DB, local-mem, fake-login, SQLite direction, or silent product-data fallback introduced.
- Sprites deliberately reuses the existing asset repository through a Sprites API alias rather than adding a parallel database architecture.
- Destructive delete remains disabled until Object/World reference contracts can verify real references.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Branch Validation

PR: PR_26177_CHARLIE_018-sprites-testable-mvp-completion

Status: PASS

## Branch Gate

- Current branch: `PR_26177_CHARLIE_018-sprites-testable-mvp-completion`
- Started after synced `main`: PASS
- Worktree before implementation: clean on new PR branch
- Remote upstream: not present until PR018 push

## Scope Gate

- No `start_of_day` files changed: PASS
- One PR purpose only: PASS
- No unrelated cleanup: PASS
- Runtime/API/UI changes limited to Sprites MVP testability and affected Toolbox metadata/tests: PASS
- No direct commits to `main`: PASS

## Changed-File Check

PASS: changed files are Sprites UI/API contract, affected Toolbox metadata/tests, required reports, and generated validation coverage reports.

## Final Branch State

- Branch tracks `origin/PR_26177_CHARLIE_018-sprites-testable-mvp-completion`.
- Branch is updated from synced `main` and remains the active PR018 branch for this validation refresh.
- Commit/push will be refreshed after report and ZIP regeneration.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Manual Validation Notes

PR: PR_26177_CHARLIE_018-sprites-testable-mvp-completion

Status: PASS

## Manual Test Steps

1. Start the local API/site server.
2. Open `/toolbox/index.html`.
3. Confirm the Sprites card is visible without enabling Planned tools.
4. Click Sprites and confirm navigation to `/toolbox/sprites/index.html`.
5. Confirm the Sprites table, summary cards, filters, preview, metadata, references, validation panels, and `Sprite Details` side panel render.
6. Click `Add Sprite`.
7. Enter `Hero Sprite`.
8. Select category `Character`.
9. Save and confirm a row appears with status `Ready`.
10. Click `Edit`, change the name to `Hero Sprite Revised`, choose category `Icon`, and save.
11. Search for `revised` and confirm only the matching sprite remains visible.
12. Filter category `Icon` and confirm the matching sprite remains visible.
13. Click `Archive` and confirm status changes to `Archived`.
14. Confirm the metadata panel shows key, file/source details, size/dimensions unavailable where appropriate, palette color key, updated by, and updated at.
15. Confirm the reference panel says destructive delete is disabled until Object/World reference contracts are available.
16. Sign out or set a guest session.
17. Open `/toolbox/sprites/index.html`, click `Add Sprite`, enter a name, and save.
18. Confirm the browser redirects to `/account/sign-in.html`.
19. Confirm Palette/Colors references are shown by key only and no Sprites-owned reusable color definitions are present.

## Manual Notes

- Preview is intentionally metadata-safe until storage/image byte preview integration is available.
- Palette/Colors empty state is explicit when no reusable color records are available.
- Destructive delete is intentionally unavailable; archive is the supported MVP lifecycle operation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Requirement Checklist

PR: PR_26177_CHARLIE_018-sprites-testable-mvp-completion

Status: PASS

- PASS Ensure `/toolbox/index.html` Sprites is active/clickable.
- PASS Ensure `/toolbox/sprites/index.html` loads.
- PASS `/toolbox/sprites/index.html` no longer shows `Not implemented yet.`, `Setup`, `Plan sprite creation`, `future rebuild work`, or placeholder Workspace/Inspector/Output sections.
- PASS Ensure Sprites tool has working table/list surface.
- PASS Ensure API-backed list/create/edit/archive works.
- PASS Ensure guest save redirects to `account/sign-in.html`.
- PASS Ensure preview/metadata surface works or shows explicit product-safe unavailable state.
- PASS Ensure Palette/Colors is the only source for reusable colors.
- PASS Ensure Sprites references Palette/Colors by key only.
- PASS Ensure Sprites does not own color definitions or page-local color arrays.
- PASS Ensure search/filter/tags/categories work where supported.
- PASS Ensure reference viewer/delete protection works or shows clear empty state.
- PASS Remove planned state where it blocks Sprites testing.
- PASS Keep Theme V2 compliance.
- PASS No inline CSS, inline JS, style blocks, script blocks, or inline event handlers in Sprites page.
- PASS Do not modify `start_of_day` folders.
- PASS No unrelated cleanup.
- PASS Do not introduce MEM DB, local-mem, fake-login, browser-owned product data, browser storage product-data SSoT, SQLite direction, or silent fallbacks.
- PASS Maintain Web UI -> API/service contract -> database/repository flow.
- PASS Browser does not generate authoritative database keys.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Validation Lane

PR: PR_26177_CHARLIE_018-sprites-testable-mvp-completion

Status: PASS

## Commands

```text
node ./scripts/run-node-test-files.mjs tests/dev-runtime/SpritesAssetRepository.test.mjs
PASS tests/dev-runtime/SpritesAssetRepository.test.mjs
1/1 targeted node test file(s) passed.
```

```text
npx playwright test tests/playwright/tools/SpritesToolMvp.spec.mjs --workers=1 --reporter=list
3 passed
```

```text
npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --workers=1 --reporter=list
11 passed
```

```text
git diff --check
PASS
```

## Static Checks

- PASS Sprites HTML/JS has no inline style/script/event handler matches.
- PASS Sprites HTML/JS has no browser storage product-data SSoT matches.
- PASS `toolbox/sprites/index.html` no longer contains the blocked placeholder wording.
- PASS No `start_of_day` changed files.
- NOTE Broad scan over all changed files finds pre-existing hex literals in `tests/playwright/tools/ToolboxRoutePages.spec.mjs`; Sprites implementation does not introduce reusable color definitions.
18 changes: 11 additions & 7 deletions docs_build/dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
docs_build/dev/ProjectInstructions/backlog/BACKLOG_MASTER.md
docs_build/dev/ProjectInstructions/team_assignments/team_ownership.md
docs_build/dev/reports/PR_26177_DELTA_001-hitboxes-team-ownership.md
docs_build/dev/reports/PR_26177_DELTA_001-hitboxes-team-ownership_branch-validation.md
docs_build/dev/reports/PR_26177_DELTA_001-hitboxes-team-ownership_validation-checklist.md
docs_build/dev/reports/codex_changed_files.txt
docs_build/dev/reports/codex_review.diff
# git status --short
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
M docs_build/dev/reports/playwright_v8_coverage_report.txt

# git ls-files --others --exclude-standard
(no output)

# git diff --stat
docs_build/dev/reports/coverage_changed_js_guardrail.txt | 8 ++------
docs_build/dev/reports/playwright_v8_coverage_report.txt | 16 +++-------------
2 files changed, 5 insertions(+), 19 deletions(-)
Loading
Loading