feat(menu): support declarative hierarchical tree menu via JSON - #151
Merged
Conversation
- Introduce Shared/CustomMenu.swift with declarative tree node schema (item, submenu, separator) - Enable mixed top-level items and nested submenus with recursive NSMenu builder in FinderSyncExt - Support human-friendly references (app paths, extensions, action IDs) - Graceful fallback to default categorized menu if custom_menu.json is absent or invalid - Fix template ID and custom path loss across save/reload in ConfigService - Add robust fallback for opening accessibility system settings on macOS 15+ - Add comprehensive test suite in CustomMenuTests (three-level nesting, leaf dispatch, invalid layouts)
…and AI tip - Add 'Advanced Menu Layout' section in GeneralSettingsTabView with 'Open Config' and 'Reveal in Finder' buttons - Automatically generate initial custom_menu.json based on active apps/actions if missing, without overwriting existing files - Add friendly footer tip guiding users to leverage AI assistants (ChatGPT/Claude) for easy menu customization - Complete multilingual localizations in English, Chinese, French, Spanish, and Japanese - Add unit tests in CustomMenuTests covering safe initialization and non-overwrite semantics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Currently, RClick's context menu collapse behavior is an all-or-nothing boolean switch (
actionsCollapsed,appsCollapsed,newFilesCollapsed). This makes it difficult for users to keep their most-used apps/actions at the top level while grouping secondary utilities into categorized submenus.This PR introduces a declarative hierarchical menu schema driven by a shared JSON configuration (
custom_menu.json), enabling:item,submenu(recursive), andseparatornodes with human-friendly references (app path, file extension, action ID).custom_menu.jsonexists or if parsing fails, it gracefully falls back to the original default categorized menu.ConfigService.Type of Change
Screenshots
Testing
Manual Testing
custom_menu.jsonseamlessly restores default menuBuild Verification
All unit tests in
CustomMenuTestsandActionServiceTestspass.Checklist
dev