Add description methods for Mac state restoration models.

This commit is contained in:
Brent Simmons committed 2026-01-05 19:18:50 -08:00
1 parent 85f31d0265
commit 5d8e49057d
4 files changed
+19

No files matched your search

@@ -34,4 +34,8 @@ final class DetailWindowState: NSObject, NSSecureCoding {
coder.encode(isShowingExtractedArticle, forKey: Key.isShowingExtractedArticle)
coder.encode(Double(windowScrollY), forKey: Key.windowScrollY)
}
override var description: String {
"DetailWindowState: extracted=\(isShowingExtractedArticle), scrollY=\(windowScrollY)"
}
}
+7
View File
@@ -54,4 +54,11 @@ final class MainWindowState: NSObject, NSSecureCoding {
coder.encode(timelineWindowState, forKey: Key.timelineWindowState)
coder.encode(detailWindowState, forKey: Key.detailWindowState)
}
override var description: String {
let sidebar = sidebarWindowState?.description ?? "nil"
let timeline = timelineWindowState?.description ?? "nil"
let detail = detailWindowState?.description ?? "nil"
return "MainWindowState: fullScreen=\(isFullScreen), widths=\(splitViewWidths), sidebarHidden=\(isSidebarHidden), sidebar=[\(sidebar)], timeline=[\(timeline)], detail=[\(detail)]"
}
}
@@ -38,4 +38,8 @@ final class SidebarWindowState: NSObject, NSSecureCoding {
coder.encode(expandedContainers, forKey: Key.expandedContainers)
coder.encode(selectedFeeds, forKey: Key.selectedFeeds)
}
override var description: String {
"SidebarWindowState: readFiltered=\(isReadFiltered), expandedContainers=\(expandedContainers), selectedFeeds=\(selectedFeeds)"
}
}
@@ -44,4 +44,8 @@ final class TimelineWindowState: NSObject, NSSecureCoding {
coder.encode(selectedAccountID, forKey: Key.selectedAccountID)
coder.encode(selectedArticleID, forKey: Key.selectedArticleID)
}
override var description: String {
"TimelineWindowState: filterKeys=\(readArticlesFilterStateKeys.count), filterValues=\(readArticlesFilterStateValues.count), accountID=\(selectedAccountID ?? "nil"), articleID=\(selectedArticleID ?? "nil")"
}
}