Skip to content

📌 feat: Add Conversation Pin Feature with Drag & Drop Ordering (#2610) - #7550

Closed
henricook wants to merge 1 commit into
LibreChat-AI:devfrom
henricook:pinned-chats
Closed

henricook wants to merge 1 commit into
LibreChat-AI:devfrom
henricook:pinned-chats

Conversation

@henricook

@henricook henricook commented May 25, 2025 •

Copy link
Copy Markdown

Pin Conversations

Docs update: LibreChat-AI/docs#310

Summary

This feature was requested and was also something I'd personally really like. I'm sorry it's not on the roadmap but I took Danny's comment on the Issue as blessing enough and went ahead and did it.

Please do let me know if I've done anything egregious and/or you'd like any changes!

Change Type

Please delete any irrelevant options.

  • [ X ] New feature (non-breaking change which adds functionality)
  • [ X ] This change requires a documentation update
  • [ X ] Translation update

Testing

I've added unit tests and done a click test, here's a video of the original work:

Screencast.From.2025-05-25.11-06-19.mp4

After a helpful suggestion in comments by @rubentalstra I went back and added drag and drop reordering to pinned items too, here's a vid of that, there's a refresh in the middle to double-check persistence is fine (that's why the screen goes blank):

Screencast.From.2025-05-26.11-36-55.mp4

Test Configuration:

N/A

Checklist

Please delete any irrelevant options.

  • [ X ] My code adheres to this project's style guidelines
  • [ X ] I have performed a self-review of my own code
  • [ X ] I have commented in any complex areas of my code
  • [ X ] I have made pertinent documentation changes
  • [ X ] My changes do not introduce new warnings
  • [ X ] I have written tests demonstrating that my changes are effective or that my feature works
  • [ X ] Local unit tests pass with my changes
  • [ X ] Any changes dependent on mine have been merged and published in downstream modules.
  • [ X ] A pull request for updating the documentation has been submitted.

@henricook henricook changed the title WIP: 📌 feat: Add Conversation Pin Feature with Custom Ordering 📌 feat: Add Conversation Pin Feature with Custom Ordering May 25, 2025
@henricook henricook changed the title 📌 feat: Add Conversation Pin Feature with Custom Ordering feat: Add Conversation Pin Feature with Custom Ordering May 25, 2025
@henricook henricook changed the title feat: Add Conversation Pin Feature with Custom Ordering 📌 feat: Add Conversation Pin Feature with Custom Ordering May 25, 2025
@henricook henricook changed the title 📌 feat: Add Conversation Pin Feature with Custom Ordering 📌 feat: Add Conversation Pin Feature with Custom Ordering (#2610) May 25, 2025
Comment thread client/src/utils/convos.spec.ts Fixed
Comment thread client/src/utils/convos.spec.ts Fixed
Comment thread client/src/utils/convos.spec.ts Fixed
Comment thread client/src/utils/convos.spec.ts Fixed
Comment thread client/src/utils/convos.spec.ts Fixed
Comment thread client/src/utils/convos.spec.ts Fixed
Comment thread client/src/utils/convos.spec.ts Fixed
@danny-avila
danny-avila marked this pull request as draft May 26, 2025 05:46
@henricook
henricook marked this pull request as ready for review May 26, 2025 08:04
@henricook
henricook marked this pull request as draft May 26, 2025 08:04
@henricook

henricook commented May 26, 2025 •

Copy link
Copy Markdown
Author

Sorry I had some trouble reproducing the eslint failures locally, pushed now @danny-avila

@rubentalstra rubentalstra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please have a look at the translation files. please only keep the en language keys.

Comment thread client/src/locales/de/translation.json
Comment thread client/src/locales/es/translation.json
Comment thread client/src/locales/fr/translation.json
Comment thread client/src/locales/it/translation.json
Comment thread client/src/locales/ja/translation.json
Comment thread client/src/locales/ko/translation.json
Comment thread client/src/locales/pt-BR/translation.json
Comment thread client/src/locales/ru/translation.json
Comment thread client/src/locales/zh-Hans/translation.json
Comment thread client/src/locales/zh-Hant/translation.json
@rubentalstra rubentalstra added the ✨ enhancement New feature or request label May 26, 2025
@henricook
henricook marked this pull request as ready for review May 26, 2025 08:55
@henricook
henricook requested a review from rubentalstra May 26, 2025 08:57

@rubentalstra rubentalstra left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please have a look.

to make the code maybe less dependant on DateTime filtering. maybe using an int for PinnedOrder so it would be possible later maybe to re-order them if needed?

Comment thread packages/data-schemas/src/schema/convo.ts Outdated
@henricook
henricook marked this pull request as draft May 26, 2025 09:18
@henricook henricook changed the title 📌 feat: Add Conversation Pin Feature with Custom Ordering (#2610) 📌 feat: Add Conversation Pin Feature with Drag & Drop Ordering (#2610) May 26, 2025
@henricook
henricook marked this pull request as ready for review May 26, 2025 19:49
@rubentalstra

Copy link
Copy Markdown
Contributor

@danny-avila or @berry-13 do we already use a different package for drag?

@danny-avila

Copy link
Copy Markdown
Collaborator

@rubentalstra yes we use react-dnd, it would be best to rely on this first rather than introduce another library

@henricook

Copy link
Copy Markdown
Author

Apologies, i'd missed that, will draft and refactor!

@henricook
henricook marked this pull request as draft May 29, 2025 12:33
@henricook
henricook force-pushed the pinned-chats branch 4 times, most recently from e0d35cb to 741b95c Compare June 2, 2025 07:00
@henricook
henricook marked this pull request as ready for review June 2, 2025 07:11
@rubentalstra rubentalstra removed their assignment Jun 12, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds a conversation‐pin feature with drag & drop reordering support. Key changes include updates to the data schemas and API endpoints for pinning conversations, modifications to the client-side conversation grouping to separate pinned items, and the introduction of new mutations and components to handle pin toggling and reordering.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/data-schemas/src/types/convo.ts Added optional fields isPinned and pinnedOrder to the conversation type.
packages/data-schemas/src/schema/convo.ts Updated the schema to include isPinned and pinnedOrder with appropriate defaults and indexes.
packages/data-provider/src/* Extended types, API endpoints, and data service functions to support pin and reorder mutations.
client/src/utils/convos.ts Modified conversation grouping to separate and sort pinned conversations.
client/src/components/Conversations/* Introduced new components and mutations to support pin toggling and drag & drop reordering.
api/server/routes/convos.js and api/models/Conversation.js Added routes and auto-assignment logic for pinnedOrder during pin/unpin operations.
Comments suppressed due to low confidence (2)

client/src/components/Conversations/PinnedConversations.tsx:108

  • [nitpick] Consider renaming 'localPinnedOrder' to 'pinnedConversationsState' to more clearly indicate that it holds the local state for the order of pinned conversations.
const [localPinnedOrder, setLocalPinnedOrder] = useState<TConversation[]>([]);

api/models/Conversation.js:102

  • Add a clarifying comment regarding the initialization logic for 'pinnedOrder', explaining that it assigns (maxOrder?.pinnedOrder ?? -1) + 1 to ensure new pins are ordered correctly even when no previous pinned conversations exist.
if (update.isPinned === true && update.pinnedOrder === undefined) {

@rubentalstra
rubentalstra changed the base branch from main to dev June 12, 2025 15:05
@rubentalstra rubentalstra modified the milestone: v0.7.9 Jun 18, 2025
@danny-avila danny-avila removed this from the v0.7.9 milestone Jul 21, 2025
@danny-avila
danny-avila marked this pull request as draft July 21, 2025 13:49
@henricook
henricook force-pushed the pinned-chats branch 2 times, most recently from 82f9650 to a54bbe2 Compare August 5, 2025 09:08
@henricook

Copy link
Copy Markdown
Author

@rubentalstra I've rebased and just assumed that this issue we noted is resolved, if you're able to trigger another build?

Note: This won't build on latest main due to the rollup build issue introduced in deb8a00e27251875d466c5a92b5d343b197fe0f5. I guess this'll get fixed upstream or by someone else, and then this PR can be rebased.

@henricook
henricook marked this pull request as ready for review August 5, 2025 09:10
@henricook

Copy link
Copy Markdown
Author

@danny-avila The only urgency I can assign to this is my excitement to use the feature myself in my production Librechat! Would you mind triggering the build please? 🤞🏻

@marwanasker

Copy link
Copy Markdown

Im someone looking into getting this merged?

@henricook

henricook commented Nov 12, 2025 •

Copy link
Copy Markdown
Author

I didn't want to keep @ing people to be honest, it was feeling like I was harassing. I'm not sure how to proceed. I'll take a look at the conflicts again by Friday night and push it in the hope someone gets the time.

Danny's probably busy being inducted at Clickhouse this week? :-D

@henricook

Copy link
Copy Markdown
Author

Now rebased and ready for merge again

@henricook

Copy link
Copy Markdown
Author

Thanks for triggering the rerun @rubentalstra - hopefully Clickhouse sponsorship leads to normal automatic pipelines, I feel bad putting you out asking you to run pipelines all the time. I think i've now fixed the unit tests 🙏🏻

@henricook

henricook commented Nov 20, 2025 •

Copy link
Copy Markdown
Author

Le sigh, these test failures look to be present on main. I can see that token split is approached in #10567 but I don't see anything for the Windows VirtualScrolling flake, maybe just retry after 10567 is in?

@henricook

Copy link
Copy Markdown
Author

I'm afraid I'm being totally stonewalled on this everyone. No one with merge rights from Librechat is engaging and maintaining this PR through merge conflicts is becoming quite a chore.

I'm really disappointed but I'm going to close this PR. If anyone thinks they've got the ear of a Librechat merger please get in touch and i'll gladly reopen it, but I can't keep resolving conflicts and crossing my fingers that they'll get around to it with no communication.

@henricook henricook closed this Dec 17, 2025
@jmaddington

Copy link
Copy Markdown
Contributor

@henricook Thank you for your work on this. We merged it into our forks (one public, one private) awhile ago and it's worked great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 design UI/UX improvements ✨ enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants