[PR #8507] [MERGED] fix(chat): add a copy button to model reasoning (#8502) #8641

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

📋 Pull Request Information

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

Base: staging ← Head: fix/reasoning-copy-8502


📝 Commits (1)

  • 6d81391 fix(chat): add a copy button to model reasoning (#8502)

📊 Changes

4 files changed (+107 additions, -25 deletions)

View changed files

📝 e2e/core-flows.e2e.ts (+36 -3)
📝 packages/client/src/components/chat/ChatMessage.tsx (+41 -20)
📝 packages/client/src/components/chat/MessageThinkingModal.tsx (+27 -2)
📝 packages/client/src/localization/locales/en.json (+3 -0)

📄 Description

Linked issue

Closes #8502

Why this change

Users want to share what a thinking model reasoned. On phones, selecting the reasoning text by hand is unreliable (reported on Android/Brave over a Termux install). One tap should copy the full reasoning.

What changed

  • MessageThinkingModal.tsx (thoughts dialog, used by Conversation): a Copy model thoughts button above the reasoning.
  • ChatMessage.tsx (inline Roleplay thinking disclosure): the same button next to the expand toggle, as a sibling button (no nesting). It stays visible while collapsed. The toggle row grows to a 44 px tap target.
  • Both reuse copyToClipboard from lib/utils (it falls back to execCommand on plain HTTP). Success swaps the icon to a check for 1.5 s; failure shows an error toast.
  • The button is hidden when the reasoning summary is unavailable or empty.
  • en.json: chat.message.thoughts.copy, .copied, .copyFailed.
  • e2e/core-flows.e2e.ts: the existing reasoning tests copy and read back the clipboard (WebKit uses the clipboard stub pattern the file already has; Chromium grants clipboard permission), and the tab-order check includes the new button.

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

Agent runs (not a substitute for the boxes above): pnpm check exit 0; playwright test e2e/core-flows.e2e.ts --project=desktop-chromium on the three touched tests: 3 passed. Mobile projects not run.

Manual verification notes

  • Manually verify on a phone (390 px) in Conversation (thoughts dialog) and Roleplay (inline thinking) that the button is easy to tap and copies the full reasoning.
  • Manually verify copy over plain HTTP on a LAN address (non-secure context), including iOS Safari.
  • Manually verify the taller inline thinking header still looks right in light and dark mode.

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)

Three new UI strings in en.json; the UI language packs on docs-i18n fall back to English until translated.

UI evidence (if applicable)

Screenshots not captured yet.


🔄 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/8507 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `fix/reasoning-copy-8502` --- ### 📝 Commits (1) - [`6d81391`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6d81391309a377eb89f6ee849c3365a936d54280) fix(chat): add a copy button to model reasoning (#8502) ### 📊 Changes **4 files changed** (+107 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `e2e/core-flows.e2e.ts` (+36 -3) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+41 -20) 📝 `packages/client/src/components/chat/MessageThinkingModal.tsx` (+27 -2) 📝 `packages/client/src/localization/locales/en.json` (+3 -0) </details> ### 📄 Description ## Linked issue Closes #8502 ## Why this change Users want to share what a thinking model reasoned. On phones, selecting the reasoning text by hand is unreliable (reported on Android/Brave over a Termux install). One tap should copy the full reasoning. ## What changed - `MessageThinkingModal.tsx` (thoughts dialog, used by Conversation): a **Copy model thoughts** button above the reasoning. - `ChatMessage.tsx` (inline Roleplay thinking disclosure): the same button next to the expand toggle, as a sibling button (no nesting). It stays visible while collapsed. The toggle row grows to a 44 px tap target. - Both reuse `copyToClipboard` from `lib/utils` (it falls back to `execCommand` on plain HTTP). Success swaps the icon to a check for 1.5 s; failure shows an error toast. - The button is hidden when the reasoning summary is unavailable or empty. - `en.json`: `chat.message.thoughts.copy`, `.copied`, `.copyFailed`. - `e2e/core-flows.e2e.ts`: the existing reasoning tests copy and read back the clipboard (WebKit uses the clipboard stub pattern the file already has; Chromium grants clipboard permission), and the tab-order check includes the new button. ## 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` Agent runs (not a substitute for the boxes above): `pnpm check` exit 0; `playwright test e2e/core-flows.e2e.ts --project=desktop-chromium` on the three touched tests: 3 passed. Mobile projects not run. ### Manual verification notes - Manually verify on a phone (390 px) in Conversation (thoughts dialog) and Roleplay (inline thinking) that the button is easy to tap and copies the full reasoning. - Manually verify copy over plain HTTP on a LAN address (non-secure context), including iOS Safari. - Manually verify the taller inline thinking header still looks right in light and dark mode. ## 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) Three new UI strings in `en.json`; the UI language packs on `docs-i18n` fall back to English until translated. ## UI evidence (if applicable) Screenshots not captured yet. --- <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:11 +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#8641
No description provided.