NAME
Developer::Dashboard::SystemMenu - project indicators into an operating-system menu
PURPOSE
This module is the configuration and presentation boundary between the Developer Dashboard indicator store and an operating-system menu adapter. It keeps menu selection deterministic and testable without loading a native framework during ordinary command startup.
WHY IT EXISTS
The Dashboard already records named indicators and their current display icons. The foreground web service can show the enabled indicators in a native operating-system menu while leaving the existing terminal prompt indicator path unchanged. Separating this configuration projection from the native adapter keeps Linux tests able to validate selection without pretending to display a desktop menu.
WHEN TO USE
Use items_for_platform from Developer::Dashboard::SystemMenu::Runner after loading merged Dashboard configuration and current indicator records. The runner supports macos, windows, and ubuntu selectors and owns the native menu's blocking event loop on a controlled GoRoutine worker. The foreground service must stop and join that worker during shutdown. Ordinary commands must not start a blocking menu loop.
HOW TO USE
my $items = Developer::Dashboard::SystemMenu->items_for_platform(
config => $config,
indicators => \@indicator_states,
platform => 'windows',
);
The method returns an ordered array reference containing name and icon for each configured indicator whose selector for the requested macos, windows, or ubuntu platform is enabled and has a current state. A missing or false selector disables that item. Other platform names return an empty array reference. Invalid configuration types and non-boolean values for any supported platform selector are errors, even when the current host is not that platform.
Pass the already merged configuration, current indicator records from Developer::Dashboard::IndicatorStore, and the platform key. The returned array preserves declaration order and contains only currently available, enabled indicators. To run a native menu, pass the merged configuration and indicator store to Developer::Dashboard::SystemMenu::Runner and use run_with around the foreground service callback.
EXAMPLES
{
indicators => [
{ name => 'build', indicator => { macos => 1, windows => 1 } },
{ name => 'tests', indicator => { ubuntu => 1 } },
],
}
Given current states { name => 'build', icon => 'OK' } and { name => 'tests', icon => 'FAIL' }, a macos or windows call contains the build entry, while an ubuntu call contains tests. This is configuration projection only; it does not assert that any native menu is started or visible. Native integration is opt-in per platform; Ubuntu requires Ayatana AppIndicator3 and GTK3 development packages to build its helper.
WHAT USES IT
Configuration tests use this module on Linux to verify platform selection and validation without launching a graphical process. The foreground service's SystemMenu runner uses the projection before starting the bundled native adapter. The projection module itself has no native dependencies and can be loaded by commands on every platform.