-
Notifications
You must be signed in to change notification settings - Fork 363
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
toolkit: add pinned chats #774
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
danylo-boiko
requested review from
tomtobac,
abimacarmes,
knajjars,
BeatrixCohere,
tianjing-li,
EugeneLightsOn,
malexw,
scottmx81 and
a team
as code owners
September 17, 2024 20:53
Thank you @danylo-boiko ! Will take a look this week |
@tianjing-li, how are things going with the code review? |
tianjing-li
approved these changes
Sep 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
AI Description
This PR introduces a new feature for pinning conversations, allowing users to mark important conversations for quick access. It adds a new column,
is_pinned
, to theconversations
table in the database, with a default value offalse
. The PR also includes the following changes:toggle_conversation_pin
, is added to theconversation.py
file. This function updates theis_pinned
field of a conversation by its ID.Conversation class in
conversation.pyis modified to include a new property,
is_pinned, which is a mapped column of type
Booleanwith a default value of
False`.get_conversations
function inconversation.py
is updated to include a new optional parameter,order_by
, which allows for ordering conversations by a specified field.list_conversations
function inconversation.py
is modified to include a new optional parameter,order_by
, for ordering conversations.update_conversation
function inconversation.py
is updated to include theis_pinned
field in the returned conversation data.toggle_conversation_pin
, is added to theconversation.py
file. This function updates theis_pinned
field of a conversation by its ID.ConversationFileAssociationFactory
class inconversation.py
is modified to include a new property,is_pinned
, with a default value ofFalse
.test_toggle_conversation_pin
, is added to thetest_conversation.py
file. This function tests thetoggle_conversation_pin
function by creating a conversation withis_pinned
set toFalse
, updating it toTrue
, and asserting that the conversation was updated correctly.Pin
, is added to theicons
folder in theassets
directory. This icon is used to represent the pinning feature in the user interface.index.ts
file in theicons
folder is updated to export thePin
icon.client.ts
file in thecohere-client
folder is modified to include a new function,toggleConversationPin
, which toggles the pin status of a conversation.schemas.gen.ts
file in thecohere-client
folder is updated to include a new type,ToggleConversationPinRequest
, which represents a request to toggle the pin status of a conversation.services.gen.ts
file in thecohere-client
folder is modified to include a new function,toggleConversationPinV1ConversationsConversationIdTogglePinPut
, which toggles the pin status of a conversation.types.gen.ts
file in thecohere-client
folder is updated to include a new type,ToggleConversationPinRequest
, which represents a request to toggle the pin status of a conversation.ConversationCard
component in theConversationListPanelGroup.tsx
file is modified to include a new property,isPinned
, which indicates whether the conversation is pinned.ConversationList
component in theConversationListPanelGroup.tsx
file is updated to use theorderBy
parameter when fetching conversations, ensuring that pinned conversations are displayed first.ConversationListPanelGroup
component in theConversationListPanelGroup.tsx
file is modified to include a new property,isPinned
, which indicates whether the conversation is pinned.Icon
component in theIcon.tsx
file is updated to include a new icon,Pin
, which is used to represent the pinning feature in the user interface.useConversations
hook in theuse-conversation.tsx
file is modified to include a new optional parameter,orderBy
, which allows for ordering conversations by theis_pinned
field.useToggleConversationPin
, is added to theuse-conversation.tsx
file. This hook is used to toggle the pin status of a conversation.