Smoke-tested against a live server: Pin didn't work from the sidebar context menu, Subscribe/Unsubscribe worked, Enable Embeds didn't. - Sidebar document context menu still had the pre-pins.*-support disabled Pin/Unsubscribe stubs from before that endpoint existed - only the reader's menu got updated at the time. Wired up real Pin (collection-scoped pins.list loaded once per CollectionDocumentsOutline, not per row - avoids an N+1 call storm); left Unsubscribe disabled there since subscriptions.list is per-document, with an accurate comment pointing at the reader's menu instead. - documentEmbeds confirmed not a real field - removed from UpdateDocumentRequest entirely rather than leave a menu item that silently no-ops. - Subscribe, Viewer Insights, and Full Width are now real Toggle menu items (checkmark reflects actual state) instead of static action buttons. Viewer Insights state is inferred from whether documents.insights succeeds/fails, since insightsEnabled isn't readable back off Document - heuristic, flagged in code.
27 lines
657 B
Swift
27 lines
657 B
Swift
import Foundation
|
|
|
|
public struct UpdateDocumentRequest: Encodable, Sendable {
|
|
public let id: String
|
|
public let title: String?
|
|
public let text: String?
|
|
public let append: Bool?
|
|
public let fullWidth: Bool?
|
|
public let insightsEnabled: Bool?
|
|
|
|
public init(
|
|
id: String,
|
|
title: String? = nil,
|
|
text: String? = nil,
|
|
append: Bool? = nil,
|
|
fullWidth: Bool? = nil,
|
|
insightsEnabled: Bool? = nil
|
|
) {
|
|
self.id = id
|
|
self.title = title
|
|
self.text = text
|
|
self.append = append
|
|
self.fullWidth = fullWidth
|
|
self.insightsEnabled = insightsEnabled
|
|
}
|
|
}
|