From 8b95af9c49cd648910c696f9fe9232e9b264be5e Mon Sep 17 00:00:00 2001 From: Gigi Date: Sat, 18 Oct 2025 21:45:04 +0200 Subject: [PATCH] feat: add default explore scope setting Add user setting to control default visibility scope in /explore page. Changes: - Add defaultExploreScopeNostrverse/Friends/Mine to UserSettings type - Add "Default Explore Scope" setting in ReadingDisplaySettings UI - Update Explore component to use defaultExploreScope settings - Set default to friends-only (nostrverse: false, friends: true, mine: false) Users can now configure which content types (nostrverse/friends/mine) are visible by default when visiting the explore page, separate from the highlight visibility settings. --- src/components/Explore.tsx | 8 ++-- src/components/Settings.tsx | 3 ++ .../Settings/ReadingDisplaySettings.tsx | 39 +++++++++++++++++++ src/services/settingsService.ts | 4 ++ 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/src/components/Explore.tsx b/src/components/Explore.tsx index 179af750..bf12f64e 100644 --- a/src/components/Explore.tsx +++ b/src/components/Explore.tsx @@ -47,11 +47,11 @@ const Explore: React.FC = ({ relayPool, eventStore, settings, acti const [myHighlights, setMyHighlights] = useState([]) const [myHighlightsLoading, setMyHighlightsLoading] = useState(false) - // Visibility filters (defaults from settings, or friends only) + // Visibility filters (defaults from settings) const [visibility, setVisibility] = useState({ - nostrverse: settings?.defaultHighlightVisibilityNostrverse ?? false, - friends: settings?.defaultHighlightVisibilityFriends ?? true, - mine: settings?.defaultHighlightVisibilityMine ?? false + nostrverse: settings?.defaultExploreScopeNostrverse ?? false, + friends: settings?.defaultExploreScopeFriends ?? true, + mine: settings?.defaultExploreScopeMine ?? false }) // Subscribe to highlights controller diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 653697a5..97a4371d 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -29,6 +29,9 @@ const DEFAULT_SETTINGS: UserSettings = { defaultHighlightVisibilityNostrverse: true, defaultHighlightVisibilityFriends: true, defaultHighlightVisibilityMine: true, + defaultExploreScopeNostrverse: false, + defaultExploreScopeFriends: true, + defaultExploreScopeMine: false, zapSplitHighlighterWeight: 50, zapSplitBorisWeight: 2.1, zapSplitAuthorWeight: 50, diff --git a/src/components/Settings/ReadingDisplaySettings.tsx b/src/components/Settings/ReadingDisplaySettings.tsx index 15565f79..862e2a1d 100644 --- a/src/components/Settings/ReadingDisplaySettings.tsx +++ b/src/components/Settings/ReadingDisplaySettings.tsx @@ -98,6 +98,45 @@ const ReadingDisplaySettings: React.FC = ({ setting +
+ +
+ onUpdate({ defaultExploreScopeNostrverse: !(settings.defaultExploreScopeNostrverse !== false) })} + title="Nostrverse content" + ariaLabel="Toggle nostrverse content by default in explore" + variant="ghost" + style={{ + color: (settings.defaultExploreScopeNostrverse !== false) ? 'var(--highlight-color-nostrverse, #9333ea)' : undefined, + opacity: (settings.defaultExploreScopeNostrverse !== false) ? 1 : 0.4 + }} + /> + onUpdate({ defaultExploreScopeFriends: !(settings.defaultExploreScopeFriends !== false) })} + title="Friends content" + ariaLabel="Toggle friends content by default in explore" + variant="ghost" + style={{ + color: (settings.defaultExploreScopeFriends !== false) ? 'var(--highlight-color-friends, #f97316)' : undefined, + opacity: (settings.defaultExploreScopeFriends !== false) ? 1 : 0.4 + }} + /> + onUpdate({ defaultExploreScopeMine: !(settings.defaultExploreScopeMine !== false) })} + title="My content" + ariaLabel="Toggle my content by default in explore" + variant="ghost" + style={{ + color: (settings.defaultExploreScopeMine !== false) ? 'var(--highlight-color-mine, #eab308)' : undefined, + opacity: (settings.defaultExploreScopeMine !== false) ? 1 : 0.4 + }} + /> +
+
+
diff --git a/src/services/settingsService.ts b/src/services/settingsService.ts index a36c7879..54c278a6 100644 --- a/src/services/settingsService.ts +++ b/src/services/settingsService.ts @@ -36,6 +36,10 @@ export interface UserSettings { defaultHighlightVisibilityNostrverse?: boolean defaultHighlightVisibilityFriends?: boolean defaultHighlightVisibilityMine?: boolean + // Default explore scope + defaultExploreScopeNostrverse?: boolean + defaultExploreScopeFriends?: boolean + defaultExploreScopeMine?: boolean // Zap split weights (treated as relative weights, not strict percentages) zapSplitHighlighterWeight?: number // default 50 zapSplitBorisWeight?: number // default 2.1