Chat Sort Recent plugin thumbnail

Chat Sort Recent

Toggle chat sorting between Last Modified (most recent first) and Created Date order with a UI button in the Chats section header.

Author branislav-remen 1 stars Version 1.1.0 Updated

README

Chat Sort Recent

An Agent Zero plugin that allows toggling chat sorting between Last Modified (most recent first) and Created Date order via a UI button in the Chats section header.

Features

  • Sort Mode Toggle: Switch between "Last Modified" and "Created Date" sort modes
  • UI Button: Sort button with dropdown menu in the Chats section header
  • Persistent Preference: Sort mode is saved to localStorage and persists across page refreshes
  • Auto-Detection: Automatically detects new messages and updates sort order for Last Modified mode
  • Smart Fallback: Falls back to creation time for chats without input records

How It Works

  1. Last Modified Mode: Chats are sorted by last user input time (most recent first)
  2. Created Date Mode: Chats are sorted by creation date (newest first)
  3. The plugin patches chatsStore.applyContexts() to intercept and apply custom sorting
  4. A toggle button in the Chats header lets users switch between sort modes
  5. Sort preference is persisted in browser localStorage

Installation

  1. Copy the chat_sort_recent folder to /path/to/agent-zero/usr/plugins/
  2. Go to SettingsPlugins
  3. Enable Chat Sort Recent
  4. Refresh the page
  5. Use the sort button (↕️ icon) in the Chats section header to toggle sort mode

Technical Details

  • Backend: Python helpers and API endpoints for tracking timestamps
  • Frontend: Alpine.js store that patches chatsStore.applyContexts()
  • Storage: JSON file in plugin's data/ directory
  • Extension Point: extensions/webui/sidebar-chats-list-start/

Bug Fixes (v1.1.0)

  • Fixed bug where switching from "Last Modified" to "Created Date" didn't re-sort until page reload
  • Now properly sorts by created_at when switching to Created Date mode

License

MIT