[PR #8528] [MERGED] fix(mari): attach images pasted into the message box #8655

Closed
opened 2026-11-07 16:46:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8528
Author: @ylli-selmani
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ylli-selmani

Base: staging ← Head: fix/mari-paste-images


📝 Commits (3)

  • f696c23 fix(mari): attach images pasted into the message box
  • 380c268 fix(mari): keep Send off until every pasted file is read
  • 24ac807 fix(mari): attach a copied file when its name comes along as text

📊 Changes

5 files changed (+50 additions, -4 deletions)

View changed files

📝 docs/home/professor-mari.md (+1 -1)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+6 -2)
📝 packages/client/src/components/chat/mari/MariComposer.tsx (+8 -1)
📝 packages/client/src/lib/composer-triggers.ts (+18 -0)
📝 scripts/regressions/composer-triggers.regression.ts (+17 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8527

Why this change

  • A screenshot on the clipboard could not be pasted into Professor Mari's message box. It had to be saved and attached as a file. The chat and conversation inputs already handle this.

What changed

  • Paste: the composer's textarea now has an onPaste. Files on the clipboard go through handleAttachmentUpload, the paperclip's path, so size and type checks and image resizing apply.
  • Text wins: the new pastedFiles returns nothing when the clipboard also has text. Word and Excel copies carry their text plus a picture of it, and those should paste as text. This is a small difference from ChatInput, which attaches any file.
  • Overlapping reads: paste isn't disabled during a read like the paperclip is, so isReadingAttachments now clears only when the last read in progress finishes. Send stays off until then.
  • Docs: one sentence in docs/home/professor-mari.md.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Commands run by the agent: client eslint, prettier --check, client tsc --noEmit, tsc -p scripts/regressions/tsconfig.client-lanes.json, and node ./scripts/run-regressions.mjs --filter composer-triggers with new pastedFiles cases. A local CodeRabbit round raised the overlapping reads; it is fixed in the second commit.

Manual verification notes

  • To do: on a PC, snip a screenshot and press Ctrl+V in Mari's box. The image chip should appear.
  • To do: copy cells from Excel and paste. It should stay text.
  • To do: paste on a phone. This depends on the keyboard, and some keyboards insert images in other ways.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

docs/home/professor-mari.md gains one sentence; no [docs-i18n] issue is open for it yet.

UI evidence (if applicable)

🤖 Generated with Claude Code


🔄 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/8528 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `fix/mari-paste-images` --- ### 📝 Commits (3) - [`f696c23`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f696c2302377438d3a4a9c18b5324997baba2376) fix(mari): attach images pasted into the message box - [`380c268`](https://github.com/Pasta-Devs/Marinara-Engine/commit/380c2684980ace1a51b9913fa4b0777c12e0412c) fix(mari): keep Send off until every pasted file is read - [`24ac807`](https://github.com/Pasta-Devs/Marinara-Engine/commit/24ac807e49a1bbe9f12041b4cf6bb6d200810809) fix(mari): attach a copied file when its name comes along as text ### 📊 Changes **5 files changed** (+50 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/home/professor-mari.md` (+1 -1) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+6 -2) 📝 `packages/client/src/components/chat/mari/MariComposer.tsx` (+8 -1) 📝 `packages/client/src/lib/composer-triggers.ts` (+18 -0) 📝 `scripts/regressions/composer-triggers.regression.ts` (+17 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #8527 ## Why this change - A screenshot on the clipboard could not be pasted into Professor Mari's message box. It had to be saved and attached as a file. The chat and conversation inputs already handle this. ## What changed - **Paste:** the composer's textarea now has an `onPaste`. Files on the clipboard go through `handleAttachmentUpload`, the paperclip's path, so size and type checks and image resizing apply. - **Text wins:** the new `pastedFiles` returns nothing when the clipboard also has text. Word and Excel copies carry their text plus a picture of it, and those should paste as text. This is a small difference from `ChatInput`, which attaches any file. - **Overlapping reads:** paste isn't disabled during a read like the paperclip is, so `isReadingAttachments` now clears only when the last read in progress finishes. Send stays off until then. - **Docs:** one sentence in `docs/home/professor-mari.md`. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Commands run by the agent: client `eslint`, `prettier --check`, client `tsc --noEmit`, `tsc -p scripts/regressions/tsconfig.client-lanes.json`, and `node ./scripts/run-regressions.mjs --filter composer-triggers` with new `pastedFiles` cases. A local CodeRabbit round raised the overlapping reads; it is fixed in the second commit. ### Manual verification notes - To do: on a PC, snip a screenshot and press Ctrl+V in Mari's box. The image chip should appear. - To do: copy cells from Excel and paste. It should stay text. - To do: paste on a phone. This depends on the keyboard, and some keyboards insert images in other ways. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `docs/home/professor-mari.md` gains one sentence; no `[docs-i18n]` issue is open for it yet. ## UI evidence (if applicable) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:46:15 +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#8655
No description provided.