From 5d8e49057d9ba9bbfd187cc22c38ac7cbef50a38 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 5 Jan 2026 19:18:50 -0800 Subject: [PATCH] Add description methods for Mac state restoration models. --- Mac/MainWindow/Detail/DetailWindowState.swift | 4 ++++ Mac/MainWindow/MainWindowState.swift | 7 +++++++ Mac/MainWindow/Sidebar/SidebarWindowState.swift | 4 ++++ Mac/MainWindow/Timeline/TimelineWindowState.swift | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/Mac/MainWindow/Detail/DetailWindowState.swift b/Mac/MainWindow/Detail/DetailWindowState.swift index 775524d7f..e117483f0 100644 --- a/Mac/MainWindow/Detail/DetailWindowState.swift +++ b/Mac/MainWindow/Detail/DetailWindowState.swift @@ -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)" + } } diff --git a/Mac/MainWindow/MainWindowState.swift b/Mac/MainWindow/MainWindowState.swift index a92168938..cc79843a0 100644 --- a/Mac/MainWindow/MainWindowState.swift +++ b/Mac/MainWindow/MainWindowState.swift @@ -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)]" + } } diff --git a/Mac/MainWindow/Sidebar/SidebarWindowState.swift b/Mac/MainWindow/Sidebar/SidebarWindowState.swift index 12b434715..75a1332eb 100644 --- a/Mac/MainWindow/Sidebar/SidebarWindowState.swift +++ b/Mac/MainWindow/Sidebar/SidebarWindowState.swift @@ -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)" + } } diff --git a/Mac/MainWindow/Timeline/TimelineWindowState.swift b/Mac/MainWindow/Timeline/TimelineWindowState.swift index 720744f66..ef7951ea3 100644 --- a/Mac/MainWindow/Timeline/TimelineWindowState.swift +++ b/Mac/MainWindow/Timeline/TimelineWindowState.swift @@ -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")" + } }