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.
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
- Last Modified Mode: Chats are sorted by last user input time (most recent first)
- Created Date Mode: Chats are sorted by creation date (newest first)
- The plugin patches
chatsStore.applyContexts()to intercept and apply custom sorting - A toggle button in the Chats header lets users switch between sort modes
- Sort preference is persisted in browser localStorage
Installation
- Copy the
chat_sort_recentfolder to/path/to/agent-zero/usr/plugins/ - Go to Settings → Plugins
- Enable Chat Sort Recent
- Refresh the page
- 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