Skip to content
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

Feature: is there any way to Hide or Sort context menu items? #773

Open
yurenchen000 opened this issue Jun 12, 2023 · 10 comments
Open

Feature: is there any way to Hide or Sort context menu items? #773

yurenchen000 opened this issue Jun 12, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@yurenchen000
Copy link

yurenchen000 commented Jun 12, 2023

the built-in menu, and plugins added menu item.

there can be dozens of menu items.
Is there a way to

  • Hide menu item
    • OR categorized into the secondary menu //like the Grouping menu in 2.1.3
  • Sort menu item by custom order
    • OR split line into different item group // like the current Copy Paste item followed by a horizon line

Is it possible implement it in a plugin,
OR have to change the terminator source code?

@Vulcalien
Copy link
Member

Vulcalien commented Jun 13, 2023

This is something that should be implemented. I also found myself overwhelmed by all the options and it's only going to get worse over time, as we add new ones.

Currently, only a few can be disabled (without changing the code) by disabling the plugin that generates them.

@Vulcalien Vulcalien added the enhancement New feature or request label Jun 13, 2023
@yurenchen000
Copy link
Author

I also found myself overwhelmed by all the options and it's only going to get worse over time, as we add new ones.

Can't agree more.

Purify and classify configuration items to achieve a simple and smooth setting UI?
// Put less commonly used settings in configuration files or advanced settings ?


Tabby1 has a smooth settings experience.

Footnotes

  1. https://github.com/Eugeny/tabby

@yurenchen000
Copy link
Author

Currently, only a few can be disabled (without changing the code) by disabling the plugin that generates them.

And plugins no there own setting page,
They have to put setting entry into contenxt menu.

@mattrose
Copy link
Member

Two things about this. We should put all plugin context menu items in their own Plugins sub-menu.

We should look to see if there's a way to integrate plugin configurations into the plugin tab of the preferences section. There's room for it there.

@yurenchen000 can you say more about what you like for tabby in particular? Is the context menu configurable somehow?

@yurenchen000
Copy link
Author

apologize for the late reply, it's been a busy week.
(I'm not a UX engineer, just a heavy everyday user.

We should put all plugin context menu items in their own Plugins sub-menu.

I thought that plugins declare/create menu, but end user use it.
so maybe give the choice to user for customize context-menu by show/hide sort/group items in top-level context-menu.

Something like custom extension toolbar in chrome(and firefox)
// I thought the context menu in terminator was as important as the browser toolbar, but it's easy to get messy
chrome_toobar_customize-

@yurenchen000
Copy link
Author

yurenchen000 commented Jun 21, 2023

We should look to see if there's a way to integrate plugin configurations into the plugin tab of the preferences section. There's room for it there.

Yes, the Preference > Plugins tab has been there for years.

I was also interested in it.
Currently it seems that the plugin cannot add the settings page without doing some hacks ?


BTW,

feels that the plugin capabilities are very limited:
https://gnome-terminator.readthedocs.io/en/latest/plugins.html#plugins


plugin developer have to hack to get power


end user have to edit ~/.config/terminator/config manully:

@yurenchen000
Copy link
Author

Is the context menu configurable somehow?

I'm not sure for now. I don't very rely on context-menu in Tabby,



can you say more about what you like for tabby in particular?

I think it's about legacy vs modern app UX.
Some features really move me:

  • ❶ A title bar that makes full use of window space
    // the tab can have colorful underline mark
    tabby_title_bar-

  • ❷ Integrated plugin list, one-click installation and uninstallation
    tabby_plugin_list-

  • ❸ Smooth configure experience

@vssdeo
Copy link
Contributor

vssdeo commented Oct 9, 2023

This discussion sounds interesting. Also its good to have the list of plugin support features compiled at one place (as above) thanks. I will look into this also.

Also just to add to brain storming:

  1. I had just done a bookmark plugin but later removed the branch as I have merged the functionality into custom command plugin. In that I did try to have both embed the plugin preference in the main Preference tab which could be called directly using short cut. (KeyBinding which I have added to Plugin for short cuts which do get into Preferences Key Bindings). In here the plugin preference window can be poped up directly or as part of main Preference window.

    Once my bookmark addition to custom plugin gets tested, I plan to put custom keyboard available as part of main Preference window and see if it gets approved.

  2. I am also not a UI guy but the second screenshot is from a trading terminal where the options are added to a selection using a pane interface. (with add <-> remove). Basic sorting and etc can be done but to make it really configurable as per user and his/her own whims something like this may work ? Like on right we have actions and those can be added to left side of pane in lets say Menu. Other components like horizontal line etc. We save and those get displayed as menu.

bookmark-plugin-prefs-menu
menu-selector

@vssdeo
Copy link
Contributor

vssdeo commented Oct 12, 2023

So, don't want to be over excited just yet, I am testing it and cleaning up.

Below is the working plugin screenshot with following features:

-Context Menu Edit

  • Preference Window Support - drag drop and order
  • Plugins can register their Keybinding actions so even those can be added to Context Menu
  • Multiple Plugins can register for an Keybind event and handle those
  • So Context menu Plugin registers its own event to menu like a plugin

TODO: groups and etc will do later once functionality is tested

Note: Items below Preferences are done by plugin and even Preference can register its action via plugin, but I am keeping some things same for testing for now.

  • Also while moving code from terminal_popup_menu.py a whole lot of actions are under if condition I will see how to integrate that.

if not terminal.is_zoomed():

new-1
new-2

vssdeo added a commit to vssdeo/terminator that referenced this issue Oct 16, 2023
…tems gnome-terminator#773

- Adds a context menu (right click)
- Gives an UI under Preferences->Plugins with capability to organize items
- Supported by PluginEventRegistry which helps to add plugin actions to menu
-   apart from other plugins using this, for eg. this context_menu_plugin can
-   register its menu functions while itself creating a menu
- ContextMenu items will appear in the order of plugin loading, so may be later
    we can have a priority / order in plugin loading
- Supported by KeyBindUtil for action key / desc matching
- Changes made to prefseditor.py for selection of plugin preferences,
- update_gui etc
- Cleans and identifies common dependencies which can we further worked on
-
- Gradual removal of menuitems to be done with checking logic and removal of if
- based conditions. All cases are being compiled in class Filter below which
- have to be removed
-
@vssdeo
Copy link
Contributor

vssdeo commented Oct 16, 2023

Context Menu Plugin

  • Ref: https://github.com/vssdeo/terminator/tree/773-Feature-is-there-any-way-to-Hide-or-Sort-context-menu-items

  • Adds a context menu (right click)

  • Gives an UI under Preferences->Plugins with capability to organize items

  • Supported by PluginEventRegistry which helps to add plugin actions to menu
    apart from other plugins using this, for eg. this context_menu_plugin can
    register its menu functions while itself creating a menu and so can other plugins

  • Supported by KeyBindUtil for action key / desc matching

  • Cleans and identifies common dependencies which can be further worked on

  • Gradual removal of menuitems to be done with checking logic and removal of if
    based conditions. All cases are being compiled in class Filter below which have to be removed

  • Menu Names are taken from keybinding name

Things to Note:

  • these functions zoom,unzoom,maximise,open_debug_tab in terminal_popup_menu.py
    are under various if conditions so they have been clubbed together in
    Filter Class. These can be tested out first.
    Some items are left there for now, we can gradually bring those in.
    For some of them either keypress_ mapping can be added or they can be handled
    in plugin itself.

  • Plugin Loading Order: affects the placement of items, like if CustomCommand plugin
    is loaded first it will be placed above ContextMenuPlugin Menu. May be TODO for
    later could be having loading order / priority for plugins.

  • In terminator tests if I don't append keyword 'Plugin' to Plugin KeyBindings
    they fail, hence menu is named 'Plugin Edit Menu' can be edited in plugin itself, I
    need to dig into tests more

  • toggle scrollbar in prev mode has a check button, in terminal action is Toggle Scroll Bar

  • PrefsEditor.keybindings are imported to use in KeyBindUtil mapping for base and plugin
    key binding utility, hence we now have a consolidated interface, this can be decoupled ?

  • For now terminal_popup_menu.py code is commented out of items moved by plugin
    functionaliy

  • Plugin Select / toggle and Plugin Init prefseditor.py
    In on_plugin_selection_changed(self, selection) calls set_plugin but
    on_plugin_toggled calls init on plugin, this causes, set_plugin
    to be called when plugin init hasn't happened due toggling

Other Observations:

  • Many icon for actions are missing

Testing:

  • Open terminator.

  • Right Click and you won't see a whole lot of items

  • Go to Preferences -> Plugins click PluginContextMenu after that
    <Alt>m is default binding can be used

  • Right Click and You will be able to see default items on left pane.

  • You don't have to Apply as defaults are avaialbe when plugin is enabled.

  • Now you can use m to directly open Prefs -> Plugin -> PluginContextMenu
    and make changes reorder and play around.

Test for:

  • Context Menu Functionaliy

  • Imp: Check for conditions like: (as in current working)
    Horizontal split, then zoom should disable 'split' options and
    enable 'Restore Terminal' / Unzoom

  • Context Menu Editing

  • Check Short-cuts

  • Also re-check Prefs->Keybindins, edit , test

  • Prefs->Plugins- Select Deselect/Toggle ContextMenuPlugin and others

Extending Features to other Plugins:

  • So as documented in PluginContextMenu and plugin.py , The PluginEventRegistry
    allows other plugins to add functionality for them to add their events to
    context menu, its very simple, I can edit mousefree_url_handler plugin once
    this goes in.

vssdeo added a commit to vssdeo/terminator that referenced this issue Feb 22, 2024
…#889

- Current list of Keybindings in Preferences->Keybindings are shown after merging
- The merge happens in prefseditor.py
- Cleaning and moving the code from prefseditor.py
- Adding a function to get plugin via name
- Adding some missing keybindings in config.py and prefseditor.py and syncing them for consistency
- These changes were also part of:
    Feature: is there any way to Hide or Sort context menu items? gnome-terminator#773 and
    Pull request: [Plugin ContextMenuPlugin] 773-Feature-is-there-any-way-to-Hide-or-Sort-context-menu gnome-terminator#842
- So decoupling these as separate issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants