Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
029c2f9
Add OSLogExt module and app identifier
chihchy Jun 29, 2026
dcde4e2
Use OSLog in BackgroundProcessingClient
chihchy Jun 29, 2026
8b3d00e
Use OSLog in AppModels
chihchy Jun 29, 2026
8a91a71
Use OSLog in ParserFeature
chihchy Jun 29, 2026
fbb5b51
Use OSLog in DatabaseClient
chihchy Jun 29, 2026
7064db8
Use OSLog in SettingFeature WebView
chihchy Jun 29, 2026
cd6d838
Use OSLog in NetworkingFeature
chihchy Jun 29, 2026
f3686ec
Use OSLog in ReadingFeature, drop UI noise
chihchy Jun 29, 2026
96b6871
Use OSLog in DownloadClient
chihchy Jun 29, 2026
6379c04
Use OSLog in AppTools
chihchy Jun 29, 2026
d91d11a
Remove SwiftyBeaver logging plumbing
chihchy Jun 29, 2026
95ac902
Add AppActivityLog model and LogsClient module
chihchy Jun 29, 2026
67ae958
Rebuild log viewer with live pump and picker
chihchy Jun 29, 2026
b5006e0
Delete SwiftyBeaver module and dead log file APIs
chihchy Jun 29, 2026
38b6a73
Rename General log entry to App Activity Logs
chihchy Jun 29, 2026
d64b800
Add SettingFeatureTests for log viewer pump
chihchy Jun 29, 2026
dcf65cc
Move logger instances to files that use them
chihchy Jun 29, 2026
93b3bcf
Fix activity log title and empty-page baseline
chihchy Jun 29, 2026
c626339
Reset activity log launch count per day
chihchy Jun 29, 2026
e10bcac
Build log file names with joined separators
chihchy Jun 29, 2026
439b135
Add Run picker with Current section and sheet
chihchy Jun 29, 2026
4693d90
Rename launch log names to run, drop launchDate
chihchy Jun 29, 2026
c403c3f
Show run time HHmm, cap picker at 5 incl current
chihchy Jul 1, 2026
62c5ec1
Log app activity events at notice level
chihchy Jul 1, 2026
86c37c7
Use file URL as RunLogFile identity
chihchy Jul 1, 2026
ed7407a
Add Open in Files button to activity logs
chihchy Jul 1, 2026
cb157ce
Use sentence case for App activity logs label
chihchy Jul 1, 2026
be3c13d
Resync localizations to match en, add logs keys
chihchy Jul 1, 2026
92724c0
Drop Copied from attribution comments
chihchy Jul 1, 2026
868848f
Drop Localizable.strings file headers
chihchy Jul 1, 2026
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: 1 addition & 10 deletions AppPackage/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 38 additions & 33 deletions AppPackage/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var dependencies: [PackageDescription.Package.Dependency] = [
.package(url: "https://github.com/SDWebImage/SDWebImageWebPCoder", from: "0.14.0"),
.package(url: "https://github.com/SFSafeSymbols/SFSafeSymbols", from: "7.0.0"),
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.63.0"),
.package(url: "https://github.com/SwiftyBeaver/SwiftyBeaver", from: "2.0.0"),
.package(url: "https://github.com/ddddxxx/SwiftyOpenCC", exact: "2.0.0-beta"),
.package(url: "https://github.com/fermoya/SwiftUIPager", from: "2.5.0"),
.package(url: "https://github.com/gonzalezreal/SwiftCommonMark", from: "1.0.0"),
Expand Down Expand Up @@ -49,7 +48,6 @@ extension PackageDescription.Target.Dependency {
static let sfSafeSymbols: Self = .product(name: "SFSafeSymbols", package: "SFSafeSymbols")
static let swiftUINavigation: Self = .product(name: "SwiftUINavigation", package: "swift-navigation")
static let swiftUIPager: Self = .product(name: "SwiftUIPager", package: "SwiftUIPager")
static let swiftyBeaver: Self = .product(name: "SwiftyBeaver", package: "SwiftyBeaver")
static let ttProgressHUD: Self = .product(name: "TTProgressHUD", package: "TTProgressHUD")
static let uiImageColors: Self = .product(name: "UIImageColors", package: "UIImageColors")
static let waterfallGrid: Self = .product(name: "WaterfallGrid", package: "WaterfallGrid")
Expand Down Expand Up @@ -98,10 +96,11 @@ enum Module: String {
case homeFeature = "HomeFeature"
case imageClient = "ImageClient"
case libraryClient = "LibraryClient"
case loggerClient = "LoggerClient"
case logsClient = "LogsClient"
case migrationFeature = "MigrationFeature"
case networkingFeature = "NetworkingFeature"
case openCCExt = "OpenCCExt"
case osLogExt = "OSLogExt"
case parserFeature = "ParserFeature"
case quickSearchFeature = "QuickSearchFeature"
case readingFeature = "ReadingFeature"
Expand All @@ -110,7 +109,6 @@ enum Module: String {
case searchFeature = "SearchFeature"
case settingFeature = "SettingFeature"
case swiftUINavigationExt = "SwiftUINavigationExt"
case swiftyBeaverExt = "SwiftyBeaverExt"
case ttProgressHUDExt = "TTProgressHUDExt"
case tagTranslationFeature = "TagTranslationFeature"
case urlClient = "URLClient"
Expand All @@ -122,6 +120,7 @@ enum Module: String {
// Test targets
case parserFeatureTests = "ParserFeatureTests"
case downloadsFeatureTests = "DownloadsFeatureTests"
case settingFeatureTests = "SettingFeatureTests"
}

extension Module {
Expand Down Expand Up @@ -280,9 +279,9 @@ let targets: [PackageDescription.Target] = [
.module(.homeFeature),
.module(.imageClient),
.module(.libraryClient),
.module(.loggerClient),
.module(.migrationFeature),
.module(.networkingFeature),
.module(.osLogExt),
.module(.parserFeature),
.module(.quickSearchFeature),
.module(.readingFeature),
Expand All @@ -291,7 +290,6 @@ let targets: [PackageDescription.Target] = [
.module(.animatedImageFeature),
.module(.settingFeature),
.module(.swiftUINavigationExt),
.module(.swiftyBeaverExt),
.module(.ttProgressHUDExt),
.module(.urlClient),
.module(.userDefaultsClient),
Expand All @@ -309,7 +307,6 @@ let targets: [PackageDescription.Target] = [
.targetDependency(.sfSafeSymbols),
.targetDependency(.swiftUINavigation),
.targetDependency(.swiftUIPager),
.targetDependency(.swiftyBeaver),
.targetDependency(.ttProgressHUD),
.targetDependency(.uiImageColors),
.targetDependency(.waterfallGrid)
Expand All @@ -322,7 +319,7 @@ let targets: [PackageDescription.Target] = [
dependencies: [
.module(.appTools),
.module(.resources),
.module(.swiftyBeaverExt),
.module(.osLogExt),
.targetDependency(.casePaths)
],
swiftSettings: sharedSwiftSettings,
Expand Down Expand Up @@ -359,10 +356,10 @@ let targets: [PackageDescription.Target] = [
.module(.databaseClient),
.module(.libraryClient),
.module(.networkingFeature),
.module(.osLogExt),
.module(.parserFeature),
.module(.resources),
.module(.animatedImageFeature),
.module(.swiftyBeaverExt),
.module(.urlClient),
.targetDependency(.composableArchitecture),
.targetDependency(.kanna)
Expand Down Expand Up @@ -401,9 +398,7 @@ let targets: [PackageDescription.Target] = [
),
.target(
module: .appTools,
dependencies: [
.module(.swiftyBeaverExt)
],
dependencies: [],
swiftSettings: sharedSwiftSettings,
plugins: swiftLintPlugins
),
Expand Down Expand Up @@ -438,7 +433,7 @@ let targets: [PackageDescription.Target] = [
module: .backgroundProcessingClient,
dependencies: [
.module(.appModels),
.module(.swiftyBeaverExt),
.module(.osLogExt),
.targetDependency(.composableArchitecture)
],
swiftSettings: sharedSwiftSettings,
Expand Down Expand Up @@ -480,8 +475,8 @@ let targets: [PackageDescription.Target] = [
.module(.appModels),
.module(.appTools),
.module(.openCCExt),
.module(.osLogExt),
.module(.parserFeature),
.module(.swiftyBeaverExt),
.targetDependency(.composableArchitecture),
.targetDependency(.deprecatedAPI),
.targetDependency(.kanna)
Expand All @@ -494,7 +489,7 @@ let targets: [PackageDescription.Target] = [
dependencies: [
.module(.appModels),
.module(.appTools),
.module(.swiftyBeaverExt),
.module(.osLogExt),
.targetDependency(.composableArchitecture)
],
resources: [.process(.resources)],
Expand Down Expand Up @@ -579,9 +574,20 @@ let targets: [PackageDescription.Target] = [
plugins: swiftLintPlugins
),
.target(
module: .swiftyBeaverExt,
module: .osLogExt,
dependencies: [
.module(.appTools)
],
swiftSettings: sharedSwiftSettings,
plugins: swiftLintPlugins
),
.target(
module: .logsClient,
dependencies: [
.targetDependency(.swiftyBeaver)
.module(.appModels),
.module(.appTools),
.module(.osLogExt),
.targetDependency(.composableArchitecture)
],
swiftSettings: sharedSwiftSettings,
plugins: swiftLintPlugins
Expand Down Expand Up @@ -721,12 +727,12 @@ let targets: [PackageDescription.Target] = [
.module(.fileClient),
.module(.hapticsClient),
.module(.libraryClient),
.module(.loggerClient),
.module(.logsClient),
.module(.networkingFeature),
.module(.osLogExt),
.module(.readingSettingFeature),
.module(.resources),
.module(.swiftUINavigationExt),
.module(.swiftyBeaverExt),
.module(.ttProgressHUDExt),
.module(.userDefaultsClient),
.targetDependency(.composableArchitecture),
Expand Down Expand Up @@ -842,11 +848,11 @@ let targets: [PackageDescription.Target] = [
.module(.hapticsClient),
.module(.imageClient),
.module(.networkingFeature),
.module(.osLogExt),
.module(.readingSettingFeature),
.module(.resources),
.module(.animatedImageFeature),
.module(.swiftUINavigationExt),
.module(.swiftyBeaverExt),
.module(.ttProgressHUDExt),
.module(.urlClient),
.targetDependency(.composableArchitecture),
Expand Down Expand Up @@ -880,29 +886,18 @@ let targets: [PackageDescription.Target] = [
.targetDependency(.kingfisher),
.targetDependency(.sdWebImageSwiftUI),
.targetDependency(.sdWebImageWebPCoder),
.targetDependency(.swiftyBeaver),
.targetDependency(.uiImageColors)
],
swiftSettings: sharedSwiftSettings,
plugins: swiftLintPlugins
),
.target(
module: .loggerClient,
dependencies: [
.module(.appModels),
.module(.swiftyBeaverExt),
.targetDependency(.composableArchitecture)
],
swiftSettings: sharedSwiftSettings,
plugins: swiftLintPlugins
),
.target(
module: .parserFeature,
dependencies: [
.module(.appModels),
.module(.appTools),
.module(.resources),
.module(.swiftyBeaverExt),
.module(.osLogExt),
.targetDependency(.kanna)
],
swiftSettings: sharedSwiftSettings,
Expand Down Expand Up @@ -988,7 +983,6 @@ let targets: [PackageDescription.Target] = [
.module(.hapticsClient),
.module(.imageClient),
.module(.libraryClient),
.module(.loggerClient),
.module(.networkingFeature),
.module(.readingFeature),
.module(.urlClient),
Expand All @@ -999,6 +993,17 @@ let targets: [PackageDescription.Target] = [
],
swiftSettings: sharedSwiftSettings,
plugins: swiftLintPlugins
),
.testTarget(
module: .settingFeatureTests,
dependencies: [
.module(.appModels),
.module(.logsClient),
.module(.settingFeature),
.targetDependency(.composableArchitecture)
],
swiftSettings: sharedSwiftSettings,
plugins: swiftLintPlugins
)
]

Expand Down
3 changes: 0 additions & 3 deletions AppPackage/Sources/AppComponents/TagCloudView.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copied from https://stackoverflow.com/questions/62102647/
//

import SwiftUI
import SFSafeSymbols
import Kingfisher
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import AppModels
import SwiftUI
import BackgroundTasks
import SwiftyBeaver
import ComposableArchitecture
import AppTools
import AppDelegateClient
Expand All @@ -11,6 +10,9 @@ import DownloadClient
import BackgroundProcessingClient
import CookieClient
import MigrationFeature
import OSLogExt

private let logger = Logger(category: .init(describing: AppDelegateReducer.self))

@Reducer
struct AppDelegateReducer {
Expand All @@ -35,7 +37,6 @@ struct AppDelegateReducer {
switch action {
case .onLaunchFinish:
return .merge(
.run(operation: { _ in libraryClient.initializeLogger() }),
.run(operation: { _ in libraryClient.initializeWebImage() }),
.run(operation: { _ in cookieClient.removeYay() }),
.run(operation: { _ in cookieClient.syncExCookies() }),
Expand Down Expand Up @@ -92,13 +93,15 @@ public class AppDelegate: UIResponder, UIApplicationDelegate {
@Dependency(\.backgroundProcessingClient) var backgroundProcessingClient

let work = Task { @MainActor in
logger.notice("Background processing started.")
await downloadClient.runBackgroundProcessing()
// Reschedule only if we stopped on our own with work still pending; an
// expiration cancels this task and reschedules from its own handler.
if !Task.isCancelled, await downloadClient.hasPendingWork() {
backgroundProcessingClient.schedule()
}
task.setTaskCompleted(success: !Task.isCancelled)
logger.notice("Background processing finished, cancelled: \(Task.isCancelled, privacy: .public).")
}
task.expirationHandler = {
work.cancel()
Expand Down
Loading