From 24b111396e1f9323608674a6264a94c1903c7f5d Mon Sep 17 00:00:00 2001 From: limina1 Date: Tue, 17 Jun 2025 20:21:25 -0400 Subject: [PATCH] Set kind 3 (follow lists) default limit to 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change default follow list limit from 1 to 0 - Add explicit check to skip fetching when limit is 0 - This prevents unnecessary profile fetching on initial load - When users change limit to >0, then all follow list profiles are fetched This provides the optimal default behavior: - Initial load only fetches profiles from event authors - Users can opt-in to social graph by increasing follow list limit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/stores/visualizationConfig.ts | 4 ++-- src/routes/visualize/+page.svelte | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/stores/visualizationConfig.ts b/src/lib/stores/visualizationConfig.ts index 9928797..1a49b1f 100644 --- a/src/lib/stores/visualizationConfig.ts +++ b/src/lib/stores/visualizationConfig.ts @@ -27,8 +27,8 @@ export interface VisualizationConfig { // Default configurations for common event kinds const DEFAULT_EVENT_CONFIGS: EventKindConfig[] = [ - { kind: 0, limit: 50 }, // Metadata events (profiles) - controls how many profiles to fetch - { kind: 3, limit: 1, depth: 0 }, // Follow lists - limit 1 = just user's, higher = user's + from follows + { kind: 0, limit: 50 }, // Metadata events (profiles) - controls how many profiles to display + { kind: 3, limit: 0, depth: 0 }, // Follow lists - limit 0 = don't fetch, >0 = fetch follow lists { kind: 30040, limit: 20, nestedLevels: 1 }, { kind: 30041, limit: 20 }, { kind: 30818, limit: 20 }, diff --git a/src/routes/visualize/+page.svelte b/src/routes/visualize/+page.svelte index 62885d0..7ee9e7f 100644 --- a/src/routes/visualize/+page.svelte +++ b/src/routes/visualize/+page.svelte @@ -83,7 +83,13 @@ const allFollowEvents: NDKEvent[] = []; const processedPubkeys = new Set(); - debug(`Fetching kind 3 follow lists with depth ${depth}, addFollowLists: ${config.addFollowLists}`); + debug(`Fetching kind 3 follow lists with limit ${config.limit}, depth ${depth}`); + + // If limit is 0, don't fetch any follow lists + if (config.limit === 0) { + debug("Follow list limit is 0, skipping fetch"); + return []; + } // Get the current user's pubkey const currentUserPubkey = get(activePubkey);