Merge pull request #4953 from stuartbreckenridge/main

Fixes for #4950, #4948, #4952
This commit is contained in:
Brent Simmons authored and GitHub committed 2026-01-13 08:59:44 -08:00
commit 72f69a4b47
12 files changed
+168 -91

No files matched your search

+4 -3
View File
@@ -9,9 +9,10 @@
import Foundation
struct WidgetData: Codable {
let currentUnreadCount: Int
let currentTodayCount: Int
let currentStarredCount: Int
let totalUnreadCount: Int
let totalTodayCount: Int
let totalTodayUnreadCount: Int
let totalStarredCount: Int
let unreadArticles: [LatestArticle]
let starredArticles: [LatestArticle]
let todayArticles: [LatestArticle]
+2 -2
View File
@@ -18,7 +18,7 @@ struct WidgetDataDecoder {
let decodedWidgetData = try JSONDecoder().decode(WidgetData.self, from: Data(contentsOf: dataURL!))
return decodedWidgetData
} else {
return WidgetData(currentUnreadCount: 0, currentTodayCount: 0, currentStarredCount: 0, unreadArticles: [], starredArticles: [], todayArticles: [], lastUpdateTime: Date())
return WidgetData(totalUnreadCount: 0, totalTodayCount: 0, totalTodayUnreadCount: 0, totalStarredCount: 0, unreadArticles: [], starredArticles: [], todayArticles: [], lastUpdateTime: Date())
}
}
@@ -29,7 +29,7 @@ struct WidgetDataDecoder {
let decoded = try JSONDecoder().decode(WidgetData.self, from: data)
return decoded
} catch {
return WidgetData(currentUnreadCount: 0, currentTodayCount: 0, currentStarredCount: 0, unreadArticles: [], starredArticles: [], todayArticles: [], lastUpdateTime: Date())
return WidgetData(totalUnreadCount: 0, totalTodayCount: 0, totalTodayUnreadCount: 0, totalStarredCount: 0, unreadArticles: [], starredArticles: [], todayArticles: [], lastUpdateTime: Date())
}
}
+9 -4
View File
@@ -95,7 +95,7 @@ import Account
Self.logger.debug("WidgetDataEncoder: Reloading Unread widget")
}
if existingData.todayArticles != newData.todayArticles {
if existingData.todayArticles != newData.todayArticles || existingData.totalTodayUnreadCount != newData.totalTodayUnreadCount {
WidgetCenter.shared.reloadTimelines(ofKind: "com.ranchero.NetNewsWire.TodayWidget")
shouldRefreshSummary = true
Self.logger.debug("WidgetDataEncoder: Reloading Today widget")
@@ -126,15 +126,20 @@ import Account
let starredArticles = sortedLatestArticles(fetchedStarredArticles)
let fetchedTodayArticles = try AccountManager.shared.fetchArticles(.today(fetchLimit))
let fetchedTodayTotal = try AccountManager.shared.fetchArticles(.today())
let fetchedTodayTotalCount = fetchedTodayTotal.count
let fetchedTodayUnreadCount = fetchedTodayTotal.filter({ $0.status.read == false }).count
let todayArticles = sortedLatestArticles(fetchedTodayArticles)
let latestData = WidgetData(currentUnreadCount: SmartFeedsController.shared.unreadFeed.unreadCount,
currentTodayCount: todayArticles.count,
currentStarredCount: (try? AccountManager.shared.fetchCountForStarredArticles()) ?? 0,
let latestData = WidgetData(totalUnreadCount: SmartFeedsController.shared.unreadFeed.unreadCount,
totalTodayCount: fetchedTodayTotalCount,
totalTodayUnreadCount: fetchedTodayUnreadCount,
totalStarredCount: (try? AccountManager.shared.fetchCountForStarredArticles()) ?? 0,
unreadArticles: unreadArticles,
starredArticles: starredArticles,
todayArticles: todayArticles,
lastUpdateTime: Date.now)
return latestData
}
+1 -1
View File
@@ -51,7 +51,7 @@ struct Provider: TimelineProvider {
let widgetData = try WidgetDataDecoder.decodeWidgetData()
entry = WidgetTimelineEntry(date: date, widgetData: widgetData)
} catch {
entry = WidgetTimelineEntry(date: date, widgetData: WidgetData(currentUnreadCount: 0, currentTodayCount: 0, currentStarredCount: 0, unreadArticles: [], starredArticles: [], todayArticles: [], lastUpdateTime: Date.now))
entry = WidgetTimelineEntry(date: date, widgetData: WidgetData(totalUnreadCount: 0, totalTodayCount: 0, totalTodayUnreadCount: 0, totalStarredCount: 0, unreadArticles: [], starredArticles: [], todayArticles: [], lastUpdateTime: Date.now))
}
let fallback = Calendar.current.date(byAdding: .minute, value: 30, to: Date.now)!
@@ -19,39 +19,42 @@ struct LockScreenSummaryWidgetView: View {
unreadImage
Text("label.text.unread", comment: "Unread")
Spacer()
Text(verbatim: entry.widgetData.currentUnreadCount.formatted())
Text(verbatim: entry.widgetData.totalUnreadCount.formatted())
.frame(maxWidth: .infinity, alignment: .trailing)
}
HStack(alignment: .center) {
todayImage
Text("label.text.today", comment: "Today")
Spacer()
Text(verbatim: entry.widgetData.currentTodayCount.formatted())
Text(verbatim: entry.widgetData.totalTodayCount.formatted())
.frame(maxWidth: .infinity, alignment: .trailing)
}
HStack(alignment: .center) {
starredImage
Text("label.text.starred", comment: "Starred")
Spacer()
Text(verbatim: entry.widgetData.currentStarredCount.formatted())
Text(verbatim: entry.widgetData.totalStarredCount.formatted())
.frame(maxWidth: .infinity, alignment: .trailing)
}
}
.font(.caption)
.font(.subheadline)
}
var starredImage: some View {
Image(systemName: "star.fill")
.resizable()
.frame(width: 14, height: 14)
}
var unreadImage: some View {
Image(systemName: "largecircle.fill.circle")
.resizable()
.frame(width: 14, height: 14)
}
var todayImage: some View {
Image(systemName: "sun.max.fill")
.resizable()
.frame(width: 14, height: 14)
}
+7 -13
View File
@@ -16,7 +16,7 @@ struct StarredWidgetView: View {
var entry: Provider.Entry
var body: some View {
if entry.widgetData.currentStarredCount == 0 {
if entry.widgetData.starredArticles.count == 0 {
inboxZero
.widgetURL(WidgetDeepLink.starred.url)
} else {
@@ -33,8 +33,8 @@ struct StarredWidgetView: View {
.layoutPriority(1)
Spacer()
.layoutPriority(0)
if entry.widgetData.currentStarredCount - maxCount() > 0 {
Text(verbatim: entry.widgetData.currentStarredCount.formatted())
if entry.widgetData.totalStarredCount - maxCount() > 0 {
Text(verbatim: entry.widgetData.totalStarredCount.formatted())
.font(.caption2)
.bold()
.foregroundColor(.secondary)
@@ -47,14 +47,8 @@ struct StarredWidgetView: View {
Divider()
if entry.widgetData.starredArticles.count > 0 {
ForEach(0..<maxCount(), id: \.self, content: { i in
if i != 0 {
Divider()
ArticleItemView(article: entry.widgetData.starredArticles[i],
deepLink: WidgetDeepLink.starredArticle(id: entry.widgetData.starredArticles[i].id).url)
} else {
ArticleItemView(article: entry.widgetData.starredArticles[i],
deepLink: WidgetDeepLink.starredArticle(id: entry.widgetData.starredArticles[i].id).url)
}
ArticleItemView(article: entry.widgetData.starredArticles[i],
deepLink: WidgetDeepLink.starredArticle(id: entry.widgetData.starredArticles[i].id).url)
})
}
Spacer()
@@ -78,9 +72,9 @@ struct StarredWidgetView: View {
}
if family == .systemLarge {
return entry.widgetData.currentStarredCount >= 7 ? (7 - reduceAccessibilityCount) : entry.widgetData.currentStarredCount
return entry.widgetData.totalStarredCount >= 7 ? (7 - reduceAccessibilityCount) : entry.widgetData.totalStarredCount
}
return entry.widgetData.currentStarredCount >= 3 ? (3 - reduceAccessibilityCount) : entry.widgetData.currentStarredCount
return entry.widgetData.totalStarredCount >= 3 ? (3 - reduceAccessibilityCount) : entry.widgetData.totalStarredCount
}
var inboxZero: some View {
+7 -13
View File
@@ -17,7 +17,7 @@ struct TodayWidgetView: View {
var entry: Provider.Entry
var body: some View {
if entry.widgetData.currentTodayCount == 0 {
if entry.widgetData.totalTodayCount == 0 {
inboxZero
.widgetURL(WidgetDeepLink.today.url)
} else {
@@ -34,8 +34,8 @@ struct TodayWidgetView: View {
.layoutPriority(1)
Spacer()
.layoutPriority(0)
if entry.widgetData.currentTodayCount > 0 {
Text(verbatim: entry.widgetData.currentTodayCount.formatted())
if entry.widgetData.totalTodayCount > 0 {
Text(verbatim: entry.widgetData.totalTodayUnreadCount > 0 ? "\(entry.widgetData.totalTodayCount.formatted()), \(entry.widgetData.totalTodayUnreadCount.formatted()) unread" : entry.widgetData.totalTodayCount.formatted())
.font(.caption2)
.bold()
.foregroundColor(.secondary)
@@ -48,14 +48,8 @@ struct TodayWidgetView: View {
Divider()
if entry.widgetData.todayArticles.count > 0 {
ForEach(0..<maxCount(), id: \.self, content: { i in
if i != 0 {
Divider()
ArticleItemView(article: entry.widgetData.todayArticles[i],
deepLink: WidgetDeepLink.todayArticle(id: entry.widgetData.todayArticles[i].id).url)
} else {
ArticleItemView(article: entry.widgetData.todayArticles[i],
deepLink: WidgetDeepLink.todayArticle(id: entry.widgetData.todayArticles[i].id).url)
}
ArticleItemView(article: entry.widgetData.todayArticles[i],
deepLink: WidgetDeepLink.todayArticle(id: entry.widgetData.todayArticles[i].id).url)
})
}
Spacer()
@@ -79,9 +73,9 @@ struct TodayWidgetView: View {
}
if family == .systemLarge {
return entry.widgetData.currentTodayCount >= 7 ? (7 - reduceAccessibilityCount) : entry.widgetData.currentTodayCount
return entry.widgetData.totalTodayCount >= 7 ? (7 - reduceAccessibilityCount) : entry.widgetData.totalTodayCount
}
return entry.widgetData.todayArticles.count >= 3 ? (3 - reduceAccessibilityCount) : entry.widgetData.currentTodayCount
return entry.widgetData.totalTodayCount >= 3 ? (3 - reduceAccessibilityCount) : entry.widgetData.totalTodayCount
}
var inboxZero: some View {
+7 -13
View File
@@ -16,7 +16,7 @@ struct UnreadWidgetView: View {
var entry: Provider.Entry
var body: some View {
if entry.widgetData.currentUnreadCount == 0 {
if entry.widgetData.totalUnreadCount == 0 {
inboxZero
.widgetURL(WidgetDeepLink.unread.url)
} else {
@@ -33,8 +33,8 @@ struct UnreadWidgetView: View {
.layoutPriority(1)
Spacer()
.layoutPriority(0)
if entry.widgetData.currentUnreadCount - maxCount() > 0 {
Text(verbatim: entry.widgetData.currentUnreadCount.formatted())
if entry.widgetData.totalUnreadCount - maxCount() > 0 {
Text(verbatim: entry.widgetData.totalUnreadCount.formatted())
.font(.caption2)
.bold()
.foregroundColor(.secondary)
@@ -47,14 +47,8 @@ struct UnreadWidgetView: View {
Divider()
if entry.widgetData.unreadArticles.count > 0 {
ForEach(0..<maxCount(), id: \.self, content: { i in
if i != 0 {
Divider()
ArticleItemView(article: entry.widgetData.unreadArticles[i],
deepLink: WidgetDeepLink.unreadArticle(id: entry.widgetData.unreadArticles[i].id).url)
} else {
ArticleItemView(article: entry.widgetData.unreadArticles[i],
deepLink: WidgetDeepLink.unreadArticle(id: entry.widgetData.unreadArticles[i].id).url)
}
ArticleItemView(article: entry.widgetData.unreadArticles[i],
deepLink: WidgetDeepLink.unreadArticle(id: entry.widgetData.unreadArticles[i].id).url)
})
}
Spacer()
@@ -77,9 +71,9 @@ struct UnreadWidgetView: View {
}
if family == .systemLarge {
return entry.widgetData.currentUnreadCount >= 7 ? (7 - reduceAccessibilityCount) : entry.widgetData.currentUnreadCount
return entry.widgetData.totalUnreadCount >= 7 ? (7 - reduceAccessibilityCount) : entry.widgetData.totalUnreadCount
}
return entry.widgetData.currentUnreadCount >= 3 ? (3 - reduceAccessibilityCount) : entry.widgetData.currentUnreadCount
return entry.widgetData.totalUnreadCount >= 3 ? (3 - reduceAccessibilityCount) : entry.widgetData.totalUnreadCount
}
var inboxZero: some View {
+8 -4
View File
@@ -18,10 +18,11 @@ struct UnreadWidget: Widget {
return StaticConfiguration(kind: kind, provider: Provider(), content: { entry in
UnreadWidgetView(entry: entry)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.frame(maxHeight: .infinity, alignment: .top)
.containerBackground(for: .widget) {
Color.clear
}
.clipped()
})
.configurationDisplayName(Text("label.text.unread", comment: "Unread"))
.description(Text("label.text.unread-widget-description", comment: "A description of the Unread widget."))
@@ -36,10 +37,11 @@ struct TodayWidget: Widget {
return StaticConfiguration(kind: kind, provider: Provider(), content: { entry in
TodayWidgetView(entry: entry)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.frame(maxHeight: .infinity, alignment: .top)
.containerBackground(for: .widget) {
Color.clear
}
.clipped()
})
.configurationDisplayName(Text("label.text.today", comment: "Today"))
.description(Text("label.text.today-widget-description", comment: "A description of the Today widget."))
@@ -54,10 +56,11 @@ struct StarredWidget: Widget {
return StaticConfiguration(kind: kind, provider: Provider(), content: { entry in
StarredWidgetView(entry: entry)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.frame(maxHeight: .infinity, alignment: .top)
.containerBackground(for: .widget) {
Color.clear
}
.clipped()
})
.configurationDisplayName(Text("label.text.starred", comment: "Starred"))
.description(Text("label.text.starred-widget-description", comment: "A description of the Starred widget."))
@@ -72,10 +75,11 @@ struct LockScreenSummaryWidget: Widget {
return StaticConfiguration(kind: kind, provider: Provider(), content: { entry in
LockScreenSummaryWidgetView(entry: entry)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.frame(maxHeight: .infinity, alignment: .top)
.containerBackground(for: .widget) {
Color.clear
}
.clipped()
})
.configurationDisplayName(Text("label.text.lock-screen-summary", comment: "Summary"))
.description(Text("label.text.lock-screen-summary-description", comment: "A description of the Lock Screen Summary widget."))
@@ -15,6 +15,8 @@ class MainTimelineFeedCell: UITableViewCell {
@IBOutlet var articleDate: UILabel!
@IBOutlet var metaDataStackView: UIStackView!
private(set) var usedTitleLineCount: Int = 0
var cellData: MainTimelineCellData! {
didSet {
configure(cellData)
@@ -95,30 +97,69 @@ class MainTimelineFeedCell: UITableViewCell {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
paragraphStyle.lineBreakMode = .byTruncatingTail
let titleAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .headline),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let titleWithNewline = cellData.title + (cellData.summary != "" ? "\n" : "" )
let titleAttributed = NSAttributedString(string: titleWithNewline, attributes: titleAttributes)
let titleAttributed = NSAttributedString(string: cellData.title, attributes: titleAttributes)
attributedCellText.append(titleAttributed)
}
if cellData.summary != "" {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.lineBreakMode = .byTruncatingTail
let summaryAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .body),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let summaryAttributed = NSAttributedString(string: cellData.summary, attributes: summaryAttributes)
attributedCellText.append(summaryAttributed)
}
articleTitle.attributedText = attributedCellText
if linesUsedForTitleGreaterThanOrEqualToPreference() {
// No need to add cell summary as we're already at maximum.
articleTitle.lineBreakMode = .byTruncatingTail
return
} else {
if cellData.summary != "" {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
let summaryAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .body),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let summaryAttributed = NSAttributedString(string: "\n" + cellData.summary, attributes: summaryAttributes)
attributedCellText.append(summaryAttributed)
}
articleTitle.attributedText = attributedCellText
if linesUsedForTitleGreaterThanOrEqualToPreference() {
articleTitle.lineBreakMode = .byTruncatingTail
}
}
}
func linesUsedForTitleGreaterThanOrEqualToPreference() -> Bool {
contentView.layoutIfNeeded()
let attributed = articleTitle.attributedText ?? NSAttributedString()
let textStorage = NSTextStorage(attributedString: attributed)
let containerSize = CGSize(width: articleTitle.bounds.width, height: .greatestFiniteMagnitude)
let textContainer = NSTextContainer(size: containerSize)
textContainer.lineFragmentPadding = 0
textContainer.maximumNumberOfLines = articleTitle.numberOfLines // 0 means unlimited
textContainer.lineBreakMode = articleTitle.lineBreakMode
let layoutManager = NSLayoutManager()
layoutManager.addTextContainer(textContainer)
textStorage.addLayoutManager(layoutManager)
_ = layoutManager.glyphRange(for: textContainer)
var lineCount = 0
var glyphIndex = 0
let glyphs = layoutManager.numberOfGlyphs
while glyphIndex < glyphs {
var lineRange = NSRange()
_ = layoutManager.lineFragmentRect(forGlyphAt: glyphIndex, effectiveRange: &lineRange)
glyphIndex = NSMaxRange(lineRange)
lineCount += 1
}
usedTitleLineCount = lineCount
return usedTitleLineCount >= AppDefaults.shared.timelineNumberOfLines
}
override func updateConfiguration(using state: UICellConfigurationState) {
@@ -145,3 +186,4 @@ class MainTimelineFeedCell: UITableViewCell {
self.backgroundConfiguration = backgroundConfig
}
}
@@ -15,6 +15,8 @@ class MainTimelineIconFeedCell: UITableViewCell {
@IBOutlet var indicatorView: IconView!
@IBOutlet var articleDate: UILabel!
@IBOutlet var metaDataStackView: UIStackView!
private(set) var usedTitleLineCount: Int = 0
var cellData: MainTimelineCellData! {
didSet {
@@ -115,36 +117,74 @@ class MainTimelineIconFeedCell: UITableViewCell {
private func applyTitleTextWithAttributes(_ state: UICellConfigurationState) {
let attributedCellText = NSMutableAttributedString()
let isSelected = state.isSelected || state.isHighlighted || state.isFocused || state.isSwiped
if cellData.title != "" {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
paragraphStyle.lineBreakMode = .byTruncatingTail
let titleAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .headline),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let titleWithNewline = cellData.title + (cellData.summary != "" ? "\n" : "" )
let titleAttributed = NSAttributedString(string: titleWithNewline, attributes: titleAttributes)
let titleAttributed = NSAttributedString(string: cellData.title, attributes: titleAttributes)
attributedCellText.append(titleAttributed)
}
if cellData.summary != "" {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.lineBreakMode = .byTruncatingTail
let summaryAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .body),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let summaryAttributed = NSAttributedString(string: cellData.summary, attributes: summaryAttributes)
attributedCellText.append(summaryAttributed)
}
articleTitle.attributedText = attributedCellText
if linesUsedForTitleGreaterThanOrEqualToPreference() {
// No need to add cell summary as we're already at maximum.
articleTitle.lineBreakMode = .byTruncatingTail
return
} else {
if cellData.summary != "" {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
let summaryAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.preferredFont(forTextStyle: .body),
.paragraphStyle: paragraphStyle,
.foregroundColor: isSelected ? UIColor.white : UIColor.label
]
let summaryAttributed = NSAttributedString(string: "\n" + cellData.summary, attributes: summaryAttributes)
attributedCellText.append(summaryAttributed)
}
articleTitle.attributedText = attributedCellText
if linesUsedForTitleGreaterThanOrEqualToPreference() {
articleTitle.lineBreakMode = .byTruncatingTail
}
}
}
func linesUsedForTitleGreaterThanOrEqualToPreference() -> Bool {
contentView.layoutIfNeeded()
let attributed = articleTitle.attributedText ?? NSAttributedString()
let textStorage = NSTextStorage(attributedString: attributed)
let containerSize = CGSize(width: articleTitle.bounds.width, height: .greatestFiniteMagnitude)
let textContainer = NSTextContainer(size: containerSize)
textContainer.lineFragmentPadding = 0
textContainer.maximumNumberOfLines = articleTitle.numberOfLines // 0 means unlimited
textContainer.lineBreakMode = articleTitle.lineBreakMode
let layoutManager = NSLayoutManager()
layoutManager.addTextContainer(textContainer)
textStorage.addLayoutManager(layoutManager)
_ = layoutManager.glyphRange(for: textContainer)
var lineCount = 0
var glyphIndex = 0
let glyphs = layoutManager.numberOfGlyphs
while glyphIndex < glyphs {
var lineRange = NSRange()
_ = layoutManager.lineFragmentRect(forGlyphAt: glyphIndex, effectiveRange: &lineRange)
glyphIndex = NSMaxRange(lineRange)
lineCount += 1
}
usedTitleLineCount = lineCount
return usedTitleLineCount >= AppDefaults.shared.timelineNumberOfLines
}
override func updateConfiguration(using state: UICellConfigurationState) {
@@ -121,7 +121,7 @@ final class MainTimelineViewController: UITableViewController, UndoableCommandRu
private var navigationBarSubtitleTitleLabel: UILabel {
let label = UILabel()
label.font = UIFont.preferredFont(forTextStyle: .footnote)
label.font = UIFont(name: "Helvetica", size: 12)
label.textColor = .systemGray
label.textAlignment = .center
label.isUserInteractionEnabled = true