Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions App/Sources/Features/RemoteMirror/MirrorDeviceRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private struct MirrorDeviceNotificationsRow: View {
.accessibilityIdentifier("remote-mirror-device-notifications-on-\(device.id)")
} else if device.push != nil {
Button("Turn Off") { host.setPushAllowed(false, for: device.id) }
.help("Stop notifications to this device; the device cannot turn them on again")
.help("Stop notifications to this device until you turn them on here")
.accessibilityIdentifier("remote-mirror-device-notifications-off-\(device.id)")
}
}
Expand All @@ -114,7 +114,7 @@ private struct MirrorDeviceNotificationsRow: View {
private var state: String {
guard device.isPushAllowedByMac else { return String(localized: "Notifications off for this device") }
guard device.push != nil else {
return String(localized: "Notifications not set up · turn them on in Prowl Mirror on this device")
return String(localized: "Notifications not turned on in Prowl Mirror")
}
return String(localized: "Notifications on")
}
Expand Down Expand Up @@ -162,8 +162,7 @@ extension MirrorPushDelivery {
case .accepted:
return String(localized: "Last notification sent at \(time)")
case .tokenGone:
return String(
localized: "Last notification at \(time) not delivered: the device renews its registration when it connects")
return String(localized: "Last notification at \(time) not delivered · open Prowl Mirror on the device")
case .failed(let reason):
return String(localized: "Last notification at \(time) failed (\(reason))")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,7 @@ private struct ConnectToThisMacSection: View {
.help("Start the listener at launch, so paired devices can connect without a click here")
Toggle(isOn: $host.pushEnabled) {
Text("Send notifications to paired devices")
Text(
"""
When an agent needs you or finishes while you are away from this Mac, paired devices \
get a notification through the Prowl push service. The content is end-to-end encrypted.
""")
Text("Notify paired devices when an agent needs you or finishes while you are away. End-to-end encrypted.")
}
.help("Notify paired iPhones and iPads when you are away from this Mac")
.accessibilityIdentifier("remote-mirror-push-enabled")
Expand Down
4 changes: 3 additions & 1 deletion App/Tests/RemoteMirror/MirrorHostTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,9 @@ struct MirrorHostTests {
#expect(
MirrorPushDelivery(date: date, result: .failed(reason: "ServiceUnavailable")).summary
== "Last notification at \(time) failed (ServiceUnavailable)")
#expect(MirrorPushDelivery(date: date, result: .tokenGone).summary.contains("renews its registration"))
#expect(
MirrorPushDelivery(date: date, result: .tokenGone).summary
== "Last notification at \(time) not delivered · open Prowl Mirror on the device")
}

enum LateGate: String, CaseIterable, Sendable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ struct MirrorNotificationsSection: View {
Toggle("Notifications", isOn: Binding(get: { push.settings.isEnabled }, set: setEnabled))
.accessibilityIdentifier("push-enabled")
if push.settings.isEnabled {
Toggle("Show Details", isOn: Binding(get: { push.settings.showsDetails }, set: push.settings.setShowsDetails))
.accessibilityIdentifier("push-show-details")
Toggle(isOn: Binding(get: { push.settings.showsDetails }, set: push.settings.setShowsDetails)) {
Text("Show Details")
Text("Show the tab name in notifications, also on the lock screen.")
}
.accessibilityIdentifier("push-show-details")
// One row per Mac: its addresses share the kinds and the token.
ForEach(macs, id: \.hostID) { mac in
NavigationLink {
Expand All @@ -34,12 +37,7 @@ struct MirrorNotificationsSection: View {
if systemDenied, push.settings.isEnabled {
Text("Notifications are turned off for Prowl Mirror in the Settings app.")
} else {
Text(
"""
When an agent needs you or finishes while you are away from the Mac, the Host sends a \
notification through the Prowl push service. The content is end-to-end encrypted. \
Show Details adds the tab and worktree name, also on the lock screen.
""")
Text("Sent when an agent needs you or finishes while you are away from the Mac. End-to-end encrypted.")
}
}
.task(id: push.settings.isEnabled) {
Expand Down Expand Up @@ -113,21 +111,21 @@ enum MirrorPushStatusText {
}

static func detail(push: MirrorPushCoordinator, hostID: UUID, supportsPush: Bool?) -> String {
if push.settings.kinds(for: hostID).isEmpty { return String(localized: "This Host sends no notifications to this phone.") }
if push.settings.kinds(for: hostID).isEmpty { return String(localized: "No notifications from this Mac.") }
if supportsPush == false {
return String(localized: "The Prowl version on this Mac cannot send notifications. Update Prowl on the Mac.")
return String(localized: "Update Prowl on this Mac to get notifications.")
}
guard let status = push.statuses[hostID] else {
return String(localized: "Notifications start the next time this phone connects to the Host.")
return String(localized: "Notifications start the next time you connect to this Mac.")
}
if !status.pushEnabled {
return String(localized: "Turn on Send Notifications to Paired Devices in Remote Mirror settings on the Mac.")
return String(localized: "On the Mac, turn on “Send notifications to paired devices” in Remote Mirror settings.")
}
if !status.pushAllowedByMac {
return String(localized: "Notifications to this phone are turned off in Remote Mirror settings on the Mac.")
return String(localized: "Turned off for this phone in Remote Mirror settings on the Mac.")
}
return status.registered
? String(localized: "The Host notifies this phone while you are away from the Mac.")
: String(localized: "Notifications start the next time this phone connects to the Host.")
? String(localized: "You get notifications while you are away from this Mac.")
: String(localized: "Notifications start the next time you connect to this Mac.")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ struct MirrorPushStatusTextTests {
#expect(MirrorPushStatusText.summary(push: push, hostID: hostID, supportsPush: true) == "Off on the Mac")
#expect(
MirrorPushStatusText.detail(push: push, hostID: hostID, supportsPush: true)
== "Turn on Send Notifications to Paired Devices in Remote Mirror settings on the Mac.")
== "On the Mac, turn on “Send notifications to paired devices” in Remote Mirror settings.")
push.received(.init(pushEnabled: true, pushAllowedByMac: false, registered: true), hostID: hostID)
#expect(MirrorPushStatusText.summary(push: push, hostID: hostID, supportsPush: true) == "Off on the Mac")
push.setKinds([], for: hostID)
Expand Down
2 changes: 1 addition & 1 deletion docs/remote-mirror.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ its push token to the Mac; the Mac sends nothing until both sides are on.
turn is never sent late, and only after the agent worked for at least 10 seconds; an
interrupted agent is not a finished turn.
- Each paired device in the list shows **Notifications on**, **Notifications off for this
device**, or **Notifications not set up**. **Turn Off** stops notifications to that device;
device**, or **Notifications not turned on in Prowl Mirror**. **Turn Off** stops notifications to that device;
a new registration from the phone does not turn them on again. **Turn On** allows them again.
After a push, the row also shows the time of the last one and its result: sent, not delivered
because the device must renew its registration (it does so when it next connects), or failed
Expand Down
Loading