Message actions + citation Sources (#97, #98) #101

Merged
westfarn merged 3 commits from feature/message-actions-97-citations-98 into master 2026-08-04 03:32:18 -07:00
Owner

Summary

  • Closes #97 — message action row: copy (raw markdown + code-block copy), thumbs up/down with optimistic updates + down-reason popover, and export menu (PDF / DOCX / CSV / XLSX / TXT) for a single message plus conversation-level export in the chat toolbar.
  • Closes #98 — versioned WS citations frame parsing, Sources list under assistant bubbles, clickable [n] markers, and history hydrate from Prompt.citations.
  • Backend companion for ratings: chat_backend#67. Thumbs UI posts to prompt_feedback once that lands; votes rehydrate from conversation_details.feedback.
  • Export libs (pdfmake, docx, papaparse, xlsx) are dynamically imported so they stay out of the main path until used.

Test plan

  • Stream a grounded answer → Sources appear after stream; inline [n] highlights the matching source; reload keeps Sources.
  • Non-grounded turn → no Sources header.
  • Copy message + code block; confirm checkmark ~2s; failure path shows toast.
  • Thumbs up/down optimistic UI; clear by re-click; down opens reason popover without blocking the vote (needs chat_backend#67).
  • Export one message and whole conversation in all five formats; check searchable PDF text and DOCX structure.
  • Action row: hover reveal on desktop, always visible on last/touch; hidden while streaming.
  • npm test -- --testPathPattern='wsFrames|clipboard|exportChat|promptFeedback|ConversationDetailCard'
## Summary - Closes [#97](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/97) — message action row: copy (raw markdown + code-block copy), thumbs up/down with optimistic updates + down-reason popover, and export menu (PDF / DOCX / CSV / XLSX / TXT) for a single message plus conversation-level export in the chat toolbar. - Closes [#98](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/98) — versioned WS `citations` frame parsing, Sources list under assistant bubbles, clickable `[n]` markers, and history hydrate from `Prompt.citations`. - Backend companion for ratings: [chat_backend#67](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/67). Thumbs UI posts to `prompt_feedback` once that lands; votes rehydrate from `conversation_details.feedback`. - Export libs (`pdfmake`, `docx`, `papaparse`, `xlsx`) are dynamically imported so they stay out of the main path until used. ## Test plan - [ ] Stream a grounded answer → Sources appear after stream; inline `[n]` highlights the matching source; reload keeps Sources. - [ ] Non-grounded turn → no Sources header. - [ ] Copy message + code block; confirm checkmark ~2s; failure path shows toast. - [ ] Thumbs up/down optimistic UI; clear by re-click; down opens reason popover without blocking the vote (needs chat_backend#67). - [ ] Export one message and whole conversation in all five formats; check searchable PDF text and DOCX structure. - [ ] Action row: hover reveal on desktop, always visible on last/touch; hidden while streaming. - [ ] `npm test -- --testPathPattern='wsFrames|clipboard|exportChat|promptFeedback|ConversationDetailCard'`
westfarn added 1 commit 2026-08-03 12:25:29 -07:00
Add message actions and grounded citation Sources (#97, #98)
Unit Tests / test (pull_request) Failing after 4s
4a172fce56
Wire copy/thumbs/export on chat bubbles and render live + hydrated Sources from citations frames so users can rate, export, and inspect grounded answers.
westfarn added 1 commit 2026-08-03 12:26:21 -07:00
Merge origin/master into feature/message-actions-97-citations-98
Unit Tests / test (pull_request) Failing after 4s
6c1c52bca5
Resolve package-lock conflict after iOS App (#99) landed on master.
Author
Owner

Note on CI failure

Unit Tests failed at Install dependencies (npm ci), not at runtime against the backend.

Cause: merge of master into this branch dropped the top-level stylis peer lock entry required by stylis-plugin-rtlMissing: stylis@4.4.0 from lock file.

Fix pushed: restore node_modules/stylis@4.3.6 (peer) in package-lock.json.

Backend companion

chat_backend#67 implemented in chat_backend#70:

  • POST /api/prompt_feedback upsert {prompt_id, rating, reason?, comment?}
  • DELETE /api/prompt_feedback?prompt_id=
  • conversation_details nests caller feedback: {rating, reason, comment} (or null)

Matches this PR's promptFeedback.ts / MessageActions contract.

## Note on CI failure Unit Tests failed at **Install dependencies** (`npm ci`), not at runtime against the backend. Cause: merge of `master` into this branch dropped the top-level `stylis` peer lock entry required by `stylis-plugin-rtl` → `Missing: stylis@4.4.0 from lock file`. Fix pushed: restore `node_modules/stylis@4.3.6` (peer) in `package-lock.json`. ## Backend companion [chat_backend#67](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/67) implemented in [chat_backend#70](https://git.aimloperations.com/ai_ml_operations/chat_backend/pulls/70): - `POST /api/prompt_feedback` upsert `{prompt_id, rating, reason?, comment?}` - `DELETE /api/prompt_feedback?prompt_id=` - `conversation_details` nests caller `feedback: {rating, reason, comment}` (or null) Matches this PR's `promptFeedback.ts` / MessageActions contract.
westfarn added 1 commit 2026-08-04 03:15:58 -07:00
Restore missing stylis peer in package-lock after merge.
Unit Tests / test (pull_request) Successful in 11s
49397f33f3
npm ci failed on PR #101 because the lockfile dropped the top-level
stylis peer required by stylis-plugin-rtl during the master merge.
westfarn merged commit 3858b97104 into master 2026-08-04 03:32:18 -07:00
westfarn deleted branch feature/message-actions-97-citations-98 2026-08-04 03:32:18 -07:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/chat_web_app#101