Closed arjxn-py closed 2 months ago
@blakerosenthal Could you check if this change is indeed enough?
This doesn't quite work, unfortunately. self.chats
comes indirectly from database.py:get_chats which doesn't guarantee order. There's no timestamp on orm.Chat
either otherwise we could sort in get_chats
.
Option 1: add a (created_at) timestamp to Chats and then add an order_by
to the table.
Option 2: dig into the messages
and pull out either the first or last message timestamp. I kind of like this option because then the UI could show chats by how recently they were used, not when they were created. This could be accomplished with a last_updated
field on the chat table as well.
I'd prefer option 1. by a big margin.
Thanks a lot for confirming on this @blakerosenthal, the ui tests you added were also very helpful to test in #446 🚀 To be honest I also like the latter (option 2) more as I feel it contains more utility for the user.
Hi @blakerosenthal, happy to have your quick look again on this. Thanks 🙂
I'm ok with limiting the scope of this change to only adapt the order when the page (re-)loaded. But ultimately, we want the ordering change to be dynamic, e.g. if I ask a new question in an old chat, that should automatically move to the top of the list rather than this only happening the next time I load the page. @arjxn-py or @blakerosenthal could one of you open a new issue for this?
could one of you open a new issue for this?
Thanks @pmeier, opened #457 for this, feel free to correct me there if needed.
This PR modifies the
LeftSidebar
component to display chats in reverse order, showing the newest chats first instead of the oldest. Should fix #391