[PR #14210] [MERGED] refac: improve prompt formatting for selected text in FloatingButtons #39040

Closed
opened 2026-04-25 11:46:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/14210
Author: @ShrootBuck
Created: 5/23/2025
Status: Merged
Merged: 5/23/2025
Merged by: @tjbck

Base: devHead: main


📝 Commits (1)

  • 1d382b8 refac: improve prompt formatting for selected text in FloatingButtons

📊 Changes

1 file changed (+12 additions, -3 deletions)

View changed files

📝 src/lib/components/chat/ContentRenderer/FloatingButtons.svelte (+12 -3)

📄 Description

Description

  • Refactored prompt construction to improve readability and formatting for selected text. Replaced template literals with blockquote-style formatting (>) for better LLM input parsing. No functional logic changes - purely a formatting improvement. However, I've experienced quite a few cases now where the (old) logic actually confuses the LLM by having the quote after the Explain/Ask request.

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.

Changelog Entry

Changed

  • Refactored prompt generation in FloatingButtons to use blockquote-style (>) formatting per line of selected text.
  • Moved selected text before the discussion prompt to improve clarity and reduce confusion for LLMs.
  • Removed inline template literal usage in favor of .join('\n') based construction for better readability and maintainability.

🔄 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/open-webui/open-webui/pull/14210 **Author:** [@ShrootBuck](https://github.com/ShrootBuck) **Created:** 5/23/2025 **Status:** ✅ Merged **Merged:** 5/23/2025 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `main` --- ### 📝 Commits (1) - [`1d382b8`](https://github.com/open-webui/open-webui/commit/1d382b83c82362c99b279392420c4f1d0d50dfe1) refac: improve prompt formatting for selected text in FloatingButtons ### 📊 Changes **1 file changed** (+12 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/ContentRenderer/FloatingButtons.svelte` (+12 -3) </details> ### 📄 Description ### Description - Refactored prompt construction to improve readability and formatting for selected text. Replaced template literals with blockquote-style formatting (`>`) for better LLM input parsing. No functional logic changes - purely a formatting improvement. However, I've experienced quite a few cases now where the (old) logic actually confuses the LLM by having the quote after the Explain/Ask request. ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. ### Changelog Entry #### Changed - Refactored prompt generation in `FloatingButtons` to use blockquote-style (`>`) formatting per line of selected text. - Moved selected text *before* the discussion prompt to improve clarity and reduce confusion for LLMs. - Removed inline template literal usage in favor of `.join('\n')` based construction for better readability and maintainability. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 11:46:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#39040