[PR #1772] [MERGED] Type conversation attachment rendering #5274

Closed
opened 2026-10-22 04:14:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1772
Author: @Xelvanis
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @Xelvanis

Base: refactor ← Head: chore/conversation-attachment-types


📝 Commits (2)

  • bbec672 Type conversation attachment rendering
  • d1f1ddf Tighten message attachment validation

📊 Changes

6 files changed (+196 additions, -65 deletions)

View changed files

📝 src/engine/contracts/types/chat.ts (+21 -0)
📝 src/features/modes/conversation/components/ConversationMessage.tsx (+30 -38)
📝 src/features/modes/shared/chat-ui/components/ChatMessage.tsx (+39 -27)
📝 src/features/modes/shared/chat-ui/index.ts (+1 -0)
➕ src/features/modes/shared/chat-ui/lib/message-attachments.test.ts (+39 -0)
➕ src/features/modes/shared/chat-ui/lib/message-attachments.ts (+66 -0)

📄 Description

Linked issue

N/A - local chore from the explicit-any cleanup queue.

Why this change

  • Remove attachment-related explicit any usage from conversation and shared chat message rendering.
  • Make persisted message attachment data visible in the chat message contract.

What changed

  • Added a MessageAttachment contract and typed MessageExtra.attachments.
  • Added shared chat-ui attachment helpers for reading image sources and alt text.
  • Updated conversation and shared chat message renderers to use typed attachment arrays for rendering, lightbox open, and removal.

Refactor impact

Primary owner:

  • Shared chat UI and conversation message UI.

Impact areas reviewed:

  • Conversation message rendering.
  • Shared chat message rendering.
  • Message extra contract shape.
  • Shared chat-ui public exports.

Boundary notes:

  • Engine contract now names the persisted attachment shape.
  • Feature UI continues to use storageApi.patchChatMessageExtra for attachment removal.
  • No Tauri, Rust storage implementation, remote runtime, or generation behavior changes.

Pressure points touched:

  • Shared mode UI.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Manual verification notes

  • pnpm check passed locally. This includes line endings, architecture, frontend typecheck, Rust check, docs, discovery metadata, and unused-code checks.
  • Target explicit-any grep for ConversationMessage.tsx and ChatMessage.tsx returned no hits.
  • No browser or Tauri manual QA was run; this is type cleanup around existing attachment rendering.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • N/A; this is internal type cleanup for existing message attachment rendering.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • Not added; no visual behavior change claimed.

Summary by CodeRabbit

Release Notes

  • New Features
    • Enhanced message attachments with metadata support
    • Expanded persona context capture including personality, backstory, appearance, and scenario details
    • Improved attachment handling and display across chat modes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1772 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `chore/conversation-attachment-types` --- ### 📝 Commits (2) - [`bbec672`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bbec6728885dc85677190b9409152f4af4b72de6) Type conversation attachment rendering - [`d1f1ddf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d1f1ddfe2f1926f01eda6996cc803e09d635ec3d) Tighten message attachment validation ### 📊 Changes **6 files changed** (+196 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/contracts/types/chat.ts` (+21 -0) 📝 `src/features/modes/conversation/components/ConversationMessage.tsx` (+30 -38) 📝 `src/features/modes/shared/chat-ui/components/ChatMessage.tsx` (+39 -27) 📝 `src/features/modes/shared/chat-ui/index.ts` (+1 -0) ➕ `src/features/modes/shared/chat-ui/lib/message-attachments.test.ts` (+39 -0) ➕ `src/features/modes/shared/chat-ui/lib/message-attachments.ts` (+66 -0) </details> ### 📄 Description ## Linked issue N/A - local chore from the explicit-any cleanup queue. ## Why this change - Remove attachment-related explicit `any` usage from conversation and shared chat message rendering. - Make persisted message attachment data visible in the chat message contract. ## What changed - Added a `MessageAttachment` contract and typed `MessageExtra.attachments`. - Added shared chat-ui attachment helpers for reading image sources and alt text. - Updated conversation and shared chat message renderers to use typed attachment arrays for rendering, lightbox open, and removal. ## Refactor impact Primary owner: - Shared chat UI and conversation message UI. Impact areas reviewed: - Conversation message rendering. - Shared chat message rendering. - Message extra contract shape. - Shared chat-ui public exports. Boundary notes: - Engine contract now names the persisted attachment shape. - Feature UI continues to use `storageApi.patchChatMessageExtra` for attachment removal. - No Tauri, Rust storage implementation, remote runtime, or generation behavior changes. Pressure points touched: - Shared mode UI. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [x] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - `pnpm check` passed locally. This includes line endings, architecture, frontend typecheck, Rust check, docs, discovery metadata, and unused-code checks. - Target explicit-any grep for `ConversationMessage.tsx` and `ChatMessage.tsx` returned no hits. - No browser or Tauri manual QA was run; this is type cleanup around existing attachment rendering. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - N/A; this is internal type cleanup for existing message attachment rendering. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - Not added; no visual behavior change claimed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Enhanced message attachments with metadata support * Expanded persona context capture including personality, backstory, appearance, and scenario details * Improved attachment handling and display across chat modes <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:49 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5274
No description provided.