Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Mac/AppDefaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ final class AppDefaults: Sendable {
static let exportOPMLAccountID = "exportOPMLAccountID"
static let defaultBrowserID = "defaultBrowserID"
static let currentThemeName = "currentThemeName"
static let markAsReadOnOpenEnabled = "markAsReadOnOpenEnabled"
static let articleContentJavascriptEnabled = "articleContentJavascriptEnabled"

// Hidden prefs
Expand Down Expand Up @@ -307,6 +308,15 @@ final class AppDefaults: Sendable {
}
}

var isMarkAsReadOnOpenEnabled: Bool {
get {
UserDefaults.standard.bool(forKey: Key.markAsReadOnOpenEnabled)
}
set {
UserDefaults.standard.set(newValue, forKey: Key.markAsReadOnOpenEnabled)
}
}

var isArticleContentJavascriptEnabled: Bool {
get {
UserDefaults.standard.bool(forKey: Key.articleContentJavascriptEnabled)
Expand All @@ -333,6 +343,7 @@ final class AppDefaults: Sendable {
Key.refreshInterval: RefreshInterval.everyHour.rawValue,
Key.showDebugMenu: showDebugMenu,
Key.currentThemeName: Self.defaultThemeName,
Key.markAsReadOnOpenEnabled: true,
Key.articleContentJavascriptEnabled: true
]

Expand Down
33 changes: 28 additions & 5 deletions Mac/Base.lproj/Preferences.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</textFieldCell>
</textField>
<popUpButton horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Z6O-Zt-V1g">
<rect key="frame" x="117" y="400" width="282" height="24"/>
<rect key="frame" x="114" y="380" width="289" height="25"/>
<popUpButtonCell key="cell" type="push" title="Medium" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="2" imageScaling="proportionallyDown" inset="2" selectedItem="jMV-2o-5Oh" id="6pw-Vq-tjM">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="message"/>
Expand Down Expand Up @@ -118,6 +118,26 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="FZh-t4-coy">
<rect key="frame" x="117" y="328" width="283" height="16"/>
<buttonCell key="cell" type="check" title="Mark as Read on Open" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="mF5-NC-6s2">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="mAF-gO-1PI" name="value" keyPath="values.markAsReadOnOpenEnabled" id="MarkAsRead-Binding">
<dictionary key="options">
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
<bool key="NSConditionallySetsEnabled" value="NO"/>
<integer key="NSMultipleValuesPlaceholder" value="1"/>
<integer key="NSNoSelectionPlaceholder" value="1"/>
<integer key="NSNotApplicablePlaceholder" value="1"/>
<integer key="NSNullPlaceholder" value="1"/>
<bool key="NSRaisesForNotApplicableKeys" value="NO"/>
</dictionary>
</binding>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="UI6-sq-M15">
<rect key="frame" x="117" y="300" width="283" height="16"/>
<buttonCell key="cell" type="check" title="Enable JavaScript" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="GUo-0M-xMc">
Expand Down Expand Up @@ -244,7 +264,7 @@
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SFF-mL-yc8">
<rect key="frame" x="117" y="4" width="282" height="24"/>
<rect key="frame" x="114" y="0.0" width="289" height="25"/>
<popUpButtonCell key="cell" type="push" title="Every 30 minutes" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="3" imageScaling="proportionallyDown" inset="2" selectedItem="rZU-Tg-xwo" id="Jwn-HD-eP6">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="message"/>
Expand Down Expand Up @@ -282,6 +302,7 @@
<constraints>
<constraint firstItem="Ci4-fW-KjU" firstAttribute="leading" secondItem="Z6O-Zt-V1g" secondAttribute="leading" id="0Do-jh-Hqq"/>
<constraint firstItem="92N-8I-bOs" firstAttribute="trailing" secondItem="S2Z-bG-jYk" secondAttribute="trailing" id="2ZD-KR-H5A"/>
<constraint firstItem="FZh-t4-coy" firstAttribute="leading" secondItem="Z6O-Zt-V1g" secondAttribute="leading" id="43S-zb-paT"/>
<constraint firstItem="S2Z-bG-jYk" firstAttribute="trailing" secondItem="pR2-Bf-7Fd" secondAttribute="trailing" id="4wu-2O-1fb"/>
<constraint firstItem="Tdg-6Y-gvW" firstAttribute="top" secondItem="0W5-tO-S63" secondAttribute="bottom" constant="20" id="5a3-LF-TvY"/>
<constraint firstItem="0W5-tO-S63" firstAttribute="top" secondItem="UI6-sq-M15" secondAttribute="bottom" constant="8" id="5mw-aE-uy4"/>
Expand All @@ -290,7 +311,7 @@
<constraint firstItem="hQy-ng-ijd" firstAttribute="top" secondItem="Yrc-6Q-kx8" secondAttribute="bottom" constant="20" id="7iQ-QN-Ubh"/>
<constraint firstItem="Yrc-6Q-kx8" firstAttribute="leading" secondItem="Z6O-Zt-V1g" secondAttribute="leading" id="AQY-vT-qR7"/>
<constraint firstItem="yrg-M3-Dbz" firstAttribute="leading" secondItem="Ut3-yd-q6G" secondAttribute="leading" id="Bmt-Mn-CCl"/>
<constraint firstItem="UI6-sq-M15" firstAttribute="top" secondItem="1w0-nA-DEO" secondAttribute="bottom" constant="12" id="DMk-OP-dpa"/>
<constraint firstItem="FZh-t4-coy" firstAttribute="top" secondItem="1w0-nA-DEO" secondAttribute="bottom" constant="12" id="DMk-OP-dpa"/>
<constraint firstItem="Ubm-Pk-l7x" firstAttribute="top" secondItem="Ci4-fW-KjU" secondAttribute="bottom" constant="12" id="E3r-xf-7aZ"/>
<constraint firstAttribute="bottom" secondItem="SFF-mL-yc8" secondAttribute="bottom" constant="4" id="FAd-wh-IFu"/>
<constraint firstItem="pR2-Bf-7Fd" firstAttribute="leading" secondItem="Ut3-yd-q6G" secondAttribute="leading" constant="8" id="G0C-1M-LW1"/>
Expand All @@ -300,7 +321,7 @@
<constraint firstItem="ISO-Wu-R60" firstAttribute="leading" secondItem="Z6O-Zt-V1g" secondAttribute="leading" id="M2S-SQ-vXb"/>
<constraint firstItem="ucw-vG-yLt" firstAttribute="trailing" secondItem="pR2-Bf-7Fd" secondAttribute="trailing" id="Nnp-Vh-NEA"/>
<constraint firstItem="ISO-Wu-R60" firstAttribute="top" secondItem="Z6O-Zt-V1g" secondAttribute="bottom" constant="12" id="Obh-mq-3Tg"/>
<constraint firstItem="92N-8I-bOs" firstAttribute="firstBaseline" secondItem="UI6-sq-M15" secondAttribute="firstBaseline" id="P1b-YG-fd6"/>
<constraint firstItem="92N-8I-bOs" firstAttribute="firstBaseline" secondItem="FZh-t4-coy" secondAttribute="firstBaseline" id="P1b-YG-fd6"/>
<constraint firstItem="Ubm-Pk-l7x" firstAttribute="leading" secondItem="Z6O-Zt-V1g" secondAttribute="leading" id="PXc-G4-8pH"/>
<constraint firstItem="S2Z-bG-jYk" firstAttribute="firstBaseline" secondItem="ISO-Wu-R60" secondAttribute="firstBaseline" id="QBC-MT-MY5"/>
<constraint firstAttribute="trailing" secondItem="Z6O-Zt-V1g" secondAttribute="trailing" constant="1" id="Qa5-bc-lvY"/>
Expand All @@ -313,6 +334,7 @@
<constraint firstItem="ucw-vG-yLt" firstAttribute="firstBaseline" secondItem="SFF-mL-yc8" secondAttribute="firstBaseline" id="XHk-Fk-1pC"/>
<constraint firstAttribute="trailing" secondItem="wtY-Zd-Ps9" secondAttribute="trailing" id="YAf-to-Ruz"/>
<constraint firstItem="1w0-nA-DEO" firstAttribute="top" secondItem="ISO-Wu-R60" secondAttribute="bottom" constant="12" id="Yal-X7-BjE"/>
<constraint firstItem="UI6-sq-M15" firstAttribute="top" secondItem="FZh-t4-coy" secondAttribute="bottom" constant="12" id="a9E-Wa-PdK"/>
<constraint firstAttribute="trailing" secondItem="hQy-ng-ijd" secondAttribute="trailing" constant="1" id="aaL-6A-h6v"/>
<constraint firstItem="92N-8I-bOs" firstAttribute="leading" secondItem="Ut3-yd-q6G" secondAttribute="leading" id="bfi-Tx-kxY"/>
<constraint firstItem="S2Z-bG-jYk" firstAttribute="leading" secondItem="Ut3-yd-q6G" secondAttribute="leading" id="cAs-rZ-scx"/>
Expand All @@ -323,7 +345,8 @@
<constraint firstAttribute="trailing" secondItem="Ci4-fW-KjU" secondAttribute="trailing" constant="1" id="h0b-Nh-tJJ"/>
<constraint firstAttribute="trailing" secondItem="SFF-mL-yc8" secondAttribute="trailing" constant="1" id="hYk-Ff-wTy"/>
<constraint firstItem="SFF-mL-yc8" firstAttribute="leading" secondItem="hQy-ng-ijd" secondAttribute="trailing" constant="-282" id="hhb-8Q-KWc"/>
<constraint firstItem="0W5-tO-S63" firstAttribute="leading" secondItem="UI6-sq-M15" secondAttribute="leading" constant="22" id="jmc-lb-wp2"/>
<constraint firstItem="0W5-tO-S63" firstAttribute="leading" secondItem="UI6-sq-M15" secondAttribute="leading" constant="20" id="jmc-lb-wp2"/>
<constraint firstAttribute="trailing" secondItem="FZh-t4-coy" secondAttribute="trailing" id="kAo-hE-vfB"/>
<constraint firstAttribute="trailing" secondItem="Yrc-6Q-kx8" secondAttribute="trailing" id="o3L-x4-mEr"/>
<constraint firstItem="Wsb-Lr-8Q7" firstAttribute="trailing" secondItem="pR2-Bf-7Fd" secondAttribute="trailing" id="obL-84-81H"/>
<constraint firstItem="Wsb-Lr-8Q7" firstAttribute="firstBaseline" secondItem="Ci4-fW-KjU" secondAttribute="firstBaseline" id="pCJ-eR-07V"/>
Expand Down
2 changes: 1 addition & 1 deletion Mac/MainWindow/Timeline/TimelineViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ extension TimelineViewController: NSTableViewDelegate {
return
}

if selectedArticles.count == 1 {
if selectedArticles.count == 1 && AppDefaults.shared.isMarkAsReadOnOpenEnabled {
let article = selectedArticles.first!
if !article.status.read {
markArticles(Set([article]), statusKey: .read, flag: true)
Expand Down
6 changes: 6 additions & 0 deletions Modules/Account/Sources/Account/SecretKey.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
enum SecretKey {
static var feedlyClientID: String { fatalError("update with live secret") }
static var feedlyClientSecret: String { fatalError("update with live secret") }
static var inoreaderAppID: String { fatalError("update with live secret") }
static var inoreaderAppKey: String { fatalError("update with live secret") }
}
4 changes: 4 additions & 0 deletions Shared/SecretKey.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enum SecretKey {
static var mercuryClientID: String { fatalError("update with live secret") }
static var mercuryClientSecret: String { fatalError("update with live secret") }
}
11 changes: 11 additions & 0 deletions iOS/AppDefaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ final class AppDefaults: Sendable {
static let timelineSortDirection = "timelineSortDirection"
static let articleFullscreenAvailable = "articleFullscreenAvailable"
static let articleFullscreenEnabled = "articleFullscreenEnabled"
static let markAsReadOnOpen = "markAsReadOnOpen"
static let confirmMarkAllAsRead = "confirmMarkAllAsRead"
static let lastRefresh = "lastRefresh"
static let addFeedAccountID = "addFeedAccountID"
Expand Down Expand Up @@ -201,6 +202,15 @@ final class AppDefaults: Sendable {
articleFullscreenAvailable && articleFullscreenEnabled
}

var markAsReadOnOpen: Bool {
get {
return AppDefaults.bool(for: Key.markAsReadOnOpen)
}
set {
AppDefaults.setBool(for: Key.markAsReadOnOpen, newValue)
}
}

var confirmMarkAllAsRead: Bool {
get {
return AppDefaults.bool(for: Key.confirmMarkAllAsRead)
Expand Down Expand Up @@ -396,6 +406,7 @@ final class AppDefaults: Sendable {
Key.timelineSortDirection: ComparisonResult.orderedDescending.rawValue,
Key.articleFullscreenAvailable: false,
Key.articleFullscreenEnabled: false,
Key.markAsReadOnOpen: true,
Key.confirmMarkAllAsRead: true,
Key.articleContentJavascriptEnabled: true,
Key.currentThemeName: Self.defaultThemeName,
Expand Down
4 changes: 3 additions & 1 deletion iOS/SceneCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,9 @@ struct SidebarItemNode: Hashable, Sendable {
mainTimelineViewController?.didPushArticleViewController = true

// Mark article as read before navigating to it, so the read status does not flash unread/read on display
markArticles(Set([article!]), statusKey: .read, flag: true)
if AppDefaults.shared.markAsReadOnOpen {
markArticles(Set([article!]), statusKey: .read, flag: true)
}

mainTimelineViewController?.updateArticleSelection(animations: animations)
articleViewController?.article = article
Expand Down
Loading