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

Dynamic Chat Ordering Based on Recent Activity #457

Open
arjxn-py opened this issue Jul 22, 2024 · 0 comments
Open

Dynamic Chat Ordering Based on Recent Activity #457

arjxn-py opened this issue Jul 22, 2024 · 0 comments
Labels
type: enhancement 💅 New feature or request

Comments

@arjxn-py
Copy link
Contributor

arjxn-py commented Jul 22, 2024

Feature description

Currently, the chat ordering is only updated when the page is (re-)loaded. To improve the user experience, we want to dynamically reorder chats based on recent activity. Specifically, when a user interacts with an old chat by asking a new question, that chat should automatically move to the top of the list. This dynamic reordering should happen in real-time, ensuring that the most recently active chats are always easily accessible without requiring a page reload.

Value and/or benefit

  • Enhances user experience by keeping active and relevant chats easily accessible.
  • Reduces the need for manual page reloads to see updated chat order.
  • Streamlines interaction by automatically surfacing the most recent activity.

Anything else?

Related code snippet-

@pn.depends("refresh_counter", "chats", "current_chat_id", on_init=True)
def __panel__(self):
epoch = datetime(1970, 1, 1)
self.chats.sort(
key=lambda chat: (
epoch if not chat["messages"] else chat["messages"][-1]["timestamp"]
),
reverse=True,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement 💅 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant