Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ability to pin prompts as reference above prompt field #6107

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

davidsuarezcdo
Copy link

@davidsuarezcdo davidsuarezcdo commented Oct 10, 2024

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for validating the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

  • This PR introduces a new feature that allows prompts to be "pinned" as a reference above the input field, rather than being directly inserted into the input. This improves user experience by allowing users to select a command prompt and view it as a hint/reference without modifying the input content directly. It also adds a Boolean field attached to manage this behavior in the prompts.

Added

  • Added a new attached property in the Prompt model to indicate whether a prompt should be pinned as a reference instead of inserted directly into the input field.
  • Updated the user interface to display pinned prompts above the input field with a dismiss button.
  • Added the ability to handle pinned prompts in the message submission process without altering the input content directly.
  • Created a new migration to add the attached column to the Prompt table in the database.

Changed

  • Updated the existing createNewPrompt and updatePromptByCommand methods to support the new attached parameter.
  • Modified the Chat.svelte and MessageInput.svelte components to manage and display pinned prompts.
  • Updated the prompt creation and editing forms to include a checkbox for selecting whether a prompt should be pinned as a reference.

Deprecated

Removed

Fixed

Security

Breaking Changes

  • No breaking changes: This PR introduces a new feature but does not affect existing functionality or backward compatibility.

Additional Information ⚠️

  • Work in Progress: This feature is still in progress, and I'm awaiting feedback from the community. I'm open to making any necessary changes based on the input received.
  • This PR is related to the ongoing discussion in Open WebUI Discussions #6029.
  • Feel free to provide feedback or suggestions

Screenshots or Videos

Screen.Recording.2024-10-10.at.17.07.55-1.mov

@tjbck tjbck marked this pull request as draft October 10, 2024 23:15
@davidsuarezcdo davidsuarezcdo changed the title feat: add prompt attached feature feat: add ability to pin prompts as reference above prompt field Oct 11, 2024
@davidsuarezcdo davidsuarezcdo changed the title feat: add ability to pin prompts as reference above prompt field feat: Add ability to pin prompts as reference above prompt field Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant