Add dedicated "Synced" tab to sidebar for synchronized conversations #413
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.

Overview
This PR adds a new "Synced" tab to the frontend sidebar that displays only synchronized or monitored conversations, providing clear separation from the existing Users, Groups, and Channels tabs which show all available Telegram dialogs.
Problem
Previously, the sidebar showed all Telegram dialogs grouped by type (Users/Groups/Channels), but there was no way to quickly identify which conversations had been synchronized to the local database and had searchable message history. This made it difficult for users to distinguish between:
Additionally, both the Telegram API (
dialog:fetch) and database (storage:fetch:dialogs) were writing to the samechatsarray, causing data conflicts.Solution
Data Architecture
Implemented clean separation of data sources:
chats[]: All available dialogs from Telegram API (fresh, up-to-date)syncedChats[]: Only synchronized chats from database (with searchable history)UI Changes
Added a fourth tab to the sidebar:
The new "Synced" tab:
joined_chatstableSmart Search Logic
Enhanced the
getChat(id)function with priority-based search:chats[](Telegram API - most current data)syncedChats[](Database - handles archived/deleted chats)This ensures users always see the freshest chat information while maintaining access to historical synced conversations.
Technical Details
Files Modified: 7 files (+39, -6 lines)
Key changes:
packages/client/src/stores/useChat.ts: AddedsyncedChatsref and dual-source initializationpackages/client/src/event-handlers/storage.ts: Routed database events tosyncedChatsapps/web/src/layouts/default.vue: Added new tab UI and filtering logicchatGroups.syncedkey in both English and ChineseBenefits
Testing
Screenshots
(Note: Screenshots blocked by network restrictions in development environment. The UI adds a new tab with database icon "🗄️ Synced" positioned as the leftmost tab in the chat groups section.)
Closes #[issue-number] (if applicable)
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.comnode /home/REDACTED/work/telegram-search/telegram-search/node_modules/.bin/../vite/bin/vite.js build(dns block)node /home/REDACTED/work/telegram-search/telegram-search/node_modules/.bin/../vite/bin/vite.js --port 3333(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.