Add an iPhone client sharing the macOS app's SwiftUI code
This commit is contained in:
@@ -77,6 +77,7 @@ final class Store {
|
||||
let leadFeed: Feed
|
||||
var jump: Jump?
|
||||
@ObservationIgnored private var jumps = 0
|
||||
private(set) var reveals = 0
|
||||
var composerFocus: String?
|
||||
var summaryReads: [String: Int64] = [:]
|
||||
private(set) var leadMore = false
|
||||
@@ -88,7 +89,9 @@ final class Store {
|
||||
let imageCache = ImageCache()
|
||||
let events = Listeners<ByreEvent>()
|
||||
let paneFocus: PaneFocus
|
||||
#if os(macOS)
|
||||
let remote: Remote
|
||||
#endif
|
||||
let forwards: Forwards
|
||||
let pages: Pages
|
||||
|
||||
@@ -112,8 +115,10 @@ final class Store {
|
||||
self.pages = pages
|
||||
leadFeed = Feed(shown: { true })
|
||||
paneFocus = PaneFocus(api: api)
|
||||
#if os(macOS)
|
||||
remote = Remote(api: api)
|
||||
remote.store = self
|
||||
#endif
|
||||
pages.popup = { [weak self] page in
|
||||
self?.openPage(page)
|
||||
}
|
||||
@@ -139,7 +144,9 @@ final class Store {
|
||||
stopped = true
|
||||
globalStream?.stop()
|
||||
leadStream?.stop()
|
||||
#if os(macOS)
|
||||
remote.stop()
|
||||
#endif
|
||||
drafts?.flush()
|
||||
await paneFocus.leave()
|
||||
}
|
||||
@@ -516,12 +523,14 @@ final class Store {
|
||||
}
|
||||
|
||||
func focusTask(_ taskId: String) {
|
||||
reveals += 1
|
||||
spawn("set focus") {
|
||||
try await self.setFocus(taskId: taskId)
|
||||
}
|
||||
}
|
||||
|
||||
func focusProject(_ projectId: String) {
|
||||
reveals += 1
|
||||
spawn("set focus") {
|
||||
try await self.setFocus(taskId: .some(nil), projectId: projectId)
|
||||
}
|
||||
@@ -534,6 +543,7 @@ final class Store {
|
||||
let name = m?[3] ?? nil
|
||||
let tab = taskTabs.first { $0.rawValue == name }
|
||||
if kind == "task", let id {
|
||||
reveals += 1
|
||||
if let tab, tab != .transcript, tab != .workflow {
|
||||
sheet = Sheet(owner: .task(id), view: .tab(tab))
|
||||
}
|
||||
@@ -545,6 +555,9 @@ final class Store {
|
||||
return
|
||||
}
|
||||
let projectId = kind == "project" ? id : nil
|
||||
if projectId != nil {
|
||||
reveals += 1
|
||||
}
|
||||
if focus.taskId != nil || projectId != focus.projectId {
|
||||
spawn("set focus") {
|
||||
try await self.setFocus(taskId: .some(nil), projectId: .some(projectId))
|
||||
|
||||
Reference in New Issue
Block a user