mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-28 01:09:49 +01:00
Merge pull request #3217 from nledford/mac-menu-appkit-help
MENU-HELP-FEEDBACK: the macOS Help menu has one feedback row, LightCraft's
This commit is contained in:
5 files changed
+100
-35
No files matched your search
+1
-1
@@ -130,7 +130,7 @@ muda = { version = "0.21", default-features = false } # native menu bar (macOS:
|
||||
# macOS: the profile of the screen showing the window (safe AppKit bindings; muda and wgpu use the same)
|
||||
objc2 = { version = "0.6", default-features = false, features = ["std"] }
|
||||
objc2-app-kit = { version = "0.3.2", default-features = false, features = ["std", "NSApplication", "NSAccessibility", "NSColorSpace", "NSResponder", "NSScreen", "NSWindow", "NSWorkspace"] }
|
||||
objc2-foundation = { version = "0.3", default-features = false, features = ["std", "NSArray", "NSData"] }
|
||||
objc2-foundation = { version = "0.3", default-features = false, features = ["std", "NSArray", "NSData", "NSString", "NSUserDefaults"] }
|
||||
# Linux: the desktop's dark/light setting from the XDG settings portal (Settings ▸ Interface ▸
|
||||
# Appearance Mode ▸ Auto). Pure Rust; the version accesskit already brings in, pinned to it.
|
||||
zbus = "=5.19.0"
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
//! Menu rows AppKit adds to the menu bar by itself, switched off through the app's user defaults
|
||||
//! (macOS).
|
||||
//!
|
||||
//! AppKit puts "Send <app> Feedback" at the top of the Help menu for every app (Feedback
|
||||
//! Assistant's entry), beside LightCraft's own Help ▸ Send Feedback…. Setting `NSShowFeedbackMenu`
|
||||
//! to `false` removes it (read on macOS 27 from the app's menu bar). AppKit reads the default when
|
||||
//! it builds the menus, so it is set before the menu bar exists.
|
||||
//!
|
||||
//! The value is written to the app's preferences (the safe `setBool:forKey:`; registering it only
|
||||
//! for the process takes `unsafe`, which this crate forbids) and written again at every start,
|
||||
//! except in a `--memory` session, which writes nothing (issue #164); a run with
|
||||
//! `LIGHTCRAFT_NO_PREFS` still writes it.
|
||||
|
||||
use objc2_foundation::{NSString, NSUserDefaults};
|
||||
|
||||
/// The user defaults that stop AppKit adding a row, each set to `false`.
|
||||
const OFF: &[&str] = &["NSShowFeedbackMenu"];
|
||||
|
||||
/// Writes [`OFF`] into `defaults`.
|
||||
fn switch_off(defaults: &NSUserDefaults) {
|
||||
for key in OFF {
|
||||
defaults.setBool_forKey(false, &NSString::from_str(key));
|
||||
}
|
||||
}
|
||||
|
||||
/// Switches off the rows in [`OFF`] for this app. Call before the menu bar is installed.
|
||||
pub fn install() {
|
||||
switch_off(&NSUserDefaults::standardUserDefaults());
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use objc2::AllocAnyThread;
|
||||
|
||||
/// Removes the throwaway domain, also when an assertion fails.
|
||||
struct Domain(objc2::rc::Retained<NSString>, objc2::rc::Retained<NSUserDefaults>);
|
||||
impl Drop for Domain {
|
||||
fn drop(&mut self) {
|
||||
self.1.removePersistentDomainForName(&self.0);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_system_feedback_row_is_switched_off() {
|
||||
// a throwaway domain: the test never touches the real preferences of the app
|
||||
let suite = NSString::from_str(&format!("com.storytold.lightcraft.test.appkit-defaults.{}", std::process::id()));
|
||||
let defaults = NSUserDefaults::initWithSuiteName(NSUserDefaults::alloc(), Some(&suite)).expect("a test domain");
|
||||
let _domain = Domain(suite, defaults.clone());
|
||||
let key = NSString::from_str("NSShowFeedbackMenu");
|
||||
// the row shows while the default is on (AppKit registers `true`, measured); set it so the
|
||||
// test doesn't depend on the developer's own defaults
|
||||
defaults.setBool_forKey(true, &key);
|
||||
assert!(defaults.boolForKey(&key), "the row shows until the default says otherwise");
|
||||
switch_off(&defaults);
|
||||
assert!(!defaults.boolForKey(&key), "AppKit's Send Feedback row is off");
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
mod alloc_release;
|
||||
mod appearance;
|
||||
#[cfg(target_os = "macos")]
|
||||
mod appkit_defaults;
|
||||
#[cfg(test)]
|
||||
mod build_channel;
|
||||
mod build_flavor;
|
||||
@@ -487,6 +489,12 @@ fn main() -> eframe::Result {
|
||||
None => logger.no_file(),
|
||||
}
|
||||
}
|
||||
// before the menu bar exists, after the arguments: AppKit reads these defaults when it builds
|
||||
// its menus, and `--version` / `--help` / a --memory session (issue #164) write nothing
|
||||
#[cfg(target_os = "macos")]
|
||||
if !in_memory {
|
||||
appkit_defaults::install();
|
||||
}
|
||||
// what the arguments name, resolved now: an empty or relative argument never becomes a drive
|
||||
// root, and a whole drive or home folder is not walked (issue #374)
|
||||
let LaunchArgs { files, library: launch_library, notices: launch_notices } = launch_imports(&files);
|
||||
|
||||
@@ -587,7 +587,7 @@ visible menu bar yet: the menu model is only exposed through the control channel
|
||||
| MENU-HELP-TUTORIALS | Tutorials | OOS | 🚫 | | |
|
||||
| MENU-HELP-WHATSNEW | What's new | P2 | ✅ | `cmd:app.whatsNew` | |
|
||||
| MENU-HELP-SHORTCUTS | Keyboard shortcuts | P1 | ✅ | `cmd:app.shortcuts` | |
|
||||
| MENU-HELP-FEEDBACK | Send feedback | P2 | ✅ | `cmd:app.feedback` | opens a new issue on the project's GitHub |
|
||||
| MENU-HELP-FEEDBACK | Send feedback | P2 | ✅ | `cmd:app.feedback`, `apps/lightcraft/src/appkit_defaults.rs` | opens a new issue on the project's GitHub; on macOS it is the only feedback row, as the system's `Send <app> Feedback` row is switched off (not by a `--memory` session, which writes nothing) |
|
||||
| MENU-HELP-LOGFOLDER | Open log folder | P2 | ✅ | `cmd:app.openLogFolder` | an extra (the reference app has no such item): Help ▸ Open Log Folder reveals `logs/lightcraft.log` in the system file manager (Finder, Explorer, or the folder on Linux); off on the web and in `--memory` sessions, which keep no log (issue #260) |
|
||||
| MENU-HELP-SYSINFO | System info | P2 | ✅ | `cmd:app.systemInfo`, `cmd:library.info` | Help ▸ System Info…: version, OS, CPU threads, GPU, memory budget, preview size, library, timings; Copy to Clipboard; one Close button, like About (#782); JSON for agents (`open: false`) |
|
||||
| MENU-CTX-GRID | Photo context menu | P0 | ✅ | `crates/ui-egui/src/panels/grid.rs` (`context_menu`) | rate, flag, label, add to / remove from album, rename, virtual copy, version, stack, copy / paste / paste selected, reset, merge, rotate, show in Finder, export / export with preset, set as album cover (in an album), delete (restore / delete permanently in Recently Deleted) |
|
||||
@@ -1095,3 +1095,4 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove
|
||||
| 2026-10-17 | minor | LR-PREF-INTERFACE: grid badges set to Stars on hover (the default, formerly "When rated or hovered") keep flags and colour labels on every tile but show the stars and the edited mark only on the hovered or selected photo (before, any rated photo wore the whole badge bar); Always / Never unchanged; status unchanged (✅) |
|
||||
| 2026-10-23 | patch | LR-BEHAV-MULTISELECT: `album.delete` and `album.move` take `ids`, `keyword.delete` and `keyword.move` take `keywords`, `library.removeFolder` and `folder.label` take `paths`, each as one undo step that checks everything before it changes anything (engine only; the sidebar's Cmd/Shift-click rows are the caller to come); downgraded ✅ → 🟡 until they exist |
|
||||
| 2026-10-17 | minor | LR-BEHAV-DRAGDROP: Esc gives up a photo drag (and only the drag); album rows say how many photos a drop adds or that they are there already (a no-op drop changes nothing); smart albums, album folders and the sidebar's Keywords rows refuse photos with the not-allowed cursor and a reason; the Keyword List says how many photos get a keyword and refuses a keyword dropped inside itself; LR-LIB-ALBUM and LRC-LIB-KEYWORDS text updated; status unchanged (✅) |
|
||||
| 2026-10-27 | patch | MENU-HELP-FEEDBACK: on macOS the Help menu no longer shows the system's `Send <app> Feedback` row beside Send Feedback… |
|
||||
+31
-33
@@ -308,6 +308,12 @@
|
||||
selected Object mask, and a click on the selected mask's own pin adds nothing. Subject, Sky, Background and the
|
||||
range masks still have no pin.
|
||||
|
||||
### A dialog no longer dims the macOS title bar
|
||||
- On macOS the top bar is the window's title bar, and the window buttons drawn over it stayed bright while a dialog dimmed
|
||||
the bar under them. As under a macOS sheet, the dialog's backdrop now leaves the bar alone: its buttons are inactive, a
|
||||
click on it does not close the dialog, and dragging its empty space still moves the window. Windows, Linux and full
|
||||
screen are unchanged.
|
||||
|
||||
## 2026-10-28
|
||||
|
||||
### The empty photo grid names Import Photos' shortcut as it is bound
|
||||
@@ -330,9 +336,34 @@
|
||||
`folder.rename` and `folder.move` commands now refuse the home folder and its Pictures, Desktop and Downloads too,
|
||||
so a script or an agent can't do it either.
|
||||
|
||||
### The window's parts are named for screen readers
|
||||
- The top bar, the tool strip and the bottom bar are now announced as toolbars (Top bar, Tool strip, Bottom bar), and the
|
||||
sidebar (Library), the photos, the Tools panel (or Presets) and the filmstrip as landmarks, so a screen reader can list
|
||||
them and jump to one instead of walking every control. Nothing on screen changes. Not yet tried with a real VoiceOver session.
|
||||
|
||||
### Dialogs are exposed to screen readers as dialogs
|
||||
- Export, Settings and the other dialogs, the library chooser and the prompts that stop the window (the quit question, a
|
||||
library that could not be opened, a settings file problem) are now exposed to screen readers as dialogs: modal ones, so the
|
||||
rest of the window is marked as blocked while one is open, and an alert dialog for the prompts. The answer to Check for
|
||||
Updates is a dialog too, but not a modal one. Before, each was a plain group that only carried the dialog's title.
|
||||
- An alert dialog also carries what it says as its description: a screen reader can read the library problem's path, error and
|
||||
explanation, or a prompt's text, together with the dialog.
|
||||
|
||||
### Screen readers no longer read the shortcut with every button name
|
||||
- Icon-only buttons (the tool strip, the view buttons and Before/After and Filmstrip in the bottom bar, the top bar's
|
||||
Import Photos…, the mask overlay and White Balance Selector buttons, the slideshow controls) are now announced by
|
||||
their label alone ("Edit", "Presets", "Photo Grid"), and the shortcut is the button's description ("E", "Shift+P",
|
||||
"G"), which VoiceOver reads after a pause or on request. Before, it read "Edit (E)" every time it landed on the
|
||||
button. This holds in every language, including Japanese and Traditional Chinese, which write the shortcut in
|
||||
full-width brackets. The tooltip you see on hover is unchanged.
|
||||
|
||||
## 2026-10-27
|
||||
|
||||
### One feedback row in the macOS Help menu
|
||||
- On macOS the Help menu showed macOS's own "Send LightCraft Feedback" row above LightCraft's Send Feedback…. Only
|
||||
LightCraft's row is left; it opens a new issue on the project's GitHub. (A `--memory` session doesn't change that
|
||||
setting, so on a Mac where LightCraft only ever ran that way macOS's row stays.)
|
||||
|
||||
### The Edit menu loses its Language submenu
|
||||
- Choose the interface language in Settings ▸ General ▸ Language, which already lists every language. Edit no longer carries 18 more rows for it, on any platform.
|
||||
|
||||
@@ -383,36 +414,6 @@
|
||||
and listed no window. macOS also adds its own window items there: Fill, Center, Move & Resize and Full Screen Tile
|
||||
on macOS 15 and later, and Minimize All, Zoom All and Arrange in Front while Option is held.
|
||||
|
||||
## 2026-10-29
|
||||
|
||||
### A dialog no longer dims the macOS title bar
|
||||
- On macOS the top bar is the window's title bar, and the window buttons drawn over it stayed bright while a dialog dimmed
|
||||
the bar under them. As under a macOS sheet, the dialog's backdrop now leaves the bar alone: its buttons are inactive, a
|
||||
click on it does not close the dialog, and dragging its empty space still moves the window. Windows, Linux and full
|
||||
screen are unchanged.
|
||||
|
||||
## 2026-10-28
|
||||
|
||||
### The window's parts are named for screen readers
|
||||
- The top bar, the tool strip and the bottom bar are now announced as toolbars (Top bar, Tool strip, Bottom bar), and the
|
||||
sidebar (Library), the photos, the Tools panel (or Presets) and the filmstrip as landmarks, so a screen reader can list
|
||||
them and jump to one instead of walking every control. Nothing on screen changes. Not yet tried with a real VoiceOver session.
|
||||
|
||||
### Dialogs are exposed to screen readers as dialogs
|
||||
- Export, Settings and the other dialogs, the library chooser and the prompts that stop the window (the quit question, a
|
||||
library that could not be opened, a settings file problem) are now exposed to screen readers as dialogs: modal ones, so the
|
||||
rest of the window is marked as blocked while one is open, and an alert dialog for the prompts. The answer to Check for
|
||||
Updates is a dialog too, but not a modal one. Before, each was a plain group that only carried the dialog's title.
|
||||
- An alert dialog also carries what it says as its description: a screen reader can read the library problem's path, error and
|
||||
explanation, or a prompt's text, together with the dialog.
|
||||
|
||||
### Screen readers no longer read the shortcut with every button name
|
||||
- Icon-only buttons (the tool strip, the view buttons and Before/After and Filmstrip in the bottom bar, the top bar's
|
||||
Import Photos…, the mask overlay and White Balance Selector buttons, the slideshow controls) are now announced by
|
||||
their label alone ("Edit", "Presets", "Photo Grid"), and the shortcut is the button's description ("E", "Shift+P",
|
||||
"G"), which VoiceOver reads after a pause or on request. Before, it read "Edit (E)" every time it landed on the
|
||||
button. This holds in every language, including Japanese and Traditional Chinese, which write the shortcut in
|
||||
full-width brackets. The tooltip you see on hover is unchanged.
|
||||
|
||||
## 2026-10-26
|
||||
|
||||
@@ -455,8 +456,6 @@
|
||||
real colour (a lens-cap frame pushed 4 EV rendered magenta; it is now black), and cached thumbnails are rendered
|
||||
again. At 100% and in full-size exports white balance still clips each channel before noise reduction (#840).
|
||||
|
||||
## 2026-10-25
|
||||
|
||||
### `>=` and `<=` work in the search box
|
||||
- Fielded search tokens now take inclusive comparisons: `rating:>=3`, `iso:<=400`, `f:>=2.8`, `focal:<=50`. Before,
|
||||
the `=` was read as part of the number, so such a search quietly showed no photos at all.
|
||||
@@ -489,7 +488,6 @@
|
||||
a second. On a Mac the window also holds one drawable less: its width × height × 4 bytes, 15–22 MB for a
|
||||
1200–1500-point-wide window on a Retina display.
|
||||
|
||||
|
||||
## 2026-10-24
|
||||
|
||||
### Reduce motion
|
||||
|
||||
Reference in new issue
Block a user