Repository navigation
Add read and unread actions to search chat menus - #152
Conversation
|
Issues: CONFIRMED: SearchPeerReadMenuItem.swift:14-31: for a forum shown as messages (View as Messages on), the menu takes its label from the thread-based read counters, which never reflect the manual unread mark, while the action sets that mark, so after Mark as Unread search keeps offering Mark as Unread (now a no-op) and never Mark as Read, and the mark cannot be cleared from search. CONFIRMED: PR description: the description still says secret-chat results use the real chat ID and that read forums and monoforums omit the action, but at head secret chats get no read action at all and read forums shown as messages or tabs do offer Mark as Unread. CONFIRMED: PR description: the description, CONFIRMED: SearchUnreadHarness.swift:27: the diagnostic window keeps NSWindow's default |
|
Issues: CONFIRMED: SearchUnreadHarness.swift:10: the harness keeps its window in a global that strongly holds the first |
|
Issues:
|
|
Issues:
|
Key change
Add the ordinary chat list’s Mark as Unread/Read action to search results, recent peers and the top-peer strip, including top-level Saved Messages. Saved-message sub-chat results intentionally omit the action, matching their own list. Read current state when a menu opens and keep pin/folder/remove actions.
Reason
Search menus lacked a reminder action. Only peers actually in a chat-list group are eligible. Secret-chat namespaces remain excluded. Forums shown as messages or tabs retain Mark as Unread, matching the engine; other read forums omit the unsupported whole-peer action.
Screenshot/video result (before/after)
The retained comparison shows real production ContextMenuItems in a native AppKit popup using Saved Messages only. This is a diagnostic host, not a recreation of the custom glass renderer or a published chat list.
Before
After
Confirmation
macOS 27.0.1 (26A434), Xcode 27.1; historical full-client captures use Telegram 13.1.0 (283357), Debug arm64.
python3 tools/tests/search-unread/run.py: 46/46 checks pass. Saved Messages shown as sub-chats now omit read/unread actions entirely, before querying or changing the peer's real private chat. Ordinary search/recent/popular peer menus retain the action, including the top-level Saved Messages chat. The shared helper receives the actual search target. Existing forum/manual-unread cases remain covered. The diagnostic toggle harness now holds a shared run lease through restoration, including when its window is closed and reopened; six lease tests cover ownership, restoration and rejecting an overlapping run. The historical native engine pass restored the Saved Messages flag and predates this follow-up. Current target/lease cases are controlled source checks, not new physical right-click/server-state verification.The full Debug arm64 client workspace compiled successfully with these shipping sources and real native dependencies on macOS 27.0.1 / Xcode 27.1. It includes other pending changes and local SDK/profile overrides, so this is integration build coverage rather than an independent build of this PR alone.