|
| 1 | +# BUILD_PR_SAMPLES_INDEX_PERFORMANCE_AND_PERSONALIZATION |
| 2 | + |
| 3 | +## Objective |
| 4 | +Implement the final bundled samples wave by improving samples index responsiveness and adding lightweight favorites/pinning without changing canonical sample paths or sample runtime behavior. |
| 5 | + |
| 6 | +This BUILD covers: |
| 7 | +- index performance pass |
| 8 | +- favorites / pinning |
| 9 | + |
| 10 | +Canonical path contract remains: |
| 11 | +- `samples/phaseXX/XXYY/index.html` |
| 12 | + |
| 13 | +## PR Purpose |
| 14 | +One purpose only: |
| 15 | +- improve repeated-use samples index experience |
| 16 | + |
| 17 | +## In Scope |
| 18 | +- optimize the samples index so filtering, search, and rendering remain responsive as sample count grows |
| 19 | +- reduce unnecessary DOM work or repeated full rebuilds where a narrower update path is feasible |
| 20 | +- add lightweight favorites / pinning behavior for samples |
| 21 | +- keep personalization client-side only |
| 22 | +- preserve metadata-driven readable UI |
| 23 | +- preserve canonical sample paths |
| 24 | +- keep the implementation dependency-free |
| 25 | + |
| 26 | +## Out of Scope |
| 27 | +- no gameplay changes |
| 28 | +- no engine-core changes |
| 29 | +- no path normalization changes |
| 30 | +- no metadata schema redesign |
| 31 | +- no thumbnail/hover visual redesign |
| 32 | +- no navigation redesign beyond what is required for favorites interaction |
| 33 | +- no server-side persistence |
| 34 | +- no dependency installation |
| 35 | + |
| 36 | +## Required Behavior |
| 37 | +1. Filtering and search remain correct after performance changes. |
| 38 | +2. Index updates stay responsive under normal browse flows. |
| 39 | +3. Favorites / pins can be added and removed from the samples index. |
| 40 | +4. Favorites / pins persist locally for the same user on the same machine/browser. |
| 41 | +5. Favorites must not alter canonical paths or metadata identity. |
| 42 | +6. Representative Phase 13 samples including 1316–1318 must continue to load correctly. |
| 43 | + |
| 44 | +## Expected Targets |
| 45 | +Codex should keep reads narrow and stop if the actual required target list expands materially. |
| 46 | + |
| 47 | +Expected implementation targets: |
| 48 | +- `samples/index.html` |
| 49 | +- minimal JS/CSS directly supporting index rendering, filtering, and favorites behavior |
| 50 | +- minimal metadata-driven files directly needed for rendering or persistence keys |
| 51 | +- report files under `docs/` only for output packaging |
| 52 | + |
| 53 | +## Windows / Execution Constraints |
| 54 | +- target platform: Windows |
| 55 | +- prefer Node.js or vanilla JS where scripting support is needed |
| 56 | +- no `npm install` |
| 57 | +- no `node_modules` |
| 58 | +- no PowerShell path interpolation |
| 59 | +- ZIP output under `<project folder>/tmp/` is mandatory |
| 60 | + |
| 61 | +## Personalization Rules |
| 62 | +- use lightweight client-side persistence only, such as `localStorage` |
| 63 | +- keys must be scoped clearly to the samples feature |
| 64 | +- persistence must fail gracefully if unavailable |
| 65 | +- favorites must not block index rendering if persistence is unavailable |
| 66 | + |
| 67 | +## Validation Requirements |
| 68 | +Minimum required validation: |
| 69 | +- load `samples/index.html` |
| 70 | +- verify filter/search behavior still works correctly |
| 71 | +- verify the index remains responsive during repeated filter/search interactions |
| 72 | +- add one or more favorites / pins and verify they render correctly |
| 73 | +- reload the page and verify favorites / pins persist locally |
| 74 | +- remove a favorite / pin and verify removal persists |
| 75 | +- open representative sample links and verify Phase 13 samples 1316, 1317, 1318 still load |
| 76 | +- verify console stays clean for tested pages |
| 77 | + |
| 78 | +## Acceptance Criteria |
| 79 | +- index responsiveness improves or remains stable under the tested browse flows |
| 80 | +- favorites / pinning works and persists locally |
| 81 | +- no canonical path changes |
| 82 | +- no gameplay changes |
| 83 | +- no engine-core changes |
| 84 | +- changed-file count stays minimal |
| 85 | +- repo-structured delta ZIP is produced under `<project folder>/tmp/` |
| 86 | + |
| 87 | +## Fail Fast |
| 88 | +Stop and report if: |
| 89 | +- performance work would require a broad rendering architecture rewrite |
| 90 | +- favorites would require server-side storage |
| 91 | +- persistence behavior becomes coupled to unrelated systems |
| 92 | +- implementation expands beyond index responsiveness and lightweight personalization |
| 93 | +- the ZIP cannot be produced at the exact requested path |
0 commit comments