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: Implement Drag-and-Drop Reordering for Prompts, Refactor Prompt Cards, and Update Export Modal Messaging #815

Merged
merged 7 commits into from
Nov 5, 2024

Conversation

tahierhussain
Copy link
Contributor

@tahierhussain tahierhussain commented Oct 22, 2024

What

1. Added Drag-and-Drop Reordering for Prompts:

  • Implemented a new PromptsReorder component using react-dnd to enable drag-and-drop functionality for reordering prompts.

2. Refactored Prompt Cards:

  • Removed the existing drag-and-drop logic from the prompt cards list, delegating this functionality to the newly created PromptsReorder component.

3. Updated Export Modal Messaging:

  • Changed the export modal message from "Share with everyone" to "Share with everyone in current org" to provide more precise information to users.

Why

1. Enhanced User Experience:

  • Providing a dedicated drag-and-drop interface for reordering prompts makes the feature more intuitive and user-friendly.

2. Improved Code Maintainability:

  • By separating the drag-and-drop functionality into its own component, the prompt cards are simplified. Since the prompt card view is large and the drag-and-drop reordering was not user-friendly. Also, this makes the codebase cleaner and easier to maintain

3. Clarity in Export Functionality:

  • Updating the export modal message eliminates ambiguity, ensuring users understand that sharing is limited to their current organization, thereby preventing potential misunderstandings.

How

1. Implementing PromptsReorder Component:

  • Utilized the react-dnd library to create the PromptsReorder component, which manages the drag-and-drop reordering of prompts.

2. Refactoring Prompt Cards:

  • Removed the drag-and-drop handlers and related logic from the prompt cards.

3. Updating Export Modal Message:

  • Modified the text within the export modal to "Share with everyone in current org".

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

Yes. This PR includes the creation of new components along with substantial changes to existing ones. So, there is a possibility that it may break existing features.

Database Migrations

NA

Env Config

NA

Relevant Docs

NA

Related Issues or PRs

NA

Dependencies Versions

NA

Notes on Testing

NA

Screenshots

Prompt Cards Before Reordering:

Screenshot from 2024-10-22 23-11-30

Prompts Reorder Modal (drag-and-drop cards to reorder):

Screenshot from 2024-10-22 23-12-08

Prompt Card After Reordering:

Screenshot from 2024-10-22 23-21-12

Checklist

I have read and understood the Contribution Guidelines.

Copy link
Contributor

@vishnuszipstack vishnuszipstack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

sonarcloud bot commented Nov 4, 2024

Copy link
Contributor

github-actions bot commented Nov 4, 2024

filepath function $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_logs}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{worker/src/unstract/worker/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{9}}$$ $$\textcolor{#23d18b}{\tt{9}}$$

@jaseemjaskp jaseemjaskp merged commit e4811a4 into main Nov 5, 2024
5 checks passed
@jaseemjaskp jaseemjaskp deleted the feat/implement-prompts-reorder-modal branch November 5, 2024 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants