From ecaa01e122c3a91d602f746278382663c5897fba Mon Sep 17 00:00:00 2001 From: Han Ngo Date: Mon, 16 Nov 2026 04:22:22 +0700 Subject: [PATCH 1/5] fix(presentation): follow the 1.12 capture rule when a camera turns on Presentation mode now lifts once when a camera or microphone turns on, as the main bar does, when the show-the-whole-bar switch is on; the user can hide again at once, and it resumes by itself after capture ends. With the switch off it never pauses. The Settings footnote, the Sensitive apps caption and the paused panel say nothing is hidden while paused, and the arrow note gives a count, not names. --- HiddenBarTests/MenuBarEngineTests.swift | 143 +++++++++++++++--- HiddenBarTests/PresentationStateTests.swift | 57 ++++++- HiddenTests/PresentationViewsTests.swift | 37 +++-- .../PreferencesViewController.swift | 4 +- .../Presentation/PresentationController.swift | 11 +- .../PresentationSensitiveApps.swift | 2 +- .../Presentation/PresentationSnapshot.swift | 2 +- .../Presentation/PresentationState.swift | 53 +++++-- .../Presentation/PresentationViews.swift | 31 ++-- .../Engine/NativeVisibilityEngine.swift | 43 ++++-- hidden/ar.lproj/Localizable.strings | 17 +-- hidden/de.lproj/Localizable.strings | 17 +-- hidden/en.lproj/Localizable.strings | 17 +-- hidden/fr.lproj/Localizable.strings | 17 +-- hidden/hr.lproj/Localizable.strings | 17 +-- hidden/it.lproj/Localizable.strings | 17 +-- hidden/ja.lproj/Localizable.strings | 17 +-- hidden/pl.lproj/Localizable.strings | 17 +-- hidden/tr.lproj/Localizable.strings | 17 +-- hidden/uk.lproj/Localizable.strings | 17 +-- hidden/vi.lproj/Localizable.strings | 17 +-- hidden/zh-Hans.lproj/Localizable.strings | 17 +-- hidden/zh-Hant.lproj/Localizable.strings | 17 +-- 23 files changed, 405 insertions(+), 199 deletions(-) diff --git a/HiddenBarTests/MenuBarEngineTests.swift b/HiddenBarTests/MenuBarEngineTests.swift index dff69c4f..748ae362 100644 --- a/HiddenBarTests/MenuBarEngineTests.swift +++ b/HiddenBarTests/MenuBarEngineTests.swift @@ -2806,8 +2806,8 @@ final class PresentationModeEngineTests: XCTestCase { arrowReadable = true } - // `expandsWhenCaptureStarts` is the 1.11.2 option; presentation mode must lift - // for a camera or microphone whatever it says. + // `expandsWhenCaptureStarts` is the 1.12 option ("show the whole bar when a + // camera or microphone turns on"); presentation mode follows it. private func makeEngine(expandsWhenCaptureStarts: Bool = true) -> NativeVisibilityEngine { let items = self.items! let engine = NativeVisibilityEngine(items: items, inventory: inventory, visibility: visibility, clock: clock, @@ -2986,7 +2986,7 @@ final class PresentationModeEngineTests: XCTestCase { // When a camera turns on // Then the restriction lifts at once and the bar shows func testCaptureStartLiftsTheRestrictionAtOnce() { - let engine = makeEngine(expandsWhenCaptureStarts: false) + let engine = makeEngine() collapsed(engine) engine.startPresentation() let held = visibility.succeed(visibility.requests.count - 1) @@ -3002,7 +3002,7 @@ final class PresentationModeEngineTests: XCTestCase { // When the camera turns off // Then hiding resumes only after the quiet period, with the strict list func testResumesTwoAndAHalfSecondsAfterCaptureEnds() { - let engine = makeEngine(expandsWhenCaptureStarts: false) + let engine = makeEngine() collapsed(engine) engine.startPresentation() visibility.succeed(visibility.requests.count - 1) @@ -3024,7 +3024,7 @@ final class PresentationModeEngineTests: XCTestCase { // When it stops and starts again inside the quiet period // Then the bar does not flap: it stays shown until a full quiet period func testFlappingCaptureNeverHidesEarly() { - let engine = makeEngine(expandsWhenCaptureStarts: false) + let engine = makeEngine() collapsed(engine) engine.startPresentation() visibility.succeed(visibility.requests.count - 1) @@ -3048,7 +3048,7 @@ final class PresentationModeEngineTests: XCTestCase { // Then no strict list is ever requested: it begins paused func testStartWhileCaptureIsActiveNeverHolds() { capture.isActive = true - let engine = makeEngine(expandsWhenCaptureStarts: false) + let engine = makeEngine() let held = collapsed(engine) engine.startPresentation() @@ -3204,28 +3204,137 @@ final class PresentationModeEngineTests: XCTestCase { XCTAssertEqual(phases, [.presenting]) } - // Given the pause for a camera - // When the user (or the auto-hide timer) collapses the bar - // Then no list is held and the bar stays shown, until the pause ends - func testCollapseDuringThePauseStaysLifted() { - let engine = makeEngine(expandsWhenCaptureStarts: false) + // Given the pause for a camera that is still on + // When the user collapses the bar (the normal collapse) + // Then presentation hides again at once, with the strict list, and stays so while capture continues + func testCollapseDuringThePauseHidesAgain() { + let engine = makeEngine() collapsed(engine) engine.startPresentation() visibility.succeed(visibility.requests.count - 1) capture.set(true) + XCTAssertEqual(engine.state, .expanded) let requests = visibility.requests.count var results: [CollapseResult] = [] engine.collapse { results.append($0) } - XCTAssertEqual(visibility.requests.count, requests, "not even the normal list is held") - XCTAssertEqual(engine.state, .expanded) + XCTAssertEqual(visibility.requests.count, requests + 1) + XCTAssertEqual(visibility.requests.last?.bundles, strict) + visibility.succeed(visibility.requests.count - 1) + XCTAssertEqual(results, [.collapsed]) + XCTAssertEqual(engine.state, .collapsed) + XCTAssertEqual(phases, [.presenting, .paused, .presenting]) + + time.advance(to: 60) + XCTAssertEqual(engine.currentPhase(), .presenting, "capture still on: no second pause") + XCTAssertEqual(visibility.requests.count, requests + 1) + } + + // Given a camera that turns on while presenting, the switch on + // When the user presses "Hide again", and capture later ends and starts again + // Then it lifts once, hides on the user's word with capture still on, and a new start lifts again + func testSwitchOnLiftsOnceAndTheUserResumesDuringCapture() { + let engine = makeEngine() + collapsed(engine) + engine.startPresentation() + let held = visibility.succeed(visibility.requests.count - 1) + + capture.set(true) + XCTAssertTrue(held.isInvalidated, "the start lifts once") + XCTAssertEqual(engine.currentPhase(), .paused) XCTAssertNil(engine.currentHold) - XCTAssertEqual(results, [.unavailable]) - XCTAssertEqual(phases, [.presenting, .paused], "a collapse that stays shown is not a failure") + engine.resumePresentationHiding() + XCTAssertEqual(visibility.requests.last?.bundles, strict, "hides again with the camera still on") + visibility.succeed(visibility.requests.count - 1) + XCTAssertEqual(engine.currentPhase(), .presenting) + XCTAssertEqual(engine.state, .collapsed) + XCTAssertEqual(phases, [.presenting, .paused, .presenting]) + + time.advance(to: 30) capture.set(false) - time.advance(to: 2.7) - XCTAssertEqual(visibility.requests.last?.bundles, strict, "resuming hides again") + time.advance(to: 40) + XCTAssertEqual(phases, [.presenting, .paused, .presenting], "capture ending changes nothing after a user resume") + let requests = visibility.requests.count + capture.set(true) + XCTAssertEqual(engine.currentPhase(), .paused, "the next start lifts again") + XCTAssertEqual(visibility.requests.count, requests) + XCTAssertNil(engine.currentHold) + } + + // Given the switch off + // When a camera turns on while presenting, or is already on when the mode starts + // Then nothing is lifted and the strict list stays: presentation never pauses + func testSwitchOffNeverPausesPresentation() { + let engine = makeEngine(expandsWhenCaptureStarts: false) + collapsed(engine) + engine.startPresentation() + let held = visibility.succeed(visibility.requests.count - 1) + + capture.set(true) + XCTAssertFalse(held.isInvalidated) + XCTAssertEqual(engine.state, .collapsed) + XCTAssertEqual(engine.currentHold?.bundles, []) + XCTAssertEqual(phases, [.presenting]) + + engine.stopPresentation() + visibility.succeed(visibility.requests.count - 1) + capture.isActive = true + engine.startPresentation() + XCTAssertEqual(visibility.requests.last?.bundles, strict, "already on at start: still held") + XCTAssertEqual(engine.currentPhase(), .presenting) + } + + // Given a camera already on, the switch on + // When the user presses "Hide again" + // Then the mode that began paused holds the strict list + func testStartedDuringCaptureResumesOnTheUsersWord() { + capture.isActive = true + let engine = makeEngine() + collapsed(engine) + engine.startPresentation() + XCTAssertEqual(engine.currentPhase(), .paused) + XCTAssertFalse(visibility.requests.contains { $0.bundles == strict }) + + engine.resumePresentationHiding() + XCTAssertEqual(visibility.requests.last?.bundles, strict) + visibility.succeed(visibility.requests.count - 1) + XCTAssertEqual(engine.state, .collapsed) + XCTAssertEqual(phases, [.paused, .presenting]) + } + + // Given a presentation, an app the palette allowed, a clock click, then the microphone on and off + // When everything has settled + // Then the hold is the strict list alone: the palette's app went with the lift and does not return + func testPresentingPaletteAllowClockClickAndMicrophoneEndsOnTheStrictList() { + let engine = makeEngine() + collapsed(engine) + engine.startPresentation() + visibility.succeed(visibility.requests.count - 1) + + var lifts: [PaletteLift] = [] + engine.allowTemporarily("com.hidden") { lifts.append($0) } + XCTAssertEqual(visibility.requests.last?.bundles, [own, "com.hidden"]) + visibility.succeed(visibility.requests.count - 1) + XCTAssertEqual(lifts, [.lifted]) + + let requests = visibility.requests.count + clock.click() + XCTAssertEqual(visibility.requests.count, requests, "a clock click does nothing while presenting") + XCTAssertTrue(clock.presses.isEmpty) + + capture.set(true) + XCTAssertNil(engine.currentHold, "the lift for the microphone drops every list") + time.advance(to: 10) + capture.set(false) + time.advance(to: 13) + XCTAssertEqual(visibility.requests.last?.bundles, strict) + visibility.succeed(visibility.requests.count - 1) + + XCTAssertEqual(engine.state, .collapsed) + XCTAssertEqual(engine.currentPhase(), .presenting) + XCTAssertEqual(engine.currentHold, NativeHold(systemItems: NativeVisibilityEngine.presentationSystemItems, bundles: [])) + XCTAssertEqual(phases, [.presenting, .paused, .presenting]) } // Given a presentation and a palette asking to open apps diff --git a/HiddenBarTests/PresentationStateTests.swift b/HiddenBarTests/PresentationStateTests.swift index 9d77e213..e3bbc0d6 100644 --- a/HiddenBarTests/PresentationStateTests.swift +++ b/HiddenBarTests/PresentationStateTests.swift @@ -8,10 +8,13 @@ import XCTest // The pure state machine behind presentation mode: what turned it on, and -// whether the camera or microphone has paused it. No clock, no engine. +// whether the camera or microphone has paused it, by the rule the main bar has +// followed since 1.12 (a start pauses once; the user may hide again). No clock, +// no engine. final class PresentationStateTests: XCTestCase { - private func resolved(_ state: inout PresentationState, capture: Bool = false, at now: TimeInterval = 100) -> PresentationPhase { - return state.resolve(captureActive: capture, now: now) + private func resolved(_ state: inout PresentationState, capture: Bool = false, pauses: Bool = true, + at now: TimeInterval = 100) -> PresentationPhase { + return state.resolve(captureActive: capture, pausesForCapture: pauses, now: now) } // Given a fresh state @@ -163,4 +166,52 @@ final class PresentationStateTests: XCTestCase { state.hideDidFail() XCTAssertEqual(resolved(&state, capture: true, at: 50), .paused) } + + // Given the switch "show the whole bar when a camera or microphone turns on" is off + // When capture starts, or is already running when the mode starts + // Then the mode never pauses, like the main bar + func testSwitchOffNeverPauses() { + var state = PresentationState() + state.startManually() + XCTAssertEqual(resolved(&state, capture: true, pauses: false, at: 5), .presenting, "already active at start") + XCTAssertEqual(resolved(&state, capture: false, pauses: false, at: 6), .presenting) + XCTAssertEqual(resolved(&state, capture: true, pauses: false, at: 7), .presenting, "a start while presenting") + XCTAssertNil(state.resumeWait(now: 7)) + } + + // Given a pause for a camera that is still on + // When the user hides again + // Then the mode presents while capture continues, and only a new start pauses again + func testUserResumeDuringCaptureHoldsUntilTheNextStart() { + var state = PresentationState() + state.startManually() + XCTAssertEqual(resolved(&state, capture: true, at: 10), .paused) + state.resumeHiding() + XCTAssertEqual(resolved(&state, capture: true, at: 11), .presenting) + XCTAssertEqual(resolved(&state, capture: true, at: 600), .presenting, "capture running all day does not pause again") + XCTAssertEqual(resolved(&state, capture: false, at: 700), .presenting, "no quiet period after a user resume") + XCTAssertNil(state.resumeWait(now: 700)) + XCTAssertEqual(resolved(&state, capture: true, at: 800), .paused, "a new start pauses again") + } + + // Given capture already running when the mode starts + // When the user hides again + // Then it presents at once + func testStartedDuringCaptureCanBeResumed() { + var state = PresentationState() + state.startManually() + XCTAssertEqual(resolved(&state, capture: true, at: 5), .paused) + state.resumeHiding() + XCTAssertEqual(resolved(&state, capture: true, at: 6), .presenting) + } + + // Given a pause + // When the switch is turned off + // Then the mode presents + func testTurningTheSwitchOffEndsAPause() { + var state = PresentationState() + state.startManually() + XCTAssertEqual(resolved(&state, capture: true, at: 5), .paused) + XCTAssertEqual(resolved(&state, capture: true, pauses: false, at: 6), .presenting) + } } diff --git a/HiddenTests/PresentationViewsTests.swift b/HiddenTests/PresentationViewsTests.swift index ba9dd2f7..da841ddc 100644 --- a/HiddenTests/PresentationViewsTests.swift +++ b/HiddenTests/PresentationViewsTests.swift @@ -68,10 +68,13 @@ final class PresentationViewsTests: XCTestCase { XCTAssertNotNil(control(UserDefaults.Key.presentationAutoMirrorEnabled, in: all)) XCTAssertNotNil(control(UserDefaults.Key.presentationSensitiveApps, in: all), "the Edit button carries the key") XCTAssertNotNil(control(UserDefaults.Key.presentationShortcut, in: all), "the recorder button carries the key") - let footnote = texts(all).first { $0.hasPrefix("Hiding pauses while the camera or microphone is on") } + let footnote = texts(all).first { $0.hasPrefix("Sensitive apps stay hidden while presenting, except while hiding is paused") } XCTAssertNotNil(footnote) + XCTAssertTrue(footnote?.contains("nothing is hidden") ?? false, "a pause lifts everything, sensitive apps too") XCTAssertFalse(footnote?.localizedCaseInsensitiveContains("light") ?? true, "macOS hides the capsule that names the app, not the dot in the corner") + XCTAssertTrue(texts(all).contains("Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."), + "the Sensitive apps caption carries the same exception") } // Given a build or macOS without native hiding @@ -143,7 +146,7 @@ final class PresentationViewsTests: XCTestCase { let stop = try XCTUnwrap(Self.subviews(of: view).compactMap { $0 as? NSButton }.first { $0.identifier?.rawValue == "presentationStop" }) stop.performClick(nil) XCTAssertEqual(stopped, 1) - XCTAssertTrue(texts(Self.subviews(of: view)).contains("Clock and battery stay.".localized)) + XCTAssertTrue(texts(Self.subviews(of: view)).contains("macOS's own items stay.".localized)) } // Given each way presentation mode starts @@ -158,20 +161,23 @@ final class PresentationViewsTests: XCTestCase { // Given the pause panel // When read - // Then it names the capsule macOS hides, never claims the corner dot is hidden, and OK dismisses + // Then it says nothing is hidden (sensitive apps included), names the capsule macOS hides, + // never claims the corner dot is hidden, and "Hide again" resumes hiding func test_pausedPanel_isHonestAboutTheCapsule() throws { let view = panel(.paused) let all = texts(Self.subviews(of: view)) - let body = try XCTUnwrap(all.first { $0.hasPrefix("macOS 27 hides the capsule") }) + let body = try XCTUnwrap(all.first { $0.hasPrefix("Nothing is hidden right now") }) + XCTAssertTrue(body.contains("sensitive apps included")) XCTAssertTrue(body.contains("capsule that names the app")) XCTAssertFalse(all.contains { $0.localizedCaseInsensitiveContains("privacy light") || $0.localizedCaseInsensitiveContains("camera light") }) XCTAssertTrue(all.contains("Share one window, not the whole screen".localized)) XCTAssertTrue(all.contains("Resumes on its own.".localized)) - var dismissed = 0 - view.onDismiss = { dismissed += 1 } - let ok = try XCTUnwrap(Self.subviews(of: view).compactMap { $0 as? NSButton }.first { $0.identifier?.rawValue == "presentationOK" }) - ok.performClick(nil) - XCTAssertEqual(dismissed, 1) + var hideAgain = 0 + view.onHideAgain = { hideAgain += 1 } + let button = try XCTUnwrap(Self.subviews(of: view).compactMap { $0 as? NSButton }.first { $0.identifier?.rawValue == "presentationHideAgain" }) + XCTAssertEqual(button.title, "Hide again") + button.performClick(nil) + XCTAssertEqual(hideAgain, 1) } // Given more hidden apps than fit @@ -188,10 +194,15 @@ final class PresentationViewsTests: XCTestCase { // MARK: Note, capsule, menu - func test_note_namesAtMostThreeApps() { - XCTAssertEqual(PresentationNoteView.text(["Slack", "1Password", "Tailscale"]), "Slack, 1Password, Tailscale stay hidden") - XCTAssertEqual(PresentationNoteView.text(["Slack"]), "Slack stays hidden") - XCTAssertEqual(PresentationNoteView.text(["A", "B", "C", "D", "E"]), "A, B, C +2 stay hidden") + // Given sensitive apps while presenting + // When the arrow note draws on the shared screen + // Then it gives a count and never a name + func test_note_countsAppsAndNamesNone() { + XCTAssertEqual(PresentationNoteView.text(count: 1), "1 app stays hidden") + XCTAssertEqual(PresentationNoteView.text(count: 2), "2 apps stay hidden") + XCTAssertEqual(PresentationNoteView.text(count: 12), "12 apps stay hidden") + let view = PresentationNoteView(count: 3) + XCTAssertEqual(texts(Self.subviews(of: view)), ["3 apps stay hidden"]) } func test_capsule_readsEachPhase() { diff --git a/hidden/Features/Preferences/PreferencesViewController.swift b/hidden/Features/Preferences/PreferencesViewController.swift index 0024ebba..d73a6aa8 100644 --- a/hidden/Features/Preferences/PreferencesViewController.swift +++ b/hidden/Features/Preferences/PreferencesViewController.swift @@ -170,10 +170,10 @@ class PreferencesViewController: SettingsPaneController { addSection("Presentation mode".localized, rows: [ SettingsForm.row("Turn on automatically".localized, caption: "When a display is mirrored.".localized, control: mirror), SettingsForm.row("Sensitive apps".localized, - caption: "Stay hidden while presenting, even when you click the arrow.".localized, control: sensitive), + caption: "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone.".localized, control: sensitive), SettingsForm.row("Keyboard shortcut".localized, control: recorder), ]) - addFootnote("Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible.".localized) + addFootnote("Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible.".localized) } @objc private func editSensitiveApps(_ sender: NSButton) { diff --git a/hidden/Features/Presentation/PresentationController.swift b/hidden/Features/Presentation/PresentationController.swift index 36ae0888..b9ea6704 100644 --- a/hidden/Features/Presentation/PresentationController.swift +++ b/hidden/Features/Presentation/PresentationController.swift @@ -72,12 +72,12 @@ final class PresentationController { engine.presentationMirrorChanged(Preferences.presentationAutoMirrorEnabled ? mirrors.current() : nil) } - // The bar was expanded while presenting: say which apps stay hidden anyway. + // The bar was expanded while presenting: say how many apps stay hidden anyway. + // Never which: the room sees this note. func barExpanded() { let sensitive = Preferences.presentationSensitiveApps guard engine.currentPhase() == .presenting, !sensitive.isEmpty, let button = arrowButton() else { return } - let names = sensitive.map { chip(for: $0).name }.sorted { $0.localizedCaseInsensitiveCompare($1) == .orderedAscending } - let view = PresentationNoteView(names: names) + let view = PresentationNoteView(count: sensitive.count) let popover = makePopover(view) note?.close() note = popover @@ -134,7 +134,10 @@ final class PresentationController { self?.panel?.close() self?.stop() } - view.onDismiss = { [weak self] in self?.panel?.close() } + view.onHideAgain = { [weak self] in + self?.panel?.close() + self?.engine.resumePresentationHiding() + } panel?.close() let popover = makePopover(view) panel = popover diff --git a/hidden/Features/Presentation/PresentationSensitiveApps.swift b/hidden/Features/Presentation/PresentationSensitiveApps.swift index d11055a3..1a96740a 100644 --- a/hidden/Features/Presentation/PresentationSensitiveApps.swift +++ b/hidden/Features/Presentation/PresentationSensitiveApps.swift @@ -99,7 +99,7 @@ final class PresentationSensitiveAppsEditor: NSViewController { override func loadView() { let title = SettingsForm.sectionTitle("Sensitive apps".localized) - let note = SettingsForm.caption("Choose the apps that stay hidden while presenting, even when you click the arrow.".localized) + let note = SettingsForm.caption("Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone.".localized) note.preferredMaxLayoutWidth = 300 let list = NSStackView() list.orientation = .vertical diff --git a/hidden/Features/Presentation/PresentationSnapshot.swift b/hidden/Features/Presentation/PresentationSnapshot.swift index 99ed9ceb..733d9228 100644 --- a/hidden/Features/Presentation/PresentationSnapshot.swift +++ b/hidden/Features/Presentation/PresentationSnapshot.swift @@ -31,7 +31,7 @@ enum PresentationSnapshot { shoot(size: NSSize(width: 760, height: 150), appearance: appearance, to: dir.appendingPathComponent("direct-present-click-\(mode).png")) { scene in let strip = addMenuBar(to: scene, phase: nil, showsHiddenIcons: true) - let note = PresentationNoteView(names: ["Slack", "1Password", "Tailscale"]) + let note = PresentationNoteView(count: 3) note.frame = NSRect(origin: .zero, size: note.fittingSize) let chrome = PanelChrome(content: note, radius: note.frame.height / 2) chrome.frame.origin = NSPoint(x: strip.arrowFrame.midX - chrome.frame.width / 2, y: 38) diff --git a/hidden/Features/Presentation/PresentationState.swift b/hidden/Features/Presentation/PresentationState.swift index 634053f4..399245ef 100644 --- a/hidden/Features/Presentation/PresentationState.swift +++ b/hidden/Features/Presentation/PresentationState.swift @@ -19,9 +19,11 @@ enum PresentationPhase: Equatable { case off // On and holding the strict list. case presenting - // On, but the restriction is lifted because a camera or microphone is in use - // (or was a moment ago): the restriction also hides the capsule macOS shows - // for the app that records (#437). + // On, but nothing is hidden: a camera or microphone turned on (or was on when + // the mode started), so the restriction is lifted once, as on the main bar + // (1.12). The restriction also hides the capsule macOS shows for the app that + // records (#437). The user can resume hiding; it also resumes by itself when + // capture ends. case paused // On, but macOS refused the strict list, so every icon is showing. case couldNotHide @@ -32,8 +34,9 @@ enum PresentationPhase: Equatable { // timers and reads no clock; the caller passes the time. NativeVisibilityEngine // turns the resulting phase into the one list it holds. struct PresentationState: Equatable { - // The microphone or camera must be quiet this long before hiding resumes, so - // a mic that flaps for a second does not flap the bar. Pausing is immediate. + // The microphone or camera must be quiet this long before hiding resumes by + // itself, so a mic that flaps for a second does not flap the bar. Pausing is + // immediate. static let resumeDelay: TimeInterval = 2.5 private(set) var isManual = false @@ -44,6 +47,8 @@ struct PresentationState: Equatable { // When capture was last seen on, or seen ending: the quiet period starts there. private(set) var lastCaptureAt: TimeInterval? private(set) var captureWasActive = false + // A capture start paused the mode and the user has not resumed hiding since. + private(set) var capturePaused = false private(set) var hideFailed = false var isOn: Bool { @@ -85,27 +90,49 @@ struct PresentationState: Equatable { hideFailed = false } - // Level-triggered: the caller reads the capture state at this moment, every - // time, rather than relying on a stored edge. Capture seen now, or seen - // ending now, keeps the mode paused until it has been quiet for `resumeDelay`. - mutating func resolve(captureActive: Bool, now: TimeInterval) -> PresentationPhase { + // The user chose to hide again while capture continues (the capsule action or + // a collapse). The next capture start pauses again. + mutating func resumeHiding() { + capturePaused = false + hideFailed = false + } + + // The capture rule is the one the main bar follows (1.12): a camera or + // microphone that turns on pauses the mode once, `pausesForCapture` being the + // "show the whole bar when capture starts" switch. Capture already on when the + // mode starts counts as a start. With the switch off nothing ever pauses. + // The caller reads the capture state at this moment, every time; the start is + // seen here as an off-to-on change, and a pause ends when the user resumes or + // when capture has been quiet for `resumeDelay`. + mutating func resolve(captureActive: Bool, pausesForCapture: Bool = true, now: TimeInterval) -> PresentationPhase { guard isOn else { // Nothing is waiting on capture while the mode is off, and a stale - // quiet period must not pause the next start. + // pause must not carry into the next start. lastCaptureAt = nil captureWasActive = false + capturePaused = false return .off } + guard pausesForCapture else { + lastCaptureAt = nil + captureWasActive = captureActive + capturePaused = false + return hideFailed ? .couldNotHide : .presenting + } + if captureActive && !captureWasActive { capturePaused = true } if captureActive || captureWasActive { lastCaptureAt = now } captureWasActive = captureActive - if captureActive { return .paused } - if let last = lastCaptureAt, now < last + Self.resumeDelay { return .paused } + if capturePaused { + if captureActive { return .paused } + if let last = lastCaptureAt, now < last + Self.resumeDelay { return .paused } + capturePaused = false + } return hideFailed ? .couldNotHide : .presenting } // Seconds until a quiet period ends, nil when there is none to wait for. func resumeWait(now: TimeInterval) -> TimeInterval? { - guard isOn, let last = lastCaptureAt, now < last + Self.resumeDelay else { return nil } + guard isOn, capturePaused, let last = lastCaptureAt, now < last + Self.resumeDelay else { return nil } return last + Self.resumeDelay - now } } diff --git a/hidden/Features/Presentation/PresentationViews.swift b/hidden/Features/Presentation/PresentationViews.swift index 0e899b00..e7f22b6c 100644 --- a/hidden/Features/Presentation/PresentationViews.swift +++ b/hidden/Features/Presentation/PresentationViews.swift @@ -209,7 +209,8 @@ final class PresentationPanelView: NSView { private static let inset: CGFloat = 12 var onStop: (() -> Void)? - var onDismiss: (() -> Void)? + /// "Hide again" on the paused panel: hide now, with the camera or microphone still on. + var onHideAgain: (() -> Void)? let model: PresentationPanelModel init(model: PresentationPanelModel) { @@ -306,12 +307,12 @@ final class PresentationPanelView: NSView { stack.setCustomSpacing(8, after: stack.arrangedSubviews.last!) let stop = PresentationButton(title: "Stop Presenting".localized, style: .prominent, target: self, action: #selector(stopPressed)) stop.identifier = NSUserInterfaceItemIdentifier("presentationStop") - stack.addArrangedSubview(footer(note: "Clock and battery stay.".localized, button: stop)) + stack.addArrangedSubview(footer(note: "macOS's own items stay.".localized, button: stop)) } private func buildPaused(in stack: NSStackView) { stack.addArrangedSubview(heading("Hiding paused: camera or microphone in use".localized)) - stack.addArrangedSubview(body("macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again.".localized)) + stack.addArrangedSubview(body("Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on.".localized)) stack.setCustomSpacing(10, after: stack.arrangedSubviews.last!) stack.addArrangedSubview(body("To keep apps out of a shared screen during a call:".localized)) stack.setCustomSpacing(6, after: stack.arrangedSubviews.last!) @@ -322,9 +323,9 @@ final class PresentationPanelView: NSView { stack.setCustomSpacing(10, after: stack.arrangedSubviews.last!) stack.addArrangedSubview(line()) stack.setCustomSpacing(8, after: stack.arrangedSubviews.last!) - let ok = PresentationButton(title: "OK".localized, style: .plain, target: self, action: #selector(dismissPressed)) - ok.identifier = NSUserInterfaceItemIdentifier("presentationOK") - stack.addArrangedSubview(footer(note: "Resumes on its own.".localized, button: ok)) + let again = PresentationButton(title: "Hide again".localized, style: .prominent, target: self, action: #selector(hideAgainPressed)) + again.identifier = NSUserInterfaceItemIdentifier("presentationHideAgain") + stack.addArrangedSubview(footer(note: "Resumes on its own.".localized, button: again)) } private func buildCouldNotHide(in stack: NSStackView) { @@ -379,7 +380,7 @@ final class PresentationPanelView: NSView { } @objc private func stopPressed() { onStop?() } - @objc private func dismissPressed() { onDismiss?() } + @objc private func hideAgainPressed() { onHideAgain?() } } private final class TipTile: NSView { @@ -391,15 +392,15 @@ private final class TipTile: NSView { // MARK: - Note on the arrow click -// "Slack, 1Password, Tailscale stay hidden": shown for a moment under the arrow -// when it is clicked while presenting. +// "2 apps stay hidden": shown for a moment under the arrow when it is clicked +// while presenting. It gives a count and no names, since the room sees it. final class PresentationNoteView: NSView { - init(names: [String]) { + init(count: Int) { super.init(frame: .zero) let lock = NSImageView(image: NSImage(systemSymbolName: "lock", accessibilityDescription: nil) ?? NSImage()) lock.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 11, weight: .regular) lock.contentTintColor = .labelColor - let label = NSTextField(labelWithString: Self.text(names)) + let label = NSTextField(labelWithString: Self.text(count: count)) label.font = .systemFont(ofSize: 12, weight: .medium) let row = NSStackView(views: [lock, label]) row.spacing = 6 @@ -416,11 +417,7 @@ final class PresentationNoteView: NSView { required init?(coder: NSCoder) { fatalError("init(coder:) is not used") } - // At most three names, then "+N". - static func text(_ names: [String]) -> String { - var shown = Array(names.prefix(3)).joined(separator: ", ") - if names.count > 3 { shown += " +\(names.count - 3)" } - return names.count == 1 ? String(format: "%@ stays hidden".localized, shown) - : String(format: "%@ stay hidden".localized, shown) + static func text(count: Int) -> String { + return count == 1 ? "1 app stays hidden".localized : String(format: "%d apps stay hidden".localized, count) } } diff --git a/hidden/Features/StatusBar/Engine/NativeVisibilityEngine.swift b/hidden/Features/StatusBar/Engine/NativeVisibilityEngine.swift index d866c8e7..ee2886bc 100644 --- a/hidden/Features/StatusBar/Engine/NativeVisibilityEngine.swift +++ b/hidden/Features/StatusBar/Engine/NativeVisibilityEngine.swift @@ -52,9 +52,11 @@ import AppKit // restriction: every app hidden, or the hidden section shown minus the // sensitive apps. Every change to what is held goes through `hold(whenBar:)` // and `reconcileHold()`, so no event (an app launch, a clock click, a capture -// change) can swap the strict list back to the normal one. It lifts while a -// microphone or camera is on, since the restriction hides the capsule naming -// the app that records, and it lifts when the app quits (PresentationState). +// change) can swap the strict list back to the normal one. The restriction +// hides the capsule naming the app that records, so presentation follows the +// main bar's rule: it lifts once when a microphone or camera turns on (or is +// on when the mode starts), if that switch is on, and the user may hide again +// at once. It lifts when the app quits (PresentationState). // - macOS matches the allow-list only to apps it knows by bundle id, which // (measured on 27.2) it does for an app in an Applications folder but not for // one run from elsewhere (Downloads, a build folder): it hides that app's @@ -235,12 +237,12 @@ final class NativeVisibilityEngine: MenuBarEngine { case .expanded, .unavailable: break } - // A collapse during the camera or microphone pause (the user's, or the - // auto-hide timer's) stays lifted: holding the normal list now would only - // be undone, and would flash the capsule away. Resuming collapses again. + // A collapse during the camera or microphone pause is the user choosing to + // hide again (as on the main bar, where a collapse during capture hides as + // usual): presentation mode resumes and the collapse holds the strict list. if presentation.isOn, currentPhase() == .paused { - NSLog("NativeVisibility: a collapse while presentation mode is paused; staying shown") - return completion(.unavailable) + NSLog("NativeVisibility: a collapse while presentation mode is paused; hiding again") + resumePresentationHiding(collapsing: false) } if !hidesAlwaysHiddenSection { setSeparatorsVisible(true) @@ -905,6 +907,22 @@ final class NativeVisibilityEngine: MenuBarEngine { presentationInputsChanged() } + // "Hide again" on the paused capsule: the camera or microphone is still on and + // the user wants the list held anyway. A later capture start pauses again. + func resumePresentationHiding() { + guard presentation.isOn, currentPhase() == .paused else { return } + resumePresentationHiding(collapsing: true) + } + + private func resumePresentationHiding(collapsing: Bool) { + presentation.resumeHiding() + if collapsing { + presentationInputsChanged() + } else { + notePhaseChange() + } + } + func presentationMirrorChanged(_ mirror: PresentationMirror?) { guard mirror != presentation.mirror else { return } presentation.mirrorChanged(mirror) @@ -922,7 +940,10 @@ final class NativeVisibilityEngine: MenuBarEngine { // The phase, with the capture level read at this moment. func currentPhase() -> PresentationPhase { // Off is the common case: read the monitor only while a mode is on. - return presentation.resolve(captureActive: presentation.isOn && captureActivity.isActive, now: clockNow()) + // The pause follows the same switch as the main bar (1.12): "show the whole + // bar when a camera or microphone turns on". Off, it never pauses. + return presentation.resolve(captureActive: presentation.isOn && captureActivity.isActive, + pausesForCapture: expandsWhenCaptureStarts(), now: clockNow()) } // Presenting and still trying to hide (also after a refusal, so the next @@ -970,8 +991,8 @@ final class NativeVisibilityEngine: MenuBarEngine { } } - // A microphone or camera is on: the restriction hides the capsule naming the - // app that uses it, so it is lifted whatever the Preferences option says. + // A microphone or camera turned on: the restriction hides the capsule naming + // the app that uses it, so it is lifted once. private func liftForCapture() { NSLog("NativeVisibility: presentation mode paused: a microphone or camera is on; showing the whole menu bar") if state == .collapsed { diff --git a/hidden/ar.lproj/Localizable.strings b/hidden/ar.lproj/Localizable.strings index f4840eae..2c626093 100644 --- a/hidden/ar.lproj/Localizable.strings +++ b/hidden/ar.lproj/Localizable.strings @@ -220,9 +220,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -230,21 +230,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/de.lproj/Localizable.strings b/hidden/de.lproj/Localizable.strings index 1600f422..01488a42 100644 --- a/hidden/de.lproj/Localizable.strings +++ b/hidden/de.lproj/Localizable.strings @@ -219,9 +219,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -229,21 +229,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/en.lproj/Localizable.strings b/hidden/en.lproj/Localizable.strings index 8512cb0e..3faa1f8b 100644 --- a/hidden/en.lproj/Localizable.strings +++ b/hidden/en.lproj/Localizable.strings @@ -256,30 +256,29 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; "Quit sensitive apps before the call" = "Quit sensitive apps before the call"; "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/fr.lproj/Localizable.strings b/hidden/fr.lproj/Localizable.strings index 1e9905ee..ebdfb000 100644 --- a/hidden/fr.lproj/Localizable.strings +++ b/hidden/fr.lproj/Localizable.strings @@ -221,9 +221,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -231,21 +231,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/hr.lproj/Localizable.strings b/hidden/hr.lproj/Localizable.strings index 18560575..a30c91ae 100644 --- a/hidden/hr.lproj/Localizable.strings +++ b/hidden/hr.lproj/Localizable.strings @@ -219,9 +219,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -229,21 +229,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/it.lproj/Localizable.strings b/hidden/it.lproj/Localizable.strings index 91c24911..4f158c81 100644 --- a/hidden/it.lproj/Localizable.strings +++ b/hidden/it.lproj/Localizable.strings @@ -221,9 +221,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -231,21 +231,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/ja.lproj/Localizable.strings b/hidden/ja.lproj/Localizable.strings index e65fcdd0..438a34f1 100644 --- a/hidden/ja.lproj/Localizable.strings +++ b/hidden/ja.lproj/Localizable.strings @@ -218,9 +218,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -228,21 +228,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/pl.lproj/Localizable.strings b/hidden/pl.lproj/Localizable.strings index 048803cf..b6043b5b 100644 --- a/hidden/pl.lproj/Localizable.strings +++ b/hidden/pl.lproj/Localizable.strings @@ -219,9 +219,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -229,21 +229,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/tr.lproj/Localizable.strings b/hidden/tr.lproj/Localizable.strings index b3b896ea..71888da6 100644 --- a/hidden/tr.lproj/Localizable.strings +++ b/hidden/tr.lproj/Localizable.strings @@ -220,9 +220,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -230,21 +230,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/uk.lproj/Localizable.strings b/hidden/uk.lproj/Localizable.strings index 447f9c5e..86b1e5fe 100644 --- a/hidden/uk.lproj/Localizable.strings +++ b/hidden/uk.lproj/Localizable.strings @@ -219,9 +219,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -229,21 +229,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/vi.lproj/Localizable.strings b/hidden/vi.lproj/Localizable.strings index fd4c5d41..532e5817 100644 --- a/hidden/vi.lproj/Localizable.strings +++ b/hidden/vi.lproj/Localizable.strings @@ -219,9 +219,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -229,21 +229,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/zh-Hans.lproj/Localizable.strings b/hidden/zh-Hans.lproj/Localizable.strings index fbe6a433..cd4b04b0 100644 --- a/hidden/zh-Hans.lproj/Localizable.strings +++ b/hidden/zh-Hans.lproj/Localizable.strings @@ -221,9 +221,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -231,21 +231,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; diff --git a/hidden/zh-Hant.lproj/Localizable.strings b/hidden/zh-Hant.lproj/Localizable.strings index 0dc6a713..fa0fad0c 100644 --- a/hidden/zh-Hant.lproj/Localizable.strings +++ b/hidden/zh-Hant.lproj/Localizable.strings @@ -227,9 +227,9 @@ Steps to view always hidden icons: "Hidden now: %d apps" = "Hidden now: %d apps"; "Stay hidden even if you click the arrow" = "Stay hidden even if you click the arrow"; "Stop Presenting" = "Stop Presenting"; -"Clock and battery stay." = "Clock and battery stay."; +"macOS's own items stay." = "macOS's own items stay."; "Hiding paused: camera or microphone in use" = "Hiding paused: camera or microphone in use"; -"macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again." = "macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, and that capsule must stay visible. So Hidden Bar shows every icon until the camera and microphone are off, then hides again."; +"Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on." = "Nothing is hidden right now, sensitive apps included. macOS 27 hides the capsule that names the app using your camera or microphone along with other icons, so Hidden Bar shows every icon when one turns on."; "To keep apps out of a shared screen during a call:" = "To keep apps out of a shared screen during a call:"; "Share one window, not the whole screen" = "Share one window, not the whole screen"; "The menu bar is not in the picture." = "The menu bar is not in the picture."; @@ -237,21 +237,20 @@ Steps to view always hidden icons: "Hidden Bar will not quit apps for you." = "Hidden Bar will not quit apps for you."; "OK" = "OK"; "Resumes on its own." = "Resumes on its own."; +"Hide again" = "Hide again"; "Hidden Bar could not hide your icons" = "Hidden Bar could not hide your icons"; "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first." = "macOS did not accept the request, so every icon is showing. Stop presentation mode and start it again, or quit the sensitive apps first."; -"%@ stays hidden" = "%@ stays hidden"; -"%@ stay hidden" = "%@ stay hidden"; +"1 app stays hidden" = "1 app stays hidden"; +"%d apps stay hidden" = "%d apps stay hidden"; "Stop Presentation Mode" = "Stop Presentation Mode"; "Start Presentation Mode" = "Start Presentation Mode"; "Presentation mode" = "Presentation mode"; "Turn on automatically" = "Turn on automatically"; "When a display is mirrored." = "When a display is mirrored."; "Sensitive apps" = "Sensitive apps"; -"Stay hidden while presenting, even when you click the arrow." = "Stay hidden while presenting, even when you click the arrow."; -"Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible." = "Hiding pauses while the camera or microphone is on, so the capsule that names the app using them stays visible."; +"Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; +"Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible." = "Sensitive apps stay hidden while presenting, except while hiding is paused for the camera or microphone. Then nothing is hidden, so the capsule that names the app using them stays visible."; "Edit..." = "Edit..."; "None" = "None"; -"Choose the apps that stay hidden while presenting, even when you click the arrow." = "Choose the apps that stay hidden while presenting, even when you click the arrow."; +"Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone." = "Choose the apps that stay hidden while presenting, even when you click the arrow, except while hiding is paused for the camera or microphone."; "Apps with a menu bar icon appear here once Hidden Bar has seen them." = "Apps with a menu bar icon appear here once Hidden Bar has seen them."; -"%@ stays hidden while presenting" = "%@ stays hidden while presenting"; -"Presentation mode keeps it out of view. Stop presenting to open it." = "Presentation mode keeps it out of view. Stop presenting to open it."; From aaded951a2590f095d7b85ccd272f38bb869725f Mon Sep 17 00:00:00 2001 From: Han Ngo Date: Mon, 16 Nov 2026 04:22:39 +0700 Subject: [PATCH 2/5] fix(presentation): quiet reveal, arrivals and palette while presenting Reveal gestures do nothing, the arrivals question waits, and the palette leaves sensitive apps out of its list. The palette offers the move keys only while pinned sections are on. --- HiddenBarTests/PaletteModelTests.swift | 24 ++++++---- HiddenBarTests/RevealControllerTests.swift | 26 ++++++++++ HiddenTests/ArrivalsControllerTests.swift | 22 +++++++++ HiddenTests/PalettePanelTests.swift | 47 ++++++++++++++++++- .../Features/Arrivals/ArrivalsPresenter.swift | 19 ++++++-- .../Features/Palette/PaletteContentView.swift | 20 ++++---- .../Features/Palette/PaletteController.swift | 8 +++- hidden/Features/Palette/PaletteModel.swift | 31 +++++------- hidden/Features/Palette/PaletteSnapshot.swift | 11 +++-- hidden/Features/Reveal/RevealController.swift | 11 +++-- .../StatusBar/StatusBarController.swift | 20 ++++++-- 11 files changed, 184 insertions(+), 55 deletions(-) diff --git a/HiddenBarTests/PaletteModelTests.swift b/HiddenBarTests/PaletteModelTests.swift index 15c43c69..d123668a 100644 --- a/HiddenBarTests/PaletteModelTests.swift +++ b/HiddenBarTests/PaletteModelTests.swift @@ -107,15 +107,21 @@ final class PaletteModelTests: XCTestCase { XCTAssertEqual(state.rows.map(\.candidate.name), ["Dropbox"]) } - // Given Return found an app that presentation mode keeps hidden - // When the palette shows it - // Then the sensitive state names the app, until the query changes - func test_sensitiveWhilePresenting_clearsOnTheNextKeystroke() { - var state = model([app("Slack")], query: "sla") - state.showSensitive(appName: "Slack") - XCTAssertEqual(state.content, .sensitiveWhilePresenting(appName: "Slack")) - state.setQuery("slac") - XCTAssertEqual(state.rows.map(\.candidate.name), ["Slack"]) + // Given presentation mode keeps two apps hidden + // When the list is built, and the query names one of them + // Then they are not listed and no hint names them, whichever section they sit in + func test_sensitiveAppsLeaveTheListWhilePresenting() { + let environment = PaletteEnvironment(accessibilityTrusted: true, engineAvailable: true, + hiddenWhilePresenting: ["com.test.slack", "com.test.bear", "com.test.dropbox"]) + let apps = [app("Slack"), app("Paste"), app("Bear", .visible), app("Dropbox", .alwaysHidden, running: false)] + XCTAssertEqual(model(apps, environment: environment).rows.map(\.candidate.name), ["Paste"]) + XCTAssertEqual(model(apps, query: "sla", environment: environment).content, + .noMatch(query: "sla", shownApp: nil, quitApp: nil)) + XCTAssertEqual(model(apps, query: "bear", environment: environment).content, + .noMatch(query: "bear", shownApp: nil, quitApp: nil), "a shown sensitive app is not named either") + XCTAssertEqual(model(apps, query: "drop", environment: environment).content, + .noMatch(query: "drop", shownApp: nil, quitApp: nil), "nor a quit one") + XCTAssertEqual(model(apps, query: "sla").rows.map(\.candidate.name), ["Slack"], "off presentation they list as before") } // MARK: results and selection diff --git a/HiddenBarTests/RevealControllerTests.swift b/HiddenBarTests/RevealControllerTests.swift index db5a2bd7..a5024461 100644 --- a/HiddenBarTests/RevealControllerTests.swift +++ b/HiddenBarTests/RevealControllerTests.swift @@ -34,6 +34,7 @@ final class RevealControllerTests: XCTestCase { var ownMenuOpen = false var enabled: Set = [] var shown = 0, hidden = 0, hiddenOffBar = 0 + var presenting = false var canHitTest = true var hitTarget = HitTarget.emptySpace var hitTests = 0 @@ -52,6 +53,7 @@ final class RevealControllerTests: XCTestCase { hide: { [unowned self] in self.hidden += 1; self.collapsed = true }, hideOffMenuBar: { [unowned self] in self.hiddenOffBar += 1; self.collapsed = true }), isEnabled: { [unowned self] in self.enabled.contains($0) }, + isSuspended: { [unowned self] in self.presenting }, screens: { [unowned self] in self.screens }, monitoring: monitoring, canHitTest: { [unowned self] in self.canHitTest }, @@ -256,6 +258,30 @@ final class RevealControllerTests: XCTestCase { XCTAssertEqual(world.shown, 0) } + // MARK: presentation mode + + // Given every gesture on, and presentation mode on + // When each gesture fires (scroll down, scroll up, an empty click, a shake) + // Then nothing shows or hides and nothing is counted; with the mode off they work again + func test_gesturesDoNothingWhilePresenting() { + world.enabled = [.scroll, .click, .shake] + world.presenting = true + scrollDown() + controller.ingestMouseDown(at: world.barPoint) + shake() + world.collapsed = false + controller.ingestScroll(deltaY: 20, time: 200, isMomentum: false, at: world.barPoint) + XCTAssertEqual(world.shown, 0) + XCTAssertEqual(world.hidden, 0) + XCTAssertTrue(controller.triggerCounts.isEmpty) + XCTAssertFalse(controller.revealedByGesture) + + world.presenting = false + world.collapsed = true + controller.ingestMouseDown(at: world.barPoint) + XCTAssertEqual(world.shown, 1) + } + // MARK: hide again // Given icons revealed by a gesture diff --git a/HiddenTests/ArrivalsControllerTests.swift b/HiddenTests/ArrivalsControllerTests.swift index 89379c68..aa7e1afe 100644 --- a/HiddenTests/ArrivalsControllerTests.swift +++ b/HiddenTests/ArrivalsControllerTests.swift @@ -134,6 +134,28 @@ final class ArrivalsControllerTests: XCTestCase { XCTAssertEqual(changes, 1) } + // Given a waiting question and presentation mode on + // When the presenter is asked to open from the arrow + // Then no popover opens (the room sees the screen); the question is still waiting, and opens once the mode ends + func test_arrivalsPrompt_waitsWhilePresenting() { + let controller = seededController() + read(["com.test.old", "com.test.new"]) + var presenting = true + var shown = 0 + let presenter = ArrivalsPresenter(controller: controller, isSuppressed: { presenting }, + showPopover: { _, _ in shown += 1 }, openSettings: {}) + let button = NSStatusBarButton(frame: NSRect(x: 0, y: 0, width: 20, height: 20)) + + presenter.present(from: button) + XCTAssertEqual(shown, 0) + XCTAssertEqual(controller.pending, ["com.test.new"], "the question waits") + + presenting = false + presenter.present(from: button) + XCTAssertEqual(shown, 1) + presenter.close() + } + // Given a waiting app, when the answer is Hide // Then the table says hidden, the entry is cleared in memory and on disk, and the arrow is told func test_answer_writesTheSectionAndClearsTheEntry() { diff --git a/HiddenTests/PalettePanelTests.swift b/HiddenTests/PalettePanelTests.swift index 4167179e..91bc3358 100644 --- a/HiddenTests/PalettePanelTests.swift +++ b/HiddenTests/PalettePanelTests.swift @@ -128,6 +128,51 @@ final class PalettePanelTests: XCTestCase { for hint in ["Open its menu", "Keep shown", "Always hide", "Close"] { XCTAssertTrue(texts.contains(hint), hint) } } + // Given the pinned-sections beta is off (a move would write a table nothing reads) + // When the list shows, and Command-Return or Option-Return is pressed + // Then only the open and close hints show, and neither key moves anything + func test_pinnedSectionsOff_hidesTheMoveHintsAndKeys() { + fake.environment.pinsSections = false + palette.show() + palette.setQuery("pa") + XCTAssertTrue(texts.contains("Open its menu") && texts.contains("Close")) + XCTAssertFalse(texts.contains("Keep shown")) + XCTAssertFalse(texts.contains("Always hide")) + + palette.perform(.keepShown) + palette.perform(.alwaysHide) + XCTAssertEqual(fake.moves, []) + XCTAssertTrue(palette.isVisible, "a refused key leaves the palette open") + } + + // Given presentation mode is on with Paste and Amphetamine sensitive + // When the palette opens, and a query names a sensitive app + // Then they are not listed, and no hint names them + func test_sensitiveAppsAreLeftOutOfTheListWhilePresenting() { + fake.environment.hiddenWhilePresenting = ["com.paste", "com.amphetamine"] + palette.show() + XCTAssertTrue(texts.contains("1Password")) + XCTAssertFalse(texts.contains("Paste")) + XCTAssertFalse(texts.contains("Amphetamine")) + palette.setQuery("paste") + let rows = palette.debugState["rows"] as? [String] ?? [] + XCTAssertFalse(rows.contains("com.paste") || rows.contains("com.amphetamine")) + XCTAssertFalse(texts.contains { $0.contains("Paste") }) + } + + // Given a list that still shows an app presentation mode then keeps hidden + // When Return reaches the engine and it refuses as sensitive + // Then the app drops out of the list and nothing names it + func test_aSensitiveRefusalDropsTheAppWithoutNamingIt() { + palette.show() + palette.setQuery("pa") + palette.perform(.open) + fake.environment.hiddenWhilePresenting = ["com.paste"] + fake.finish?(.sensitive) + XCTAssertFalse(texts.contains { $0.contains("Paste") }) + XCTAssertFalse(texts.contains { $0.contains("stays hidden") }) + } + // MARK: Return, Command-Return, Option-Return // Given "pa" typed @@ -318,7 +363,7 @@ final class PalettePanelTests: XCTestCase { XCTAssertTrue(written.contains("direct-palette-settings-\(mode).png")) } XCTAssertEqual(Set(PaletteSnapshot.scenes.map(\.name)), - ["results", "all", "opening", "nomatch", "nothinghidden", "accessibilityoff", "macositem", "appquit", "cannotopen", "sensitive", "enginedown"]) + ["results", "all", "opening", "nomatch", "nothinghidden", "accessibilityoff", "macositem", "appquit", "cannotopen", "presenting", "nopins", "enginedown"]) } } #endif diff --git a/hidden/Features/Arrivals/ArrivalsPresenter.swift b/hidden/Features/Arrivals/ArrivalsPresenter.swift index 8040a308..b390bffd 100644 --- a/hidden/Features/Arrivals/ArrivalsPresenter.swift +++ b/hidden/Features/Arrivals/ArrivalsPresenter.swift @@ -39,16 +39,27 @@ final class ArrivalsArrowDot: NSView { // Asks from the arrow: a popover under it with one row per waiting app. It opens // when the user clicks the arrow while something waits (the click that shows the // hidden icons), and it stays until it is answered or clicked away; the dot on -// the arrow stays while anything waits. +// the arrow stays while anything waits. While presentation mode is on it does not +// open at all: the question names apps, and the room sees the screen. It waits +// for the first arrow click after the mode ends. final class ArrivalsPresenter: NSObject, NSPopoverDelegate { private let controller: ArrivalsController private let openSettings: () -> Void + private let isSuppressed: () -> Bool + private let showPopover: (NSPopover, NSStatusBarButton) -> Void private var popover: NSPopover? private var promptView: ArrivalsPromptView? private var observer: NSObjectProtocol? - init(controller: ArrivalsController = .shared, openSettings: @escaping () -> Void) { + init(controller: ArrivalsController = .shared, + isSuppressed: @escaping () -> Bool = { false }, + showPopover: @escaping (NSPopover, NSStatusBarButton) -> Void = { popover, button in + popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY) + }, + openSettings: @escaping () -> Void) { self.controller = controller + self.isSuppressed = isSuppressed + self.showPopover = showPopover self.openSettings = openSettings super.init() observer = NotificationCenter.default.addObserver(forName: .arrivalsChanged, object: nil, queue: .main) { [weak self] _ in @@ -64,7 +75,7 @@ final class ArrivalsPresenter: NSObject, NSPopoverDelegate { var isShown: Bool { popover?.isShown ?? false } func present(from button: NSStatusBarButton?) { - guard let button, !isShown, !controller.pending.isEmpty else { return } + guard let button, !isShown, !isSuppressed(), !controller.pending.isEmpty else { return } controller.refresh() guard !controller.pending.isEmpty else { return } let view = makeView() @@ -77,7 +88,7 @@ final class ArrivalsPresenter: NSObject, NSPopoverDelegate { popover.delegate = self self.popover = popover promptView = view - popover.show(relativeTo: button.bounds, of: button, preferredEdge: .minY) + showPopover(popover, button) } func close() { diff --git a/hidden/Features/Palette/PaletteContentView.swift b/hidden/Features/Palette/PaletteContentView.swift index 81e3c2a8..b13f521f 100644 --- a/hidden/Features/Palette/PaletteContentView.swift +++ b/hidden/Features/Palette/PaletteContentView.swift @@ -15,6 +15,8 @@ struct PaletteViewState: Equatable { var content: PaletteContent var selectedIndex: Int var openingBundle: String? + /// False hides the two hints that move an app between sections. + var pinsSections = true } /// The buttons an edge state offers. @@ -166,7 +168,7 @@ final class PaletteContentView: NSView, NSTextFieldDelegate { case .results(let items): views.append(resultsView(items, state: state, icon: icon)) views.append(Self.divider()) - views.append(keyHints()) + views.append(keyHints(pinsSections: state.pinsSections)) case .noMatch(let query, let shownApp, let quitApp): let detail: String if let shownApp { @@ -193,10 +195,6 @@ final class PaletteContentView: NSView, NSTextFieldDelegate { views.append(emptyState(title: "Hidden Bar is not hiding icons right now".localized, detail: "Every icon is already in the menu bar, so there is nothing to find. Open Settings to see why.".localized, badge: "exclamationmark.triangle.fill")) - case .sensitiveWhilePresenting(let appName): - views.append(emptyState(title: String(format: "%@ stays hidden while presenting".localized, appName), - detail: "Presentation mode keeps it out of view. Stop presenting to open it.".localized, - badge: "lock.fill")) case .cannotOpen(let appName): views.append(emptyState(title: String(format: "%@ can't be opened from here".localized, appName), detail: "Its icon does not answer Accessibility. Click the arrow to show everything, then click its icon.".localized, @@ -344,10 +342,12 @@ final class PaletteContentView: NSView, NSTextFieldDelegate { // MARK: Key hints // The board wraps the four hints; at this width the last one takes a second line. - private func keyHints() -> NSView { - let hints: [([String], String)] = [ - (["↵"], "Open its menu"), (["⌘", "↵"], "Keep shown"), (["⌥", "↵"], "Always hide"), (["esc"], "Close"), - ] + private func keyHints(pinsSections: Bool) -> NSView { + // Without the pinned-sections beta the two move keys do nothing, so they + // are not offered. + let hints: [([String], String)] = pinsSections + ? [(["↵"], "Open its menu"), (["⌘", "↵"], "Keep shown"), (["⌥", "↵"], "Always hide"), (["esc"], "Close")] + : [(["↵"], "Open its menu"), (["esc"], "Close")] func line(_ items: ArraySlice<([String], String)>) -> NSStackView { let row = NSStackView() row.orientation = .horizontal @@ -370,7 +370,7 @@ final class PaletteContentView: NSView, NSTextFieldDelegate { row.addArrangedSubview(spacer) return row } - let lines = NSStackView(views: [line(hints[0..<3]), line(hints[3...])]) + let lines = NSStackView(views: pinsSections ? [line(hints[0..<3]), line(hints[3...])] : [line(hints[...])]) lines.orientation = .vertical lines.alignment = .width lines.spacing = 4 diff --git a/hidden/Features/Palette/PaletteController.swift b/hidden/Features/Palette/PaletteController.swift index c99ef243..82a839de 100644 --- a/hidden/Features/Palette/PaletteController.swift +++ b/hidden/Features/Palette/PaletteController.swift @@ -202,8 +202,10 @@ final class PaletteController { case .open: open() case .keepShown: + guard host.environment().pinsSections else { return } move(to: .visible) case .alwaysHide: + guard host.environment().pinsSections else { return } move(to: .alwaysHidden) } } @@ -232,7 +234,9 @@ final class PaletteController { model.showCannotOpen(appName: app.name) render() case .sensitive: - model.showSensitive(appName: app.name) + // Presentation mode started (or the sensitive set changed) while the + // list was open: drop the app from it without naming it. + model.update(candidates: model.candidates, environment: host.environment()) render() case .unavailable: var environment = host.environment() @@ -246,7 +250,7 @@ final class PaletteController { private var viewState: PaletteViewState { return PaletteViewState(query: model.query, content: model.content, selectedIndex: model.selectedIndex, - openingBundle: openingBundle) + openingBundle: openingBundle, pinsSections: model.environment.pinsSections) } private func render() { diff --git a/hidden/Features/Palette/PaletteModel.swift b/hidden/Features/Palette/PaletteModel.swift index 04ba93fe..42eee1bc 100644 --- a/hidden/Features/Palette/PaletteModel.swift +++ b/hidden/Features/Palette/PaletteModel.swift @@ -13,6 +13,13 @@ struct PaletteEnvironment: Equatable { /// False when the engine cannot hide anything right now (outside Applications, /// no native API). Then nothing is hidden and there is nothing to find. var engineAvailable: Bool + /// False when the pinned-sections beta is off: a section move would write a + /// table nothing reads, so the palette offers only opening. + var pinsSections = true + /// Apps presentation mode keeps out of sight while it is on. They are left + /// out of the list, and out of every hint that names an app, so the room + /// never learns they are there. + var hiddenWhilePresenting: Set = [] } /// A line in the result list. @@ -34,8 +41,6 @@ enum PaletteContent: Equatable { case engineUnavailable /// Return found the app but its icon would not press. case cannotOpen(appName: String) - /// Presentation mode keeps this app hidden on purpose, so Return does not open it. - case sensitiveWhilePresenting(appName: String) } /// The palette's state: the query, the list it gives, and the selection. @@ -51,7 +56,6 @@ struct PaletteModel: Equatable { private(set) var content: PaletteContent private(set) var selectedIndex = 0 private var failure: String? - private var failureIsSensitive = false init(candidates: [PaletteCandidate], environment: PaletteEnvironment) { self.candidates = candidates @@ -64,7 +68,6 @@ struct PaletteModel: Equatable { guard newValue != query else { return } query = newValue failure = nil - failureIsSensitive = false selectedIndex = 0 recompute() } @@ -83,14 +86,6 @@ struct PaletteModel: Equatable { /// Return found the app but could not press its icon. mutating func showCannotOpen(appName: String) { failure = appName - failureIsSensitive = false - recompute() - } - - /// Return found the app but presentation mode keeps it hidden. - mutating func showSensitive(appName: String) { - failure = appName - failureIsSensitive = true recompute() } @@ -121,19 +116,17 @@ struct PaletteModel: Equatable { private mutating func recompute() { selectedIndex = 0 - content = Self.resolve(query: query, candidates: candidates, environment: environment, failure: failure, - failureIsSensitive: failureIsSensitive) + content = Self.resolve(query: query, candidates: candidates, environment: environment, failure: failure) } - static func resolve(query: String, candidates: [PaletteCandidate], environment: PaletteEnvironment, - failure: String? = nil, failureIsSensitive: Bool = false) -> PaletteContent { + static func resolve(query: String, candidates allCandidates: [PaletteCandidate], environment: PaletteEnvironment, + failure: String? = nil) -> PaletteContent { // The permission comes first: without it nothing below can be read or pressed. guard environment.accessibilityTrusted else { return .accessibilityOff } guard environment.engineAvailable else { return .engineUnavailable } - if let failure { - return failureIsSensitive ? .sensitiveWhilePresenting(appName: failure) : .cannotOpen(appName: failure) - } + if let failure { return .cannotOpen(appName: failure) } + let candidates = allCandidates.filter { !environment.hiddenWhilePresenting.contains($0.bundleIdentifier) } let findable = candidates.filter(\.isFindable) guard !findable.isEmpty else { return .nothingHidden } diff --git a/hidden/Features/Palette/PaletteSnapshot.swift b/hidden/Features/Palette/PaletteSnapshot.swift index e1fa5ad0..e398f4b2 100644 --- a/hidden/Features/Palette/PaletteSnapshot.swift +++ b/hidden/Features/Palette/PaletteSnapshot.swift @@ -41,7 +41,6 @@ enum PaletteSnapshot { var environment = PaletteSnapshot.ready var opening: String? var failure: String? - var sensitive: String? } /// Every state on the Light, Dark, Open and Edge boards, plus the whole list @@ -59,7 +58,11 @@ enum PaletteSnapshot { Scene(name: "macositem", query: "focus", candidates: hidden + [zoom]), Scene(name: "appquit", query: "drop", candidates: hidden + [app("Dropbox", "com.getdropbox.dropbox", .alwaysHidden, running: false)]), Scene(name: "cannotopen", query: "dro", candidates: hidden + [dropbox], failure: "Dropbox"), - Scene(name: "sensitive", query: "pa", candidates: hidden + [zoom], sensitive: "Paste"), + Scene(name: "presenting", query: "", candidates: hidden + [dropbox, zoom], + environment: PaletteEnvironment(accessibilityTrusted: true, engineAvailable: true, + hiddenWhilePresenting: [password.bundleIdentifier, dropbox.bundleIdentifier])), + Scene(name: "nopins", query: "pa", candidates: hidden + [zoom], + environment: PaletteEnvironment(accessibilityTrusted: true, engineAvailable: true, pinsSections: false)), Scene(name: "enginedown", query: "", candidates: hidden, environment: PaletteEnvironment(accessibilityTrusted: true, engineAvailable: false)), ] @@ -69,9 +72,9 @@ enum PaletteSnapshot { var model = PaletteModel(candidates: scene.candidates, environment: scene.environment) model.setQuery(scene.query) if let failure = scene.failure { model.showCannotOpen(appName: failure) } - if let sensitive = scene.sensitive { model.showSensitive(appName: sensitive) } if let opening = scene.opening { model.select(bundle: opening) } - return PaletteViewState(query: model.query, content: model.content, selectedIndex: model.selectedIndex, openingBundle: scene.opening) + return PaletteViewState(query: model.query, content: model.content, selectedIndex: model.selectedIndex, + openingBundle: scene.opening, pinsSections: scene.environment.pinsSections) } static func render(to dir: URL, build: String) { diff --git a/hidden/Features/Reveal/RevealController.swift b/hidden/Features/Reveal/RevealController.swift index 223f1b22..41ee2653 100644 --- a/hidden/Features/Reveal/RevealController.swift +++ b/hidden/Features/Reveal/RevealController.swift @@ -55,6 +55,9 @@ struct RevealHost { final class RevealController { private let host: RevealHost private let isEnabled: (RevealTrigger) -> Bool + /// True while presentation mode is on: a gesture must not pull the hidden + /// icons out in front of the room, so every gesture does nothing. + private let isSuspended: () -> Bool private let screens: () -> [ScreenBand] private let monitoring: RevealEventMonitoring private let canHitTest: () -> Bool @@ -76,12 +79,14 @@ final class RevealController { init(host: RevealHost, isEnabled: @escaping (RevealTrigger) -> Bool, + isSuspended: @escaping () -> Bool = { false }, screens: @escaping () -> [ScreenBand], monitoring: RevealEventMonitoring = SystemRevealEventMonitoring(), canHitTest: @escaping () -> Bool = RevealHitTester.isAvailable, hitTest: @escaping (CGPoint, @escaping (HitTarget) -> Void) -> Void = RevealHitTester.resolve) { self.host = host self.isEnabled = isEnabled + self.isSuspended = isSuspended self.screens = screens self.monitoring = monitoring self.canHitTest = canHitTest @@ -128,7 +133,7 @@ final class RevealController { // MARK: events func ingestScroll(deltaY: CGFloat, time: TimeInterval, isMomentum: Bool, at point: CGPoint) { - guard isEnabled(.scroll) else { return } + guard isEnabled(.scroll), !isSuspended() else { return } guard MenuBarBand.contains(point, in: screens()) else { scrollDetector.reset() return @@ -148,7 +153,7 @@ final class RevealController { } func ingestMouseMoved(at point: CGPoint, time: TimeInterval) { - guard isEnabled(.shake) else { return } + guard isEnabled(.shake), !isSuspended() else { return } let inBand = MenuBarBand.contains(point, in: screens()) guard shakeDetector.feed(x: point.x, at: time, inBand: inBand) else { return } revealIfAllowed(.shake, target: .unknown) @@ -157,7 +162,7 @@ final class RevealController { func ingestMouseDown(at point: CGPoint) { let inBand = MenuBarBand.contains(point, in: screens()) if inBand { - guard isEnabled(.click), !MenuBarBand.isInNotch(point, in: screens()) else { return } + guard isEnabled(.click), !isSuspended(), !MenuBarBand.isInNotch(point, in: screens()) else { return } resolveTarget(at: point) { [weak self] target in self?.revealIfAllowed(.click, target: target) } diff --git a/hidden/Features/StatusBar/StatusBarController.swift b/hidden/Features/StatusBar/StatusBarController.swift index f64f553c..70e5e2b8 100644 --- a/hidden/Features/StatusBar/StatusBarController.swift +++ b/hidden/Features/StatusBar/StatusBarController.swift @@ -79,13 +79,24 @@ class StatusBarController: MenuBarItemProvider { case .shake: return Preferences.revealOnShakeEnabled } }, + isSuspended: { [weak self] in self?.isPresenting ?? false }, screens: ScreenBand.live) // True while the arrow's context menu is up. private var isShowingOwnMenu = false + // Presentation mode is on: the reveal gestures and the arrivals question stay + // quiet, since the room sees the screen. + private var isPresenting: Bool { + #if HIDDENBAR_NATIVE_VISIBILITY + return presentationController?.isOn ?? false + #else + return false + #endif + } + #if HIDDENBAR_NATIVE_VISIBILITY // Asks about apps that add a first icon (Ask Me), from the arrow. - private lazy var arrivalsPresenter = ArrivalsPresenter(openSettings: { + private lazy var arrivalsPresenter = ArrivalsPresenter(isSuppressed: { [weak self] in self?.isPresenting ?? false }, openSettings: { Util.showPrefWindow() PreferencesWindowController.shared.select(.menuBarApps) }) @@ -680,8 +691,11 @@ extension StatusBarController { paletteSession = session let host = PaletteHost( environment: { [weak self] in - PaletteEnvironment(accessibilityTrusted: !AccessibilityPermission.shared.isMissing, - engineAvailable: self?.menuBarEngine.state != .unavailable) + let presenting = self?.isPresenting ?? false + return PaletteEnvironment(accessibilityTrusted: !AccessibilityPermission.shared.isMissing, + engineAvailable: self?.menuBarEngine.state != .unavailable, + pinsSections: Preferences.pinnedSectionsEnabled, + hiddenWhilePresenting: presenting ? Preferences.presentationSensitiveApps : []) }, arrowFrame: { [weak self] in self?.btnExpandCollapse.button?.window?.frame }, open: { bundle, done in session.open(bundle: bundle, completion: done) }, From 451289dc4e9ff226a52409d052072f695aa98a23 Mon Sep 17 00:00:00 2001 From: Han Ngo Date: Mon, 16 Nov 2026 04:22:39 +0700 Subject: [PATCH 3/5] fix(shortcuts): refuse a clashing shortcut and rebind all on change A combination another Hidden Bar shortcut uses is not saved. Any shortcut change makes every binding again, so one that lost a clash works once the other is cleared. The palette shortcut is registered only on the native engine. An App Store import posts the pinned-sections notice. --- HiddenBarTests/HotKeyRegistryTests.swift | 75 +++++++++++++++++++ HiddenTests/AppStoreMigrationTests.swift | 20 +++++ HiddenTests/ShortcutRecorderRowTests.swift | 24 ++++++ hidden/AppDelegate.swift | 36 ++++++--- .../Settings/ShortcutRecorderRow.swift | 13 +++- hidden/Models/HotKeyRegistry.swift | 18 ++++- 6 files changed, 172 insertions(+), 14 deletions(-) diff --git a/HiddenBarTests/HotKeyRegistryTests.swift b/HiddenBarTests/HotKeyRegistryTests.swift index 02eeae22..ab723764 100644 --- a/HiddenBarTests/HotKeyRegistryTests.swift +++ b/HiddenBarTests/HotKeyRegistryTests.swift @@ -209,4 +209,79 @@ final class HotKeyRegistryTests: XCTestCase { registry.register(key: toggleKey) {} XCTAssertEqual(registry.clashingTitle(for: combo, excluding: findKey), toggleKey) } + + // Given two shortcuts on one combination (macOS keeps the first and refuses the second silently) + // When the first is cleared + // Then the second works: every binding is made again on a change, not skipped as unchanged + func test_clearingTheOtherShortcutRevivesTheOneThatLostTheClash() { + let combo = shortcut("k", keyCode: 40) + let carbon = CarbonLikeBinder() + let registry = HotKeyRegistry(defaults: defaults, center: center) { carbon.bind($0, $1) } + store(combo, for: toggleKey) + store(combo, for: findKey) + var ran: [String] = [] + registry.register(key: toggleKey, title: "Show or hide icons") { ran.append("toggle") } + registry.register(key: findKey, title: "Find a hidden icon") { ran.append("find") } + carbon.fire(combo) + XCTAssertEqual(ran.count, 1, "one of the two owns the combination") + let loser = ran[0] == "toggle" ? findKey : toggleKey + let winner = loser == findKey ? toggleKey : findKey + + store(nil, for: winner) + ran = [] + carbon.fire(combo) + XCTAssertEqual(ran, [loser == findKey ? "find" : "toggle"], "the survivor works once the other is cleared") + XCTAssertTrue(registry.isBound(loser)) + } + + // Given live shortcuts + // When an unrelated preference changes, then one changes + // Then the first touches nothing and the second makes every binding again + func test_onlyAShortcutChangeRebindsEverything() { + store(shortcut("k", keyCode: 40), for: toggleKey) + store(shortcut("f", keyCode: 3, shift: true), for: findKey) + registry.register(key: toggleKey) {} + registry.register(key: findKey) {} + XCTAssertEqual(binder.calls.count, 2) + center.post(name: .prefsChanged, object: nil) + XCTAssertEqual(binder.calls.count, 2) + store(shortcut("j", keyCode: 38), for: toggleKey) + XCTAssertEqual(binder.calls.count, 4) + XCTAssertEqual(Set(binder.liveBindings.map(\.keyCode)), [38, 3]) + } +} + +/// Stands in for Carbon: a combination already held by a live registration is +/// refused silently (the call "succeeds", the handler never fires, even after the +/// holder goes away). +private final class CarbonLikeBinder { + private final class Binding { + let combo: GlobalKeybindPreferences + let handler: () -> Void + let refused: Bool + init(_ combo: GlobalKeybindPreferences, refused: Bool, _ handler: @escaping () -> Void) { + self.combo = combo + self.refused = refused + self.handler = handler + } + } + + private final class WeakBox { + weak var value: Binding? + init(_ value: Binding) { self.value = value } + } + + private var registered: [WeakBox] = [] + + func bind(_ combo: GlobalKeybindPreferences, _ handler: @escaping () -> Void) -> AnyObject? { + let held = registered.compactMap(\.value).contains { !$0.refused && $0.combo.isSameCombo(as: combo) } + let binding = Binding(combo, refused: held, handler) + registered.append(WeakBox(binding)) + return binding + } + + /// Runs the handler of the live registration that owns the combination. + func fire(_ combo: GlobalKeybindPreferences) { + registered.compactMap(\.value).first { !$0.refused && $0.combo.isSameCombo(as: combo) }?.handler() + } } diff --git a/HiddenTests/AppStoreMigrationTests.swift b/HiddenTests/AppStoreMigrationTests.swift index ca9951c4..eac59531 100644 --- a/HiddenTests/AppStoreMigrationTests.swift +++ b/HiddenTests/AppStoreMigrationTests.swift @@ -283,6 +283,26 @@ final class AppStoreMigrationTests: XCTestCase { XCTAssertEqual(OtherRunningCopy.decide(others: [appStore, relaunch], runningBundle: downloadsApp, countsOtherPaths: false, countsAppStoreCopies: true), .quitInFavorOf(43)) } + + // Given an import from the App Store build + // When its settings are applied + // Then the pinned-sections notice goes out too, as the engine and the catalog listen to it, not to prefsChanged + func test_importTellsTheAppAboutPinnedSections() { + XCTAssertTrue(AppDelegate.importedPreferenceNotifications.contains(.pinnedSectionsChanged)) + XCTAssertTrue(AppDelegate.importedPreferenceNotifications.contains(.prefsChanged)) + } + + // Given a build that does not use the native engine + // When the app registers its shortcuts + // Then the palette and presentation shortcuts are not registered; with the native engine they are + func test_paletteAndPresentationShortcutsExistOnlyWithTheNativeEngine() { + let registry = HotKeyRegistry(defaults: defaults, center: NotificationCenter()) { _, _ in nil } + AppDelegate.registerNativeEngineHotKeys(in: registry, usesNativeEngine: false, togglePalette: {}, togglePresentation: {}) + XCTAssertEqual(registry.registeredKeys, []) + + AppDelegate.registerNativeEngineHotKeys(in: registry, usesNativeEngine: true, togglePalette: {}, togglePresentation: {}) + XCTAssertEqual(registry.registeredKeys, [UserDefaults.Key.findHiddenIconShortcut, UserDefaults.Key.presentationShortcut].sorted()) + } } #endif diff --git a/HiddenTests/ShortcutRecorderRowTests.swift b/HiddenTests/ShortcutRecorderRowTests.swift index 0d720fa0..c665a9fd 100644 --- a/HiddenTests/ShortcutRecorderRowTests.swift +++ b/HiddenTests/ShortcutRecorderRowTests.swift @@ -179,6 +179,30 @@ final class ShortcutRecorderRowTests: XCTestCase { XCTAssertEqual(row.clashIcon.toolTip, String(format: "Also used by %@".localized, "Show or hide icons")) } + // Given another Hidden Bar shortcut already on a combination + // When the user records that same combination here + // Then it is not saved (macOS would refuse it silently), the old shortcut stays, and the warning names the other + func test_recordingAClashingCombinationIsRefused() { + store(combo(40, "k", flags: 0x300), for: otherKey) + let previous = combo(38, "j") + store(previous, for: key) + row.refresh() + + row.button.performClick(nil) + XCTAssertTrue(row.handle(keyDown("K", code: 40, flags: [.command, .shift]))) + + XCTAssertEqual(stored, previous, "the clashing combination is not stored") + XCTAssertFalse(row.isListening) + XCTAssertEqual(row.button.title, previous.description) + XCTAssertFalse(row.clashIcon.isHidden) + XCTAssertEqual(row.clashIcon.toolTip, String(format: "Also used by %@".localized, "Show or hide icons")) + + row.button.performClick(nil) + row.handle(keyDown("L", code: 37, flags: [.command, .shift])) + XCTAssertEqual(stored?.keyCode, 37) + XCTAssertTrue(row.clashIcon.isHidden) + } + // Given a combination no other shortcut uses, then there is no warning func test_noClashShowsNoWarning() { store(combo(38, "j"), for: otherKey) diff --git a/hidden/AppDelegate.swift b/hidden/AppDelegate.swift index ecb33f3e..7cd4a70d 100644 --- a/hidden/AppDelegate.swift +++ b/hidden/AppDelegate.swift @@ -53,11 +53,17 @@ class AppDelegate: NSObject, NSApplicationDelegate{ private func applyImportedPreferences() { Util.setUpAutoStart(isAutoStart: Preferences.isAutoStart) hotKeys.reload() - for name: Notification.Name in [.prefsChanged, .alwayHideToggle, .useFullStatusBarToggle, - .stealthExpandIconToggle, .arrowStyleChanged] { + for name in Self.importedPreferenceNotifications { NotificationCenter.default.post(name: name, object: nil) } } + + /// What an import tells the rest of the app. The pinned-sections switch and + /// table are read through their own notice, not `.prefsChanged`. + static let importedPreferenceNotifications: [Notification.Name] = [ + .prefsChanged, .pinnedSectionsChanged, .alwayHideToggle, .useFullStatusBarToggle, + .stealthExpandIconToggle, .arrowStyleChanged, + ] #endif /// Hidden Bar is a menu bar utility with no visible window, so launching it a @@ -126,17 +132,25 @@ class AppDelegate: NSObject, NSApplicationDelegate{ self?.statusBarController.expandCollapseIfNeeded() } #if HIDDENBAR_NATIVE_VISIBILITY - // Unset by default, so the palette is off until the user records a shortcut. - hotKeys.register(key: UserDefaults.Key.findHiddenIconShortcut, title: "Find a hidden icon".localized) { [weak self] in - self?.statusBarController.togglePalette() - } - if MenuBarEngineFactory.usesNativeEngine() { - hotKeys.register(key: UserDefaults.Key.presentationShortcut, title: "Presentation mode".localized) { [weak self] in - self?.statusBarController.togglePresentationMode() - } - } + Self.registerNativeEngineHotKeys(in: hotKeys, usesNativeEngine: MenuBarEngineFactory.usesNativeEngine(), + togglePalette: { [weak self] in self?.statusBarController.togglePalette() }, + togglePresentation: { [weak self] in self?.statusBarController.togglePresentationMode() }) #endif } + + #if HIDDENBAR_NATIVE_VISIBILITY + /// The palette and presentation shortcuts exist only where the native engine + /// runs. Both are unset by default, so the features are off until recorded. + static func registerNativeEngineHotKeys(in hotKeys: HotKeyRegistry, usesNativeEngine: Bool, + togglePalette: @escaping () -> Void, + togglePresentation: @escaping () -> Void) { + guard usesNativeEngine else { return } + hotKeys.register(key: UserDefaults.Key.findHiddenIconShortcut, title: "Find a hidden icon".localized, + handler: togglePalette) + hotKeys.register(key: UserDefaults.Key.presentationShortcut, title: "Presentation mode".localized, + handler: togglePresentation) + } + #endif func detectLTRLang() { // Languages like Arabic uses right to left (RTL) writing direction, diff --git a/hidden/Features/Settings/ShortcutRecorderRow.swift b/hidden/Features/Settings/ShortcutRecorderRow.swift index fdc51714..fde715ab 100644 --- a/hidden/Features/Settings/ShortcutRecorderRow.swift +++ b/hidden/Features/Settings/ShortcutRecorderRow.swift @@ -28,6 +28,9 @@ final class ShortcutRecorderRow: NSStackView { private let defaults: UserDefaults private let registry: HotKeyRegistry private var monitor: Any? + // The name of the shortcut that used the combination the user just tried; it + // was not saved, and the warning stays until the next recording or clear. + private var refusedClash: String? private var resignObserver: NSObjectProtocol? private(set) var isListening = false { didSet { listeningChanged() } @@ -85,7 +88,7 @@ final class ShortcutRecorderRow: NSStackView { let stored = shortcut button.title = stored?.description ?? "Set Shortcut".localized clearButton.isHidden = stored == nil - let clash = clashingTitle + let clash = clashingTitle ?? refusedClash clashIcon.isHidden = clash == nil let message = clash.map { String(format: "Also used by %@".localized, $0) } clashIcon.toolTip = message @@ -96,6 +99,7 @@ final class ShortcutRecorderRow: NSStackView { // MARK: Recording @objc private func beginRecording() { + refusedClash = nil isListening = true window?.makeFirstResponder(nil) } @@ -107,6 +111,7 @@ final class ShortcutRecorderRow: NSStackView { /// Removes the stored shortcut. func clear() { isListening = false + refusedClash = nil defaults.removeObject(forKey: key) NotificationCenter.default.post(name: .prefsChanged, object: nil) refresh() @@ -153,6 +158,12 @@ final class ShortcutRecorderRow: NSStackView { keyCode: UInt32(event.keyCode)) // A bare letter would fire while typing; keep the old shortcut. guard keybind.isAcceptable, let data = try? JSONEncoder().encode(keybind) else { return cancelRecording() } + // Two shortcuts on one combination cannot both work: macOS keeps the first + // and refuses the second without a word. Keep the old shortcut and say why. + if let clash = registry.clashingTitle(for: keybind, excluding: key) { + refusedClash = clash + return cancelRecording() + } isListening = false defaults.set(data, forKey: key) NotificationCenter.default.post(name: .prefsChanged, object: nil) diff --git a/hidden/Models/HotKeyRegistry.swift b/hidden/Models/HotKeyRegistry.swift index 779d0360..3c508624 100644 --- a/hidden/Models/HotKeyRegistry.swift +++ b/hidden/Models/HotKeyRegistry.swift @@ -58,8 +58,16 @@ final class HotKeyRegistry { entries[key] = nil } - /// Re-reads every registered preference and rebinds the ones that changed. + /// Re-reads every registered preference. When any shortcut changed, every + /// binding is dropped and made again: macOS refuses a second registration of a + /// combination silently, so a shortcut that lost a clash stays dead after the + /// other one is cleared unless it registers again. Unchanged, nothing is touched. func reload() { + guard entries.keys.contains(where: { changed($0) }) else { return } + for key in entries.keys { + entries[key]?.binding = nil + entries[key]?.combo = nil + } for key in entries.keys { rebind(key) } @@ -86,10 +94,16 @@ final class HotKeyRegistry { return nil } + private func changed(_ key: String) -> Bool { + guard let entry = entries[key] else { return false } + let stored = shortcut(for: key) + return stored != entry.combo || (stored == nil) != (entry.binding == nil) + } + private func rebind(_ key: String) { guard let entry = entries[key] else { return } let stored = shortcut(for: key) - if stored == entry.combo, (stored == nil) == (entry.binding == nil) { return } + if !changed(key) { return } // Unbind first: two live bindings for one combo would clash. entries[key]?.binding = nil entries[key]?.combo = stored From 2e34b2ab6a283f7e9248802e2dbbb3d98721fac0 Mon Sep 17 00:00:00 2001 From: Han Ngo Date: Mon, 16 Nov 2026 04:22:39 +0700 Subject: [PATCH 4/5] docs(megagoal): record the presentation seam decisions --- docs/megagoals/next-features/DECISIONS.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/megagoals/next-features/DECISIONS.md b/docs/megagoals/next-features/DECISIONS.md index 73dbbe62..22fa1df3 100644 --- a/docs/megagoals/next-features/DECISIONS.md +++ b/docs/megagoals/next-features/DECISIONS.md @@ -7,3 +7,13 @@ Mid-run decisions, one line each. - Workers never launch the app live; offscreen snapshots plus wave-verifier hooks runs replace live checks. - The 1.13.0 smoke test is static (codesign, spctl, stapler) because a Release build launched outside /Applications acts on the real install. - `presentationSensitiveApps` is stored as a dictionary so the import whitelist needs no new Kind. +- Presentation mode follows the 1.12 capture rule, not a whole-capture pause: with "show the whole bar when a camera or microphone turns on" on, a start lifts once and shows Paused with a Hide again action, a capture already on at start begins paused, and capture ending resumes after the quiet period; with the switch off it never pauses. +- While presentation mode is paused nothing is hidden, sensitive apps included, and the Settings footnote, the Sensitive apps caption and the paused capsule panel say so. +- A collapse during the pause counts as the user choosing to hide again, as on the main bar; the auto-hide timer collapses the same way. +- The empty-click reveal row is direct-only, although the contract said both builds: the App Store build cannot hit test the bar without Accessibility. +- The palette may open non-sensitive hidden apps while presenting; sensitive apps are filtered out of its list, and a refusal from the engine drops the app from the list without naming it. +- Reveal gestures (scroll, empty click, shake) do nothing while presentation mode is on. +- The arrivals question does not open while presentation mode is on; the dot on the arrow stays and the question waits for the first arrow click after the mode ends. +- The palette offers Command-Return and Option-Return only while pinned sections are on, as arrivals does, and its shortcut is registered only where the native engine runs, as the presentation shortcut is. +- The arrow note while presenting gives a count of apps that stay hidden and never their names, since the room sees it. +- A shortcut that clashes with another Hidden Bar shortcut is not saved; the registry makes every binding again whenever any shortcut changes. From 6b35eda7fabeb27002e44868edf5699bcd8083e9 Mon Sep 17 00:00:00 2001 From: Han Ngo Date: Mon, 16 Nov 2026 04:36:43 +0700 Subject: [PATCH 5/5] fix(presentation): start hidden during a call, counts only in the panel A capture already running when presentation starts no longer pauses it; only a fresh start does. The capsule panel gives counts and names no app. The palette environment is built in one tested place. The footnote names the switch the pause follows. --- HiddenBarTests/MenuBarEngineTests.swift | 40 +++++++------------ HiddenBarTests/PresentationStateTests.swift | 27 ++++++------- HiddenTests/PalettePanelTests.swift | 26 ++++++++++++ HiddenTests/PresentationViewsTests.swift | 32 ++++++++------- docs/megagoals/next-features/DECISIONS.md | 3 +- .../PreferencesViewController.swift | 2 +- .../Presentation/PresentationController.swift | 14 ++----- .../Presentation/PresentationSnapshot.swift | 10 +++-- .../Presentation/PresentationState.swift | 18 ++++++--- .../Presentation/PresentationViews.swift | 29 +++++--------- .../Features/Settings/SettingsSnapshot.swift | 2 +- .../Engine/NativeVisibilityEngine.swift | 7 ++-- .../StatusBar/StatusBarController.swift | 20 ++++++---- hidden/ar.lproj/Localizable.strings | 5 ++- hidden/de.lproj/Localizable.strings | 5 ++- hidden/en.lproj/Localizable.strings | 5 ++- hidden/fr.lproj/Localizable.strings | 5 ++- hidden/hr.lproj/Localizable.strings | 5 ++- hidden/it.lproj/Localizable.strings | 5 ++- hidden/ja.lproj/Localizable.strings | 5 ++- hidden/pl.lproj/Localizable.strings | 5 ++- hidden/tr.lproj/Localizable.strings | 5 ++- hidden/uk.lproj/Localizable.strings | 5 ++- hidden/vi.lproj/Localizable.strings | 5 ++- hidden/zh-Hans.lproj/Localizable.strings | 5 ++- hidden/zh-Hant.lproj/Localizable.strings | 5 ++- 26 files changed, 164 insertions(+), 131 deletions(-) diff --git a/HiddenBarTests/MenuBarEngineTests.swift b/HiddenBarTests/MenuBarEngineTests.swift index 748ae362..7d1d7098 100644 --- a/HiddenBarTests/MenuBarEngineTests.swift +++ b/HiddenBarTests/MenuBarEngineTests.swift @@ -3043,19 +3043,27 @@ final class PresentationModeEngineTests: XCTestCase { XCTAssertEqual(visibility.requests.last?.bundles, strict) } - // Given capture already running + // Given capture already running (a call under way), the switch on // When the mode starts - // Then no strict list is ever requested: it begins paused - func testStartWhileCaptureIsActiveNeverHolds() { + // Then the strict list is held at once and nothing is lifted; a fresh capture start afterwards lifts once + func testStartWhileCaptureIsActiveStartsHidden() { capture.isActive = true let engine = makeEngine() - let held = collapsed(engine) + collapsed(engine) engine.startPresentation() - XCTAssertTrue(held.isInvalidated) + XCTAssertEqual(visibility.requests.last?.bundles, strict) + let held = visibility.succeed(visibility.requests.count - 1) + XCTAssertEqual(engine.currentPhase(), .presenting) + XCTAssertEqual(engine.state, .collapsed) + XCTAssertFalse(held.isInvalidated) + XCTAssertEqual(phases, [.presenting]) + + capture.set(false) + capture.set(true) + XCTAssertTrue(held.isInvalidated, "a fresh start while presenting lifts once") XCTAssertEqual(engine.currentPhase(), .paused) - XCTAssertNil(engine.currentHold) - XCTAssertFalse(visibility.requests.contains { $0.bundles == strict }) + XCTAssertEqual(phases, [.presenting, .paused]) } // Given a bar with no layout to read (Accessibility off) @@ -3285,24 +3293,6 @@ final class PresentationModeEngineTests: XCTestCase { XCTAssertEqual(engine.currentPhase(), .presenting) } - // Given a camera already on, the switch on - // When the user presses "Hide again" - // Then the mode that began paused holds the strict list - func testStartedDuringCaptureResumesOnTheUsersWord() { - capture.isActive = true - let engine = makeEngine() - collapsed(engine) - engine.startPresentation() - XCTAssertEqual(engine.currentPhase(), .paused) - XCTAssertFalse(visibility.requests.contains { $0.bundles == strict }) - - engine.resumePresentationHiding() - XCTAssertEqual(visibility.requests.last?.bundles, strict) - visibility.succeed(visibility.requests.count - 1) - XCTAssertEqual(engine.state, .collapsed) - XCTAssertEqual(phases, [.paused, .presenting]) - } - // Given a presentation, an app the palette allowed, a clock click, then the microphone on and off // When everything has settled // Then the hold is the strict list alone: the palette's app went with the lift and does not return diff --git a/HiddenBarTests/PresentationStateTests.swift b/HiddenBarTests/PresentationStateTests.swift index e3bbc0d6..8ce19c9d 100644 --- a/HiddenBarTests/PresentationStateTests.swift +++ b/HiddenBarTests/PresentationStateTests.swift @@ -91,13 +91,16 @@ final class PresentationStateTests: XCTestCase { XCTAssertEqual(resolved(&state, capture: true, at: 11), .paused) } - // Given the mode on and capture already running + // Given capture already running when the mode starts (a call under way) // When it starts - // Then it never presents: it begins paused - func testStartsPausedWhenCaptureIsAlreadyActive() { + // Then it presents hidden, stays so while that capture runs, and only a fresh start pauses + func testStartsHiddenWhenCaptureIsAlreadyActive() { var state = PresentationState() state.startManually() - XCTAssertEqual(resolved(&state, capture: true, at: 5), .paused) + XCTAssertEqual(resolved(&state, capture: true, at: 5), .presenting) + XCTAssertEqual(resolved(&state, capture: true, at: 500), .presenting) + XCTAssertEqual(resolved(&state, capture: false, at: 600), .presenting) + XCTAssertEqual(resolved(&state, capture: true, at: 700), .paused, "a fresh start while presenting lifts once") } // Given a pause @@ -106,6 +109,7 @@ final class PresentationStateTests: XCTestCase { func testResumesAfterTheQuietPeriod() { var state = PresentationState() state.startManually() + _ = resolved(&state, at: 1) XCTAssertEqual(resolved(&state, capture: true, at: 10), .paused) // A long call: no event between its start and its end. XCTAssertEqual(resolved(&state, capture: false, at: 700), .paused, "the quiet period starts when capture ends") @@ -121,6 +125,7 @@ final class PresentationStateTests: XCTestCase { func testAFlappingMicrophoneDoesNotFlapTheBar() { var state = PresentationState() state.startManually() + _ = resolved(&state, at: 1) _ = resolved(&state, capture: true, at: 10) XCTAssertEqual(resolved(&state, capture: false, at: 11), .paused) XCTAssertEqual(resolved(&state, capture: true, at: 12), .paused) @@ -164,6 +169,7 @@ final class PresentationStateTests: XCTestCase { var state = PresentationState() state.startManually() state.hideDidFail() + XCTAssertEqual(resolved(&state, at: 49), .couldNotHide) XCTAssertEqual(resolved(&state, capture: true, at: 50), .paused) } @@ -185,6 +191,7 @@ final class PresentationStateTests: XCTestCase { func testUserResumeDuringCaptureHoldsUntilTheNextStart() { var state = PresentationState() state.startManually() + _ = resolved(&state, at: 1) XCTAssertEqual(resolved(&state, capture: true, at: 10), .paused) state.resumeHiding() XCTAssertEqual(resolved(&state, capture: true, at: 11), .presenting) @@ -194,23 +201,13 @@ final class PresentationStateTests: XCTestCase { XCTAssertEqual(resolved(&state, capture: true, at: 800), .paused, "a new start pauses again") } - // Given capture already running when the mode starts - // When the user hides again - // Then it presents at once - func testStartedDuringCaptureCanBeResumed() { - var state = PresentationState() - state.startManually() - XCTAssertEqual(resolved(&state, capture: true, at: 5), .paused) - state.resumeHiding() - XCTAssertEqual(resolved(&state, capture: true, at: 6), .presenting) - } - // Given a pause // When the switch is turned off // Then the mode presents func testTurningTheSwitchOffEndsAPause() { var state = PresentationState() state.startManually() + _ = resolved(&state, at: 1) XCTAssertEqual(resolved(&state, capture: true, at: 5), .paused) XCTAssertEqual(resolved(&state, capture: true, pauses: false, at: 6), .presenting) } diff --git a/HiddenTests/PalettePanelTests.swift b/HiddenTests/PalettePanelTests.swift index 91bc3358..b3e40fe9 100644 --- a/HiddenTests/PalettePanelTests.swift +++ b/HiddenTests/PalettePanelTests.swift @@ -332,6 +332,32 @@ final class PalettePanelTests: XCTestCase { XCTAssertTrue(texts.contains("1Password")) } + // MARK: live wiring + + // Given the app's own status bar controller, a sensitive set in the preferences + // When the palette environment is read with presentation mode on, then off + // Then the live wiring hands the sensitive list over only while presenting, and the pinned-sections switch follows the preference + func test_liveEnvironmentCarriesTheSensitiveListOnlyWhilePresenting() throws { + let bar = try XCTUnwrap((NSApp.delegate as? AppDelegate)?.statusBarController, "the test host owns the status bar controller") + let keys = [UserDefaults.Key.presentationSensitiveApps, UserDefaults.Key.pinnedSectionsEnabled] + let saved = keys.map { UserDefaults.standard.object(forKey: $0) } + defer { + for (key, value) in zip(keys, saved) { + if let value { UserDefaults.standard.set(value, forKey: key) } else { UserDefaults.standard.removeObject(forKey: key) } + } + bar.presentingOverride = nil + } + Preferences.presentationSensitiveApps = ["com.paste", "com.1password"] + Preferences.pinnedSectionsEnabled = false + + bar.presentingOverride = true + XCTAssertEqual(bar.paletteEnvironment().hiddenWhilePresenting, ["com.paste", "com.1password"]) + XCTAssertFalse(bar.paletteEnvironment().pinsSections) + + bar.presentingOverride = false + XCTAssertEqual(bar.paletteEnvironment().hiddenWhilePresenting, []) + } + // MARK: placement // Given an arrow on the display with the pointer diff --git a/HiddenTests/PresentationViewsTests.swift b/HiddenTests/PresentationViewsTests.swift index da841ddc..ba6caa70 100644 --- a/HiddenTests/PresentationViewsTests.swift +++ b/HiddenTests/PresentationViewsTests.swift @@ -68,7 +68,7 @@ final class PresentationViewsTests: XCTestCase { XCTAssertNotNil(control(UserDefaults.Key.presentationAutoMirrorEnabled, in: all)) XCTAssertNotNil(control(UserDefaults.Key.presentationSensitiveApps, in: all), "the Edit button carries the key") XCTAssertNotNil(control(UserDefaults.Key.presentationShortcut, in: all), "the recorder button carries the key") - let footnote = texts(all).first { $0.hasPrefix("Sensitive apps stay hidden while presenting, except while hiding is paused") } + let footnote = texts(all).first { $0.hasPrefix("Sensitive apps stay hidden while presenting, except when \"Show all icons when the microphone or camera turns on\" pauses hiding") } XCTAssertNotNil(footnote) XCTAssertTrue(footnote?.contains("nothing is hidden") ?? false, "a pause lifts everything, sensitive apps too") XCTAssertFalse(footnote?.localizedCaseInsensitiveContains("light") ?? true, @@ -131,9 +131,7 @@ final class PresentationViewsTests: XCTestCase { private func panel(_ kind: PresentationPanelModel.Kind, cause: PresentationCause? = .manual, hidden: Int = 3, stays: Int = 1) -> PresentationPanelView { - let chip = { (n: Int) in PresentationAppChip(name: "App \(n)", icon: nil) } - let model = PresentationPanelModel(kind: kind, cause: cause, hidden: (0..