feat: implement hierarchical submenu support for BitBar/Argos format#40
Merged
feat: implement hierarchical submenu support for BitBar/Argos format#40
Conversation
Implements support for nested submenus in the system tray menu using the BitBar/Argos format where lines prefixed with -- indicate submenu items. Changes: - Modified output_parser.dart to detect -- prefixes and build hierarchical MenuItem structures with submenu fields - Added _parseIndentedLine() to calculate depth from -- prefix count - Added _parseMenuItemFromLine() for individual line parsing - Fixed separator logic: first --- marks menu start, subsequent add visual separators - Modified tray_service.dart to recursively convert plugin model MenuItems to tray_manager MenuItems with proper submenu support - Added _convertMenuItems() for recursive conversion - Used MenuItem.submenu() factory for proper tray submenu rendering - Added comprehensive unit tests covering 1-5 levels of nesting - Created submenu_demo.30s.sh example plugin demonstrating nested menus - Regenerated l10n files to fix missing widgetUpdateNote getter Closes #37
Create packages/crossbar_core and packages/crossbar_cli to resolve dart compile exe failures caused by Flutter conditional imports. Changes: - packages/crossbar_core: Pure Dart package with shared APIs and models - APIs: media_api, network_api, system_api, utils_api - Models: plugin, plugin_config, plugin_output - Core: output_parser - packages/crossbar_cli: CLI executable package - All 17 CLI commands migrated - plugin_manager_cli.dart: Simplified plugin manager for CLI - Config values read from JSON plaintext (~/.crossbar/config/) - Entry point: bin/crossbar.dart - Makefile: Updated linux target to compile CLI from package - AGENTS.md: ADR-001 superseded, ADR-011 added ADR-011: Monorepo with separate packages resolves dart:ui import issues. Verified: make linux, make analyze, make coverage all pass.
- AGENTS.md: Update section 3 to reflect Dual-Binary + Monorepo architecture - Add documentation for packages/crossbar_core and packages/crossbar_cli - Update CLI source path from bin/crossbar.dart to packages/crossbar_cli/bin/crossbar.dart - README.md: Update Architecture diagram - Add packages/ directory structure with crossbar_core and crossbar_cli - Mark lib/core as Flutter-specific - Document CLI entry point in packages/crossbar_cli/
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
Implements support for nested submenus in the system tray menu using the BitBar/Argos format where lines prefixed with
--indicate submenu items.This feature enables plugins to create complex hierarchical menus, just like BitBar and Argos have always supported.
Changes
Parser (
lib/core/output_parser.dart)_parseBitBar()to detect--prefixes and build hierarchicalMenuItemstructures_parseIndentedLine()to calculate depth from--prefix count (--= level 1,----= level 2, etc.)_parseMenuItemFromLine()for cleaner individual line parsing---marks menu start, subsequent separators add visual dividersTray Service (
lib/services/tray_service.dart)_updateMenu()to recursively convert plugin modelMenuItems totray_managerMenuItems_convertMenuItems()for recursive conversion with submenu supportMenuItem.submenu()factory for proper tray submenu renderingTests
Documentation & Examples
plugins/examples/submenu_demo.30s.shdemonstrating submenu usagedocs/plugin-development.md(lines 183-195)Example Usage
Testing
make analyze- No issuesmake coverage- 45.8% (target: 35-60%)make linux- Build successfulmake android- Build successfulCloses #37