Implement platform menus and desktop shortcuts #34

Closed
opened 2026-08-09 19:30:04 +00:00 by hugo · 1 comment
Owner

Goal

Provide expected desktop menus and shortcuts while keeping one UI action model.

Scope

  • On macOS, expose the standard application menu bar with appropriate App, File, Edit, View, Entry, Tools, Window, and Help menus, including standard About, Settings, Hide, Minimize, Close, and Quit roles.
  • On Linux and Windows, render the equivalent application menu bar inside the main Iced window.
  • Implement a single action/enablement mapping used by menus, toolbar controls, shortcuts, context menus, and the command palette.
  • Use platform conventions: Command on macOS and Control elsewhere for Open, Save, Find, New, Close, Quit, Undo/Redo, Cut/Copy/Paste, Settings, and Help where the platform defines them.
  • Disable actions that are invalid for the current locked, loading, selection, or dirty state.
  • Use the smallest maintained Rust/native menu adapter needed for macOS, isolate it from domain behavior, keep project code free of unsafe, and record its license before adoption.

Acceptance criteria

  • macOS actions appear in the system menu bar and use standard roles/accelerators.
  • Linux and Windows expose the same applicable actions in the window menu bar.
  • Menu, shortcut, and command-palette invocations dispatch the same tested UI actions.
  • Menu enablement updates with application state and cannot bypass authentication or dirty-document confirmation.
## Goal Provide expected desktop menus and shortcuts while keeping one UI action model. ## Scope - On macOS, expose the standard application menu bar with appropriate App, File, Edit, View, Entry, Tools, Window, and Help menus, including standard About, Settings, Hide, Minimize, Close, and Quit roles. - On Linux and Windows, render the equivalent application menu bar inside the main Iced window. - Implement a single action/enablement mapping used by menus, toolbar controls, shortcuts, context menus, and the command palette. - Use platform conventions: Command on macOS and Control elsewhere for Open, Save, Find, New, Close, Quit, Undo/Redo, Cut/Copy/Paste, Settings, and Help where the platform defines them. - Disable actions that are invalid for the current locked, loading, selection, or dirty state. - Use the smallest maintained Rust/native menu adapter needed for macOS, isolate it from domain behavior, keep project code free of `unsafe`, and record its license before adoption. ## Acceptance criteria - macOS actions appear in the system menu bar and use standard roles/accelerators. - Linux and Windows expose the same applicable actions in the window menu bar. - Menu, shortcut, and command-palette invocations dispatch the same tested UI actions. - Menu enablement updates with application state and cannot bypass authentication or dirty-document confirmation.
hugo added this to the 03 - Cross-platform Iced desktop app milestone 2026-08-09 19:30:04 +00:00
hugo added the enhancement label 2026-08-09 19:30:04 +00:00
Author
Owner

Implemented and pushed in c301d9a.

  • Added one typed desktop action registry shared by Iced menus, toolbar/field controls, keyboard shortcuts, and future command-palette dispatch.
  • Added a safe macOS system-menu adapter with App/File/Edit/View/Entry/Tools/Window/Help menus and native About, Edit, Hide, Minimize, Services, and Window roles; app-owned Close/Quit still use the dirty-document guard.
  • Added the equivalent in-window Iced menu on Linux/Windows and state-derived enablement for authentication, loading, selection, editing, dirty, and saving states.
  • Added conventional Command/Control shortcuts without intercepting native text-input editing, useful About/Settings/Help entry points, and storage-provided validated timeout values.
  • Scoped and documented muda 0.19 as a macOS-only MIT OR Apache-2.0 dependency; project code remains free of unsafe and subprocesses.
  • Added regression coverage for registry completeness, shortcut resolution, dynamic enablement, authentication enforcement, and dirty-close confirmation.

Verification:

  • cargo fmt --all -- --check
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • cargo run -p ironstorage-desktop (native macOS launch smoke test)
Implemented and pushed in c301d9a. - Added one typed desktop action registry shared by Iced menus, toolbar/field controls, keyboard shortcuts, and future command-palette dispatch. - Added a safe macOS system-menu adapter with App/File/Edit/View/Entry/Tools/Window/Help menus and native About, Edit, Hide, Minimize, Services, and Window roles; app-owned Close/Quit still use the dirty-document guard. - Added the equivalent in-window Iced menu on Linux/Windows and state-derived enablement for authentication, loading, selection, editing, dirty, and saving states. - Added conventional Command/Control shortcuts without intercepting native text-input editing, useful About/Settings/Help entry points, and storage-provided validated timeout values. - Scoped and documented muda 0.19 as a macOS-only MIT OR Apache-2.0 dependency; project code remains free of unsafe and subprocesses. - Added regression coverage for registry completeness, shortcut resolution, dynamic enablement, authentication enforcement, and dirty-close confirmation. Verification: - cargo fmt --all -- --check - RUSTFLAGS="-D warnings" cargo check --workspace --all-targets - cargo clippy --workspace --all-targets -- -D warnings - cargo test --workspace - cargo run -p ironstorage-desktop (native macOS launch smoke test)
hugo closed this issue 2026-08-10 14:53:17 +00:00
Sign in to join this conversation.