GExperts menu grouped into submenus

AI;DR – Implementing this feature and writing this blog post were done mostly by Claude Code. If you don’t want to read “AI slop”, stop reading now.

With all experts enabled, the GExperts menu had grown so long that on some smaller screens it needed one or more “More” submenus to fit. Back in 2019 Stefan Glienke suggested restructuring it (feature request #87), and now this has finally been done.

The experts are now grouped into submenus:

  • Editor: Uses Clause Manager, Code Proofreader, Comment Empty Code Blocks, Keyboard Macro Library, Clipboard History, Source Export, Message Dialog
  • Form Designer: the experts that work on components, e.g. Components to Code, Rename Components, Replace Components, Set Tab Order
  • IDE: Expert Manager, IDE Menu Shortcuts, Keyboard Shortcuts, Reselect Desktop, Add Dock Window
  • Navigation: Grep, Instant Grep, Procedure List, Go to, Open File, Editor Bookmarks, Unit Tags, To Do List, Focus Code Editor, Vertical Tabs
  • Project: Backup Project, Clean Directories, Project Dependencies, Project Option Sets, Edit Unit Search Path
  • Tools: Code Librarian, Class Browser, ASCII Chart, PE Information

Editor Experts, which already is a submenu of its own, stays in the main menu together with Configuration and About. Within each submenu the experts are sorted alphabetically or in the historic order, as configured. Disabled experts don’t show up at all, as before.

Most experts can also be called through the Editor Popup menu or their own keyboard shortcut, so the extra level in the main menu should not hurt much. If you prefer the old flat menu anyway, uncheck “Group the GExperts menu items into submenus” on the IDE tab of the GExperts configuration.

Group the GExperts menu items into submenus
Group the GExperts menu items into submenus

The menu is built in GX_MenuActions.pas; each expert says which submenu it belongs to by overriding TGX_Expert.GetCategory. This was added in revision #5862.

As usual, if you want to try this before the next official release, you can compile your own DLL.

Discussion about this in the corresponding post in the international Delphi Praxis forum.