ragna icon indicating copy to clipboard operation
ragna copied to clipboard

Chat Ordering Newest to Oldest

Open Adam-D-Lewis opened this issue 10 months ago • 3 comments

Feature description

Currently chats are listed oldest first (highest) in ragna ui. It seems more helpful more most use cases to reverse that order and have newer chats appear higher in the chat list in the side bar of ragna ui.

Value and/or benefit

Better UX

Anything else?

No response

Adam-D-Lewis avatar Apr 15 '24 14:04 Adam-D-Lewis

@smeragoel Any objections here?

pmeier avatar Apr 15 '24 19:04 pmeier

No objections, this is the ideal approach. You have my vote ➕

smeragoel avatar Apr 16 '24 07:04 smeragoel

Hey folks, I'm getting up to speed with the codebase and am noticing we don't have any tests in tests/deploy/ui. Would this be a good issue to start filling those in? Thoughts on UI tests for this project in general?

blakerosenthal avatar Apr 18 '24 01:04 blakerosenthal

Following the discussion started in https://github.com/Quansight/ragna/pull/445#issuecomment-2218605628, we need to define what "newest" and "oldest" mean. There are currently two contenders to order chats:

  1. Add a new timestamp to the chat, which hold the creation date
  2. Extract the timestamp from the messages of a chat and use the latest one

I initially preferred 1., but I'm leaning towards 2. now for these reasons:

  • We don't need to add new metadata. Since we have a welcome message after preparation, at least in the UI we'll always have something to order the chats by. For the API we can just add chats that have no messages, i.e. the ones that were created but not prepared yet, to the end of the list or the like.
  • The chart ordering would not be static. Meaning, the chat that the user used most recently will be at the top. Otherwise, long-standing chats might be at the bottom of the list although the user still wants to access them regularly. @arjxn-py Could you check how LLM providers (OpenAI, Anthropic, etc.) handle this?

@Adam-D-Lewis Since you have reported this, what would you prefer?

pmeier avatar Jul 10 '24 11:07 pmeier

Option 2 so you see the chat with the most recent message at the top would be my preference.

Adam-D-Lewis avatar Jul 10 '24 12:07 Adam-D-Lewis

Could you check how LLM providers (OpenAI, Anthropic, etc.) handle this?

Based upon my experience of using these LLM interfaces, I could easily identify that the approach they follow is that they sort the chat order based upon the last usage of the chat. However i took some time to find some official reference to back up what I say, I couldn't find any authentic reference for something very specific like this but I'm confident about that they must be using the timestamp of last message in the chat.

arjxn-py avatar Jul 10 '24 15:07 arjxn-py

However i took some time to find some official reference to back up what I say

Sorry, I should have been more clear. A screenshot or even your testimony would have been sufficient. I just want to make sure if we make a change here, that we not deviate from what others are doing without a clear reason to do so.

pmeier avatar Jul 10 '24 15:07 pmeier

Sorry, I should have been more clear. A screenshot or even your testimony would have been sufficient. I just want to make sure if we make a change here, that we not deviate from what others are doing without a clear reason to do so.

Totally no worries. I'm pretty sure that our approach is aligned with what others are doing already.

I also did some workaround for the same in #445 & now i can see chats being ordered based upon the last usage of the chat.

arjxn-py avatar Jul 10 '24 20:07 arjxn-py