Skip to content

add a Recent tab - #37

Open
aspiers wants to merge 2 commits into
efck-chat-keyboard:masterfrom
aspiers:recent-tab
Open

add a Recent tab#37
aspiers wants to merge 2 commits into
efck-chat-keyboard:masterfrom
aspiers:recent-tab

Conversation

@aspiers

@aspiers aspiers commented Oct 19, 2025

Copy link
Copy Markdown

Add a new "Recent" tab which shows recently used emojis. These are filterable just like the "Emojis" tab. Recently used emojis are persisted in a separate recent_emojis.json file in the same config directory.

N.B. This was mostly vibe-coded, so I don't claim the code is necessarily top quality. However it seems to work fine.

Add a new "Recent" tab which shows recently used emojis.  These are
filterable just like the "Emojis" tab.  Recently used emojis are
persisted in a separate `recent_emojis.json` file in the same config
directory.
@kernc
kernc force-pushed the master branch 2 times, most recently from e01c6ea to 5c65879 Compare July 24, 2026 23:08
Copilot AI review requested due to automatic review settings July 24, 2026 23:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new β€œRecent” tab to the EF*CK UI that displays and filters recently used emojis, and persists that history to a separate JSON file in the config directory.

Changes:

  • Introduce a new FRecentTab (model/filter/delegate/options) for displaying recent emojis.
  • Track emoji activations in EmojiTab and persist recents to recent_emojis.json.
  • Add unit tests covering the Recent tab’s list model and text filtering.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
efck/tests.py Adds tests for the Recent tab model + filtering behavior.
efck/tabs/recent.py Implements the new Recent tab (UI + model/filter + delegate).
efck/tabs/emoji.py Updates emoji activation to record/persist the selection in the recent list.
efck/config.py Adds in-memory recent_emojis plus load/dump helpers for recent_emojis.json.
Comments suppressed due to low confidence (1)

efck/tests.py:262

  • This test mutates the global config.recent_emojis list but never restores it, which can leak state into other tests. Save/restore the prior value via addCleanup (or tearDown) to keep the suite isolated.
        from .config import recent_emojis

        # Add test emojis to recent list
        recent_emojis[:] = ['🍍', 'πŸ₯‘', 'πŸ‘']  # pineapple, avocado, peach

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread efck/tabs/recent.py
Comment on lines +93 to +97
emoji = self._model.emoji_data[source_row]
# Get metadata for this emoji (name, alt_name, shortcode, custom_str)
metadata = self._model.emoji_metadata.get(emoji, ())
# Filter by checking if all filter words appear in any of the metadata strings
return bool(self.first_matching_string(metadata, self.filter_words))
Comment thread efck/config.py
Comment on lines +101 to +104
try:
return json.load(fd)
except json.JSONDecodeError as e:
logger.warning('Error decoding recent emojis JSON: %s', e)
Comment thread efck/tests.py
Comment on lines +225 to +229
from .config import recent_emojis

# Add some test emojis to recent list
test_emojis = ['🍍', 'πŸ₯‘', 'πŸ‘']
recent_emojis[:] = test_emojis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants