|
| 1 | +# PR_26174_BRAVO_001-messages-table-structure |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +Converted Message Studio to the approved table-first Messages surface with server-owned persistence, inline row editing, and guarded message deletion. The visible table now uses Theme V2 table classes and exposes Message, Text, Tags, Emotion, Voice, Updated, and Actions columns. |
| 6 | + |
| 7 | +## Branch Validation |
| 8 | + |
| 9 | +| Check | Result | Notes | |
| 10 | +| --- | --- | --- | |
| 11 | +| Current branch is main | PASS | `git branch --show-current` returned `main`. | |
| 12 | + |
| 13 | +## Requirement Checklist |
| 14 | + |
| 15 | +| Requirement | Result | Notes | |
| 16 | +| --- | --- | --- | |
| 17 | +| Convert existing Messages tool/page to approved GFS table-first layout | PASS | `toolbox/messages/index.html` and `toolbox/messages/messages.js` now render the Messages table as the primary center surface. | |
| 18 | +| Columns: Message, Text, Tags, Emotion, Voice, Updated, Actions | PASS | Static table headers match the requested seven-column structure. | |
| 19 | +| Add Message button above/near table | PASS | Added a Theme V2 button in the table surface header. | |
| 20 | +| Row actions: Edit, Delete | PASS | Saved rows render Edit and Delete only. | |
| 21 | +| Edit mode actions: Save, Cancel | PASS | Inline editor rows render Save and Cancel only. | |
| 22 | +| Delete blocked/disabled when referenced | PASS | UI disables Delete when message parts reference the message; service delete path returns 409 for referenced rows. | |
| 23 | +| Use Theme V2 and existing reusable table patterns | PASS | Reused `surface-header`, `action-group`, `table-wrapper`, and `data-table`; no page-local CSS added. | |
| 24 | +| No inline styles, style blocks, inline handlers, or script blocks in HTML | PASS | Static PCRE check returned no matches for inline style/script/handler patterns. | |
| 25 | +| No browser-owned authoritative product data | PASS | Messages, emotions, and reference counts load through the Local API; no localStorage/product-data fallback added. | |
| 26 | +| No TTS implementation in this PR | PASS | Removed visible playback/TTS controls from Message Studio and did not add TTS behavior. Existing server TTS endpoints were not expanded. | |
| 27 | +| No Emotion Profiles or Voice Profiles tools yet | PASS | Emotion/Voice remain visible reference columns/placeholders only; no profile management UI added. | |
| 28 | +| Creator-safe empty/error states | PASS | Empty table and runtime failure messages avoid server diagnostics and stack details. | |
| 29 | +| Required repo-structured ZIP under tmp/ | PASS | Prepared for `tmp/PR_26174_BRAVO_001-messages-table-structure_delta.zip`. | |
| 30 | + |
| 31 | +## Validation Lane Report |
| 32 | + |
| 33 | +| Lane | Result | Command / Notes | |
| 34 | +| --- | --- | --- | |
| 35 | +| Branch check | PASS | `git branch --show-current` -> `main`. | |
| 36 | +| JS syntax | PASS | `node --check` on touched JS/MJS files. | |
| 37 | +| Messages service contract | PASS | Inline Node check verified create, unreferenced delete, and referenced delete guard using `createMessagesPostgresClientStub`. | |
| 38 | +| HTML restriction static check | PASS | `rg -n --pcre2 '<style|style=| on[a-z]+\s*=|<script(?![^>]*\bsrc=)' toolbox/messages/index.html` returned no matches. | |
| 39 | +| Diff whitespace | PASS | `git diff --check -- <touched files>` passed with line-ending warnings only. | |
| 40 | +| Dependency install for validation | PASS_WITH_NOTE | `npm ci` completed; npm reported one existing high-severity audit finding, not changed in this PR. | |
| 41 | +| Targeted Playwright Messages spec | BLOCKED | `npx playwright test tests/playwright/tools/MessagesTool.spec.mjs` could not launch because Chromium was missing. `npx playwright install chromium` timed out twice (about 184s and 364s). A temporary system-Chrome config using `C:\Program Files\Google\Chrome\Application\chrome.exe` also timed out after about 184s, so browser assertions did not complete. | |
| 42 | + |
| 43 | +## Manual Validation Notes |
| 44 | + |
| 45 | +- Static source inspection confirms the Messages table headers are Message, Text, Tags, Emotion, Voice, Updated, Actions. |
| 46 | +- Static source inspection confirms Add Message, Edit/Delete, Save/Cancel paths are present in the Messages controller. |
| 47 | +- Static source inspection confirms old visible TTS Profile, Play Message, Stop Playback, and TTS selector hooks are absent from `toolbox/messages/index.html` and `toolbox/messages/messages.js`. |
| 48 | +- Manual browser validation was not completed because the Playwright Chromium binary could not be installed and the fallback system-Chrome run timed out within the available command window. |
| 49 | +- Unrelated pre-existing `.gitignore` modification was left untouched and excluded from this PR delta. |
| 50 | + |
| 51 | +## Changed Files |
| 52 | + |
| 53 | +- `src/dev-runtime/messages/messages-postgres-service.mjs` |
| 54 | +- `tests/helpers/messagesPostgresClientStub.mjs` |
| 55 | +- `tests/playwright/tools/MessagesTool.spec.mjs` |
| 56 | +- `toolbox/messages/index.html` |
| 57 | +- `toolbox/messages/messages-api-client.js` |
| 58 | +- `toolbox/messages/messages.js` |
| 59 | +- `docs_build/dev/reports/codex_review.diff` |
| 60 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 61 | +- `docs_build/dev/reports/PR_26174_BRAVO_001-messages-table-structure.md` |
| 62 | + |
| 63 | +## ZIP |
| 64 | + |
| 65 | +- `tmp/PR_26174_BRAVO_001-messages-table-structure_delta.zip` |
0 commit comments