feat: multi-edge graph with date filtering and layout modes#67
feat: multi-edge graph with date filtering and layout modes#67
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| return { ...data, hidden: true } | ||
| } | ||
| // Use filtered weight for visual sizing | ||
| return { ...data, color: edgeBase(Math.min(0.6, 0.15 + filteredWeight * 0.05)) } |
There was a problem hiding this comment.
Edge reducer skips neighbor filter when date filter active
Medium Severity
When dateFilter is active and an edge passes the date range check (has a filteredWeight), the edgeReducer returns early with styling, completely skipping the selectedNeighbors check. This means that when a user has both a date filter and a clicked/focused node active simultaneously, nodes are correctly filtered by both criteria (the nodeReducer checks both), but edges only respect the date filter and ignore the node neighborhood selection. The old code's filteredPlayCounts block only returned early to hide edges, otherwise falling through to the selectedNeighbors check — so this is a regression.
| } | ||
| return c.json({ | ||
| nodes: paginatedNodes, | ||
| edges: graph.edges, |
There was a problem hiding this comment.
Paginated endpoint returns all edges regardless of node subset
Low Severity
When the /graph endpoint is called with pagination (limit > 0), graph.edges returns the entire edges array even though only a subset of nodes is included. Previously, edges were embedded in node data (next/previous maps), so pagination naturally scoped edges. Now that edges are a top-level array, a paginated response includes many edges referencing nodes absent from the response, producing an inconsistent payload and potentially transferring a lot of unnecessary data.
8664cb4 to
80dcf05
Compare
80dcf05 to
a6fa7eb
Compare


Summary
Test plan
pnpm test)🤖 Generated with Claude Code
Note
Medium Risk
Changes the core graph data model and SQLite schema (edges become per-transition timestamped events) and updates both API + frontend filtering/rendering to match, which could break existing data or assumptions if any consumers/migrations are missed.
Overview
Switches the listening graph from aggregated weighted edges to per-transition, timestamped edge events end-to-end. The pipeline now builds
ListeningGraph.edges[]as individual scrobble-to-scrobble transitions (with a 1-hour cutoff) and derivesnode.next/previousaggregates from those events.Reworks persistence and API shape accordingly. The SQLite
edgestable becomes append-only event rows withtimestamp(newidPK), node/source-related Spotify fields are removed,saveGraphwrites fresh after clearing, andGET /graphalways returns theedgesarray.Updates the frontend to aggregate and visualize multi-edges and support time-based exploration.
graphContextcollapses parallel edges into a single graphology edge carryingtimestamps[], the main route filters visibility/edge strength by date range using raw edge timestamps, enables edge hover events with a tooltip listing transition times, and keeps layout mode switching intact.Removes Spotify ingestion/config/tests and adds a
reindex.shhelper to wipe local DB/cache and run the Last.fm pipeline; stats/tests are updated to drop source breakdown and include the newedgesfield.Written by Cursor Bugbot for commit a6fa7eb. This will update automatically on new commits. Configure here.