Skip to content

feat: implement unified toggle widget shortcut system across interfaces #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

umutdz
Copy link
Contributor

@umutdz umutdz commented May 20, 2025

Implement Toggle Widget Shortcut for All Interfaces, issue #22

This PR implements a unified toggle widget shortcut system across both Textual and Tkinter interfaces. The shortcut can be configured in settings and will be automatically converted between Textual and Tkinter formats.

Changes

  • Created shortcuts.py utility in _lib folder with conversion functions:

    • convert_to_textual_shortcut: Converts Tkinter format (<Control-t>) to Textual format (ctrl+t)
    • convert_to_tkinter_shortcut: Converts Textual format to Tkinter format
    • Added comprehensive test suite in test_shortcuts.py
  • Updated Tkinter interface to use the shortcut from settings:

    • secret_entry.py: Now uses toggle_widget from settings instead of hardcoded <Control-t>
    • date_entry.py: Now uses toggle_widget from settings instead of hardcoded <Control-Shift-C>
  • Textual interface was already using the correct format, no changes needed

Testing

  • Added test suite for shortcut conversion functions, see test_shortcuts.py

  • Verified that shortcuts work in both interfaces:

    • Secret tag visibility toggle
    • File picker dialog
    • Datetime dialog

Notes

  • Textual format (ctrl+t) is used as the canonical format in settings
  • Automatic conversion between formats ensures consistent behavior across interfaces
  • All tests are passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant