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

refactor: migrate chat lock state to useFlowStore #6166

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Cristhianzl
Copy link
Member

This pull request focuses on refactoring the chat locking mechanism in the IOModal component and its related subcomponents. The changes primarily involve removing the lockChat and setLockChat props and replacing them with state management using the useFlowStore hook.

Refactoring of chat locking mechanism:

  • Removed lockChat and setLockChat props from ChatViewWrapper and ChatView components and their respective type definitions. [1] [2] [3] [4] [5] [6] [7]
  • Added lockChat and setLockChat state management using useFlowStore in ChatView and ChatMessage components. [1] [2]
  • Updated ChatMessage component to use the new state management for lockChat and setLockChat, and adjusted the conditional rendering logic based on the new state. [1] [2]
  • Removed lockChat and setLockChat from the IOModal component and its related logic. [1] [2] [3] [4]

…iewWrapper and ChatView components

♻️ (frontend): refactor ChatMessage component to use useFlowStore for lockChat state management instead of passing it as a prop
@Cristhianzl Cristhianzl requested a review from anovazzi1 February 6, 2025 17:44
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. javascript Pull requests that update Javascript code labels Feb 6, 2025
@github-actions github-actions bot added the refactor Maintenance tasks and housekeeping label Feb 6, 2025
Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

if we are going to do this change i suggest we use only isBuilding variable and remve lock chat from it to decrease complexity

@Cristhianzl
Copy link
Member Author

if we are going to do this change i suggest we use only isBuilding variable and remve lock chat from it to decrease complexity

sounds good

♻️ (chat-message.tsx): Refactor code to use isBuilding state instead of setLockChat and lockChat variables
♻️ (new-modal.tsx): Refactor code to remove setLockChat function and references
♻️ (flowStore.ts): Refactor code to remove setLockChat function and lockChat variable
♻️ (components/index.ts): Refactor code to remove setLockChat function and lockChat variable
♻️ (flow/index.ts): Refactor code to remove setLockChat function and lockChat variable
♻️ (buildUtils.ts): Refactor code to remove setLockChat function and references
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 7, 2025
… for better clarity and semantics in the code.
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 7, 2025
…wrapper.tsx, upload-file-button.tsx, use-focus-unlock.ts, use-upload.ts, chat-message.tsx, index.ts): Remove lockChat variable and replace it with isBuilding variable to improve code readability and consistency.
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 7, 2025
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 7, 2025
…utton component to improve code readability and maintainability
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code refactor Maintenance tasks and housekeeping size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants