Skip to content

Conversation

samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented Jun 3, 2025

Describe Your Changes

Overview

This PR introduces automatic thread ordering based on activity, ensuring the most recently active threads appear at the top of the thread list.

What's Changed

New Features

  • Thread Timestamp Updates: Automatically update thread timestamps when new messages are added

Implementation Details

useThreads.ts

  • Added updateThreadTimestamp(threadId: string) function to the ThreadState interface
  • Implemented smart ordering logic:
    • If thread is already at order 1: only update timestamp
    • If thread is not at top: move to order 1 and increment all other threads' order by 1
  • Ensures both local state and backend storage are updated
  • Maintains search index consistency after reordering

useChat.ts

  • Integrated updateThreadTimestamp calls at key interaction points:
    • When user sends a message
    • When assistant responds with a message
  • Ensures threads stay current based on conversation activity

Files Modified

  • web-app/src/hooks/useChat.ts - Added timestamp update calls
  • web-app/src/hooks/useThreads.ts - Implemented core ordering logic

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@samhvw8 samhvw8 changed the base branch from dev to release/v0.5.18 June 3, 2025 10:45
@samhvw8 samhvw8 requested review from urmauur and louis-menlo June 3, 2025 10:46
Copy link
Contributor

ellipsis-dev bot commented Jun 3, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@louis-menlo louis-menlo changed the title Fix/thread update after chat fix: thread update after chat Jun 3, 2025
@louis-menlo louis-menlo merged commit a3ebabf into release/v0.5.18 Jun 3, 2025
@louis-menlo louis-menlo deleted the fix/thread-update-after-chat branch June 3, 2025 11:54
@github-project-automation github-project-automation bot moved this to QA in Jan Jun 3, 2025
@github-actions github-actions bot added this to the v0.5.19 milestone Jun 3, 2025
Minh141120 pushed a commit that referenced this pull request Jun 3, 2025
@david-menloai david-menloai moved this from QA to Done in Jan Jun 20, 2025
@LazyYuuki LazyYuuki removed this from the v0.7.2 milestone Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants