Keep per-kind facts on SourceKind and the Briefing's input in one place (review items 4, 5, 6, 7)
- SourceKind carries whether it feeds the Briefing, its fixed time window (Learning, Fun) and whether reading is picture-led (Fun); windowOf and the reader read from it. - AppState.briefingArticles is the one place that says only News sources feed the Briefing; generateBriefing and the Briefing tab use it. - articlesOf, hiddenCountOf and briefingArticles share one filter. - FeedService.fetchAll takes windowOf: like AppState.windowOf. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
49982c5467
commit
246564f1d9
8 files changed
+80
-30
No files matched your search
+19
-4
@@ -11,13 +11,28 @@ enum SourceLanguage {
|
||||
/// What a Source's articles are for; see GLOSSARY.md. Each kind has its own
|
||||
/// section in the app and its own time window.
|
||||
enum SourceKind {
|
||||
news('News'),
|
||||
learning('Learning'),
|
||||
fun('Fun');
|
||||
news('News', feedsBriefing: true),
|
||||
learning('Learning', fixedWindow: Duration(days: 14)),
|
||||
fun('Fun', fixedWindow: Duration(days: 3), pictureLed: true);
|
||||
|
||||
const SourceKind(this.label);
|
||||
const SourceKind(
|
||||
this.label, {
|
||||
this.feedsBriefing = false,
|
||||
this.fixedWindow,
|
||||
this.pictureLed = false,
|
||||
});
|
||||
|
||||
final String label;
|
||||
|
||||
/// Only News sources feed the Briefing.
|
||||
final bool feedsBriefing;
|
||||
|
||||
/// How far back articles reach; null where the user sets it (News).
|
||||
final Duration? fixedWindow;
|
||||
|
||||
/// Comics and memes are the picture: the reader shows it whole in the body
|
||||
/// rather than as a cropped banner.
|
||||
final bool pictureLed;
|
||||
}
|
||||
|
||||
/// A Source of any [kind]; see GLOSSARY.md.
|
||||
|
||||
Reference in new issue
Block a user