Skip to content

Offer Open App / Open Settings on macOS menu-bar right-click#4788

Closed
bgoncal wants to merge 1 commit into
mainfrom
fix/menu-bar-right-click-open-options
Closed

Offer Open App / Open Settings on macOS menu-bar right-click#4788
bgoncal wants to merge 1 commit into
mainfrom
fix/menu-bar-right-click-open-options

Conversation

@bgoncal

@bgoncal bgoncal commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

When the macOS app runs in the menu bar, right-clicking the status-item icon previously showed an ambiguous "Toggle Home Assistant" as its first action. This replaces it with two explicit actions so a right-click clearly offers opening the app or its settings:

  • Open Home Assistant — activates the main window (.webView scene).
  • Open Settings… — activates the Settings window (.settings scene), keeping the existing ⌘, shortcut.

The standalone "Preferences…" status-item entry (which did the same thing as the new "Open Settings…") is removed to avoid duplication; the regular app-menu "Preferences…" (⌘,) is untouched. The left-click show/hide toggle behaviour on the icon is unchanged.

Resulting right-click menu: Open Home Assistant · Open Settings… · — · About · Check for Updates · Quit.

Screenshots

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

New localized strings menu.status_item.open and menu.status_item.open_settings added to en.lproj/Localizable.strings (non-English locales sync from Lokalise). Strings.swift accessors regenerate via the SwiftGen build phase; updated here to match.

The status-item right-click menu's first action was an ambiguous
"Toggle Home Assistant". Replace it with two explicit actions —
"Open Home Assistant" (activates the main window) and "Open Settings…"
(activates the Settings window, keeping the ⌘, shortcut) — so a
right-click clearly offers opening the app or its settings. The
left-click show/hide toggle behaviour is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 19, 2026 15:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the macOS menu-bar (status item) right-click menu in the Catalyst app by replacing the ambiguous “Toggle Home Assistant” action with explicit “Open Home Assistant” and “Open Settings…” actions, while keeping the existing left-click toggle behavior via the status item’s primary action handler.

Changes:

  • Add new localized strings for the status-item menu: “Open %@” and “Open Settings…”.
  • Update the status-item right-click menu to show “Open Home Assistant” and “Open Settings…” (⌘,) and remove the redundant “Preferences…” entry from that menu.
  • Regenerate/update SwiftGen string accessors to include the new localization keys.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
Sources/Shared/Resources/Swiftgen/Strings.swift Adds SwiftGen accessors for menu.status_item.open and menu.status_item.open_settings.
Sources/App/Utilities/MenuManager.swift Replaces the status-item “Toggle” menu entry with explicit “Open” / “Open Settings…” items; keeps left-click toggle via primaryActionHandler.
Sources/App/Resources/en.lproj/Localizable.strings Adds English source strings for the new status-item menu labels.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Unused L10n strings detected

Found 21 unused localization strings in the codebase.

Click to see details
Parsing Strings.swift...
Found 1656 L10n strings

Reading all Swift source code...
Read 5710572 characters of Swift code

Checking for unused strings...
Checked 100/1656 strings...
Checked 200/1656 strings...
Checked 300/1656 strings...
Checked 400/1656 strings...
Checked 500/1656 strings...
Checked 600/1656 strings...
Checked 700/1656 strings...
Checked 800/1656 strings...
Checked 900/1656 strings...
Checked 1000/1656 strings...
Checked 1100/1656 strings...
Checked 1200/1656 strings...
Checked 1300/1656 strings...
Checked 1400/1656 strings...
Checked 1500/1656 strings...
Checked 1600/1656 strings...

================================================================================
UNUSED STRINGS REPORT
================================================================================

Found 21 unused strings:


ACTIONSCONFIGURATOR:
  - L10n.ActionsConfigurator.Action.createAutomation
    Key: actions_configurator.action.create_automation
    Line: 132
  - L10n.ActionsConfigurator.VisualSection.sceneDefined
    Key: actions_configurator.visual_section.scene_defined
    Line: 172
  - L10n.ActionsConfigurator.VisualSection.serverDefined
    Key: actions_configurator.visual_section.server_defined
    Line: 178

APPINTENTS:
  - L10n.AppIntents.WidgetAction.actionsParameterConfiguration
    Key: app_intents.widget_action.actions_parameter_configuration
    Line: 606

CAMERA:
  - L10n.Camera.serverNotFound
    Key: camera.server_not_found
    Line: 764
  - L10n.Camera.snapshotFailed
    Key: camera.snapshot_failed
    Line: 766

CAMERALIST:
  - L10n.CameraList.noArea
    Key: camera_list.no_area
    Line: 771
  - L10n.CameraList.searchPlaceholder
    Key: camera_list.search_placeholder
    Line: 773

CAMERAS:
  - L10n.Cameras.dragToReorder
    Key: cameras.drag_to_reorder
    Line: 829

SETTINGSDETAILS:
  - L10n.SettingsDetails.Actions.ActionsSynced.footerNoActions
    Key: settings_details.actions.actions_synced.footer_no_actions
    Line: 3842
  - L10n.SettingsDetails.Actions.Scenes.customizeAction
    Key: settings_details.actions.scenes.customize_action
    Line: 3860

URLHANDLER:
  - L10n.UrlHandler.Error.actionNotFound
    Key: url_handler.error.action_not_found
    Line: 4679

WIDGETS:
  - L10n.Widgets.Controls.Automations.placeholderTitle
    Key: widgets.controls.automations.placeholder_title
    Line: 5731
  - L10n.Widgets.Controls.Button.placeholderTitle
    Key: widgets.controls.button.placeholder_title
    Line: 5739
  - L10n.Widgets.Controls.Cover.placeholderTitle
    Key: widgets.controls.cover.placeholder_title
    Line: 5749
  - L10n.Widgets.Controls.Fan.placeholderTitle
    Key: widgets.controls.fan.placeholder_title
    Line: 5759
  - L10n.Widgets.Controls.Light.placeholderTitle
    Key: widgets.controls.light.placeholder_title
    Line: 5769
  - L10n.Widgets.Controls.Scenes.placeholderTitle
    Key: widgets.controls.scenes.placeholder_title
    Line: 5923
  - L10n.Widgets.Controls.Scripts.placeholderTitle
    Key: widgets.controls.scripts.placeholder_title
    Line: 5935
  - L10n.Widgets.Controls.Switch.placeholderTitle
    Key: widgets.controls.switch.placeholder_title
    Line: 5943

ROOT:
  - L10n.noArea
    Key: no_area
    Line: 36

================================================================================
Total unused: 21
================================================================================

To clean up these strings, manually remove them from the Localizable.strings files
and regenerate Strings.swift using SwiftGen.

@bgoncal

bgoncal commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

Superseded by #4789, which combines this with #4787 plus the window-activation fix.

@bgoncal bgoncal closed this Jun 19, 2026
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@e46f174). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4788   +/-   ##
=======================================
  Coverage        ?   44.95%           
=======================================
  Files           ?      275           
  Lines           ?    16835           
  Branches        ?        0           
=======================================
  Hits            ?     7568           
  Misses          ?     9267           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants