|
| 1 | +# PR 11.72 - Workspace Manager Tool Tile JSON Counts |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Fix Workspace Manager tool tile `Samples (##)` counts so each tool tile reports the real number of matching sample JSON files. |
| 5 | + |
| 6 | +Known example: |
| 7 | +- Palette Browser / Manager currently shows `Samples (12)`. |
| 8 | +- Repo contains 20 palette JSON files. |
| 9 | +- Tile should show `Samples (20)` when 20 palette JSON files match that tool. |
| 10 | + |
| 11 | +## Scope |
| 12 | +- Workspace Manager/tool tile count logic only. |
| 13 | +- Count sample JSON files under `samples/**` that match each tool. |
| 14 | +- Include palette JSON files in the palette tool count. |
| 15 | +- Do not change sample data files unless a count source file requires explicit mapping metadata. |
| 16 | +- Do not modify roadmap text except status marker only if execution-backed. |
| 17 | + |
| 18 | +## Required Implementation |
| 19 | +Codex must inspect the current Workspace Manager tile-count source and replace any stale/static/partial count source with a derived count based on sample JSON matching. |
| 20 | + |
| 21 | +### Count Rule |
| 22 | +For each Workspace Manager tool tile: |
| 23 | +1. Determine that tool's JSON match pattern(s). |
| 24 | +2. Recursively scan `samples/**` for matching `*.json` files. |
| 25 | +3. Set the tile label/count to the matching count. |
| 26 | +4. Palette Browser / Manager must count all palette JSON files, including: |
| 27 | + - `*.palette.json` |
| 28 | + - any existing palette JSON naming convention already used by the repo, if present. |
| 29 | + |
| 30 | +### Expected Palette Result |
| 31 | +If the repo currently has 20 palette JSON files, the Palette Browser / Manager tile must display: |
| 32 | + |
| 33 | +```text |
| 34 | +Samples (20) |
| 35 | +``` |
| 36 | + |
| 37 | +## Guardrails |
| 38 | +- Do not hardcode the number 20. |
| 39 | +- Do not hardcode one-off counts for a specific tile. |
| 40 | +- Do not create fallback sample data. |
| 41 | +- Do not auto-load hidden/default assets. |
| 42 | +- Do not broaden into tool registry refactors. |
| 43 | +- Do not modify unrelated tools. |
| 44 | +- Preserve current tile layout and names. |
| 45 | + |
| 46 | +## Suggested Search Targets |
| 47 | +Look for existing count logic in files related to: |
| 48 | +- Workspace Manager |
| 49 | +- tool tiles |
| 50 | +- sample registry/index metadata |
| 51 | +- `Samples (` label text |
| 52 | +- palette browser / manager tile config |
| 53 | + |
| 54 | +Suggested repo searches: |
| 55 | + |
| 56 | +```powershell |
| 57 | +Select-String -Path .\**\*.js,.\**\*.html,.\**\*.json -Pattern "Samples \(" -ErrorAction SilentlyContinue |
| 58 | +Select-String -Path .\**\*.js -Pattern "palette" -ErrorAction SilentlyContinue |
| 59 | +Select-String -Path .\**\*.js -Pattern "workspace" -ErrorAction SilentlyContinue |
| 60 | +``` |
| 61 | + |
| 62 | +## Validation |
| 63 | +Run targeted validation only. |
| 64 | + |
| 65 | +Required checks: |
| 66 | +1. Count palette JSON files: |
| 67 | + |
| 68 | +```powershell |
| 69 | +(Get-ChildItem .\samples -Recurse -File -Filter *.json | Where-Object { $_.Name -match 'palette' }).Count |
| 70 | +``` |
| 71 | + |
| 72 | +2. Open Workspace Manager. |
| 73 | +3. Confirm Palette Browser / Manager tile count equals the palette JSON count. |
| 74 | +4. Confirm other tool tile counts still render. |
| 75 | +5. Run syntax checks only for changed JS files. |
| 76 | +6. Do not run full sample smoke test. |
| 77 | + |
| 78 | +## Evidence Report |
| 79 | +Create: |
| 80 | + |
| 81 | +```text |
| 82 | +docs/dev/reports/pr_11_72_workspace_manager_tile_json_counts.md |
| 83 | +``` |
| 84 | + |
| 85 | +Include: |
| 86 | +- files changed |
| 87 | +- count source before |
| 88 | +- count source after |
| 89 | +- palette JSON count from filesystem |
| 90 | +- observed Palette Browser / Manager tile count |
| 91 | +- targeted tests run |
| 92 | +- full suite skipped reason |
| 93 | + |
| 94 | +## Acceptance |
| 95 | +- Palette tile count is derived from actual matching palette JSON files. |
| 96 | +- Palette Browser / Manager shows `Samples (20)` if 20 palette JSON files exist. |
| 97 | +- No hardcoded count constants. |
| 98 | +- No hidden/default fallback data introduced. |
| 99 | +- Targeted validation documented. |
0 commit comments