Implement interactive chat filtering and enhanced search features#2
Merged
Conversation
- Add filterChats utility for client-side chat filtering - Make filter pills (All/Unread/Favorites/Groups) clickable - Filter excludes archived chats by default - Update archived section to show unread count in archived - Fix keyboard navigation to use filtered chat count - All navigation handlers (up/down/home/end/pageup/pagedown) now bound correctly
- Fix filter pills using onMouse handler instead of .on('click')
- Add Tab/Shift+Tab keyboard shortcuts for cycling through filters
- Fix Enter key handler to use filtered chats array
- Fix mouse click handler in ChatListManager to use chat parameter
- Previously selected index was applied to unfiltered array causing wrong chat to open
- Now correctly opens the chat that is visually selected in the filtered list
- Replace static search bar with InputRenderable for interactivity - Add module-level search input storage for lifecycle management - Export focusSearchInput/blurSearchInput/clearSearchInput functions - Add keyboard shortcuts: / or Ctrl+F to focus search - Escape to blur search or clear query if active - Search updates searchQuery state in real-time - Filtering works via existing filterChats function (searches chat names) - Search properly integrates with inputMode state
- WhatsApp Web includes archived chats in search, not just active chats - Removed isArchived filter from searchChatsWithSections - Search now correctly finds chats in archived section - Fixes issue where searches returned 0 results for archived chat names
- Added allContacts field to AppState for full phonebook contacts - Created loadAllContacts utility to fetch all contacts from /api/contacts/all - Integrated loadAllContacts into loadChats function (runs on app startup) - Updated enhanced search to use allContacts instead of contactsCache - Contacts section now searches full phonebook, not just chat participants - Fixes issue where contact searches returned 0 results
- Contacts API returns {id, name, pushname, shortName} not {whatsappId, fullName}
- Updated loadAllContacts to use correct field names from API response
- Now contacts will load correctly (previously loaded 0 contacts)
- **Enhanced Search**: Implemented WhatsApp-style sectioned search results (Chats, Contacts, Messages). - **Archived Chats**: Added clickable 'Archived' section to chat list with toggle state and back navigation. - Added 'Ctrl+A' / 'Meta+A' shortcut to toggle archived view. - **Start New Chat**: Implemented 'Start new chat from search' feature. - Validates phone numbers via WAHA API (). - Navigates to conversation view for valid numbers. - **Refactor**: - Cleaned up types (removed ). - Simplified utility. - Improved component types.
Added getCurrentFilteredChats helper to index.ts that respects showingArchivedChats state when determining the active chat list. This ensures keyboard navigation (Up/Down/Enter/Home/End/PageUp/PageDown) operates on the correct list when viewing archived chats, fixing the bug where selecting an archived chat would open a different conversation. Also imported isArchived utility from filterChats for proper type-safe archive status detection.
- Enable mouse click on chat list items to open conversations (using OpenTUI's onMouse callback) - Fix "two actives" bug where both selected and clicked chats showed highlights - Add updateSelectionAndActive() method to properly update all row styling when using cached list - Convert dynamic imports to static imports for cleaner code: - ChatListManager.ts: destroyConversationScrollBox - SessionCreate.ts: showQRCode - index.ts: setRenderer, showQRCode, chatListManager, getClient
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce interactive filter pills for chat categories and a search bar that integrates with archived chats and the full contacts list. Fix issues with chat selection and keyboard navigation to ensure a seamless user experience. Enhance search functionality to include all contacts and provide real-time updates based on user input. Update dependencies and versioning accordingly.