Repository navigation
Allow removing individual emoji from Recent - #199
Conversation
|
Issues:
|
|
Addressed both review points in cacb112. After the last ordinary recent emoji is removed, custom Recent rows remain visible, but the empty Frequently Used Emoji header and ordinary EBlockItem are no longer emitted. Mixed and ordinary-only sections retain their existing ordering and header behavior. Removed the unused emojiUnderMouse accessor; the private hover lookup used by click/drag handling is retained. Added six regression cases that execute the production section-entry construction and check emitted rows, not only segment membership. All 27 tests pass on the branch and all 27 pass with the focused #117 composition; the previous revision fails two new section cases in each variant. Updated the PR description and test documentation. |
|
Issues:
|
|
Fixed the cross-picker regression: Recent dispatch is now independent of ordinary emoji contents, so reactions, statuses, forum topics, avatars and channel-reaction pickers keep their own rows after the last ordinary recent is removed. The separate guard for ordinary headers/blocks remains, preserving the earlier empty-section fix. Expanded the harness to execute all browsing-loop branches and the production mode enum: a 192-state matrix covers all 12 modes, custom-resolution/premium states and filtering. All 34 cases pass on the branch and all 34 pass with the pinned original #117 composition; cacb112 fails nine cases per variant. Updated the description and documented the harness boundaries. |
Key change
Add Remove From Recent to the context menu of ordinary and custom emoji in the Recent section, using the existing localized action and delete icon.
EBlockRowView.emojiUnderMouseaccessor. The coordinate-based menu lookup remains; the private hover lookup still used by click/drag handling is unchanged.This removes individual entries, not the entire history. Packs and messages are untouched; using an emoji again adds it back to Recent.
Reason
Recent stickers already offer this action, but users could not remove individual recent emoji. Ordinary emoji only offered the tone picker where applicable, and custom emoji had no recent-removal action.
Keeping Recent in the segment list for custom emoji also exposed an empty ordinary section after its last item was removed. Custom rows are now emitted first, and ordinary header/block construction proceeds only when rendered ordinary lines exist.
Related: #117 addresses the separate bug that creates repeated recent emoji during save/load. This PR does not import or replace that fix. Its removal operation also handles already-stored variation-selector duplicates, and compatibility with #117 is checked separately.
Screenshot/video result (before/after)
Before
Right-clicking an ordinary or custom emoji in Recent did not offer Remove From Recent. For ordinary emoji with skin tones, only the tone picker was available; custom emoji could show their existing actions such as Set as Status.
No before image is attached; the user supplied after-only evidence. The existing menu construction and the focused regression checks provide the baseline comparison.
After
User-provided captures of the new action in the initial tested application:
Ordinary emoji:
Custom emoji:
These captures establish menu availability. The empty-section follow-up is covered by the emitted-row regressions below.
Confirmation
Environment: macOS 27.0 (26A428), Apple Silicon; Telegram 13.1.0 (283357), local Debug build.
The user checked the original resulting menus and supplied the captures above: both ordinary and custom Recent items expose the action. The captures demonstrate availability, not a recorded delete/relaunch sequence.
34 focused tests pass on this branch and the same 34 pass with the pinned original composition of Fix duplicated emoji and keep skin tones in Recent #117 (
592446a5); the default compatibility ref is pinned rather than silently tracking later revisions. Existing coverage includes variation selectors, tones/legacy display mappings, ZWJ/keycaps/flags, exact custom IDs, order and stored-byte preservation, JSON reload, transaction-time state, equality notifications, menu identity, reused-layer metadata and section guards.The expanded fixture executes the complete production browsing segment loop and pre-loop Recent resolution, using the real 12-mode enum and row-mode mapping. A 192-state matrix covers all modes, ordinary recents present/removed, custom recents absent/resolved/unresolved/premium-filtered, and ordinary filtering. Assertions check emitted row IDs/order/indices, row types and item identities, not only segment membership. Additional cases cover independent picker defaults, reaction clear/fallback behavior, status deduplication/selection/expansion/expiration, premium gates and limits. Earlier custom-only/empty ordinary row checks remain.
Negative controls: the same 34-test fixture compiles against
cacb1121and fails nine cases in each variant, reproducing the loss of independent picker rows. Against422a3a0b, eleven cases fail in each variant, including the two earlier empty ordinary section regressions.The harness uses the complete production recent-emoji model, real Strings/Cocoa/CoreText/SwiftSignalKit, and extracted menu/rendering/coordinate/section-entry logic, including special-picker browsing branches. Postbox/preferences, peer/media/reaction data, InputDataEntry, row/menu state, localization and icon hooks are adapters. Search is checked through source wiring; tabs, installed-pack/collectible assembly, resource loading, subscriptions and full controller/AppKit dispatch are outside the fixture. This does not establish live account persistence or server behavior. See
tools/tests/remove-recent-emoji/README.md.The initial full Debug workspace build and launch passed. That user-test build used upstream
93eab36bplus only this feature and the related Fix duplicated emoji and keep skin tones in Recent #117, with local Xcode compatibility settings. Startup additionally required a local Postbox guard normalizing duplicate incoming ordered-list IDs before recording/writing them; assertions stayed enabled and no database reset was performed. Neither Fix duplicated emoji and keep skin tones in Recent #117, that startup guard, nor local build settings is included in this PR. This historical build evidence is separate from the follow-up's focused regression results. The isolated package-build attempt was blocked by its unpopulated SSignalKit checkout; the populated Xcode workspace was used for compilation.Swift parsing and
git diff --checkpass. The branch retains five production files and its test harness, with no unrelated feature changes.I confirm that I have tested the affected behavior and verified that it works properly, or verified the content and links for a documentation-only change.