chore: remove dead segments surface#1685
Conversation
Deletes the remaining segment list/create routes, the Segments UI components, segment-fans renderers, segment hooks, lib/segments, chat-segment lookup, segment MCP/AI tool wrappers, sidebar segment nav entries, and segment-related supabase helpers. The Segments feature is being removed entirely; the earlier migration plan is abandoned. Follows #1678 (segment report removal). Part of SEGMENTS_SURFACE_REMOVAL_PLAN.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis pull request removes the entire "segments" (fan groups) feature from the application, including API routes, React UI components, navigation items, database operations, AI tool integrations, and supporting hooks and utilities across the codebase. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
components/Sidebar/MiniMenu.tsx (1)
1-48: RemoveMiniMenucomponent—it's confirmed dead code with zero usages.The codebase search found no imports or references to this component anywhere. Following SOLID principles and YAGNI, maintaining an unused component adds unnecessary technical debt. Since this PR is already removing dead surfaces, removing
components/Sidebar/MiniMenu.tsxaligns with the cleanup effort.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@components/Sidebar/MiniMenu.tsx` around lines 1 - 48, Delete the unused MiniMenu component file: remove the entire MiniMenu component (functions/symbols: MiniMenu, goToItem, toggleMenuExpanded) since it has no imports/usages; ensure any exports/defaults referencing MiniMenu are removed and run a quick project build/search to confirm no remaining references before committing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@components/Sidebar/MiniMenu.tsx`:
- Around line 1-48: Delete the unused MiniMenu component file: remove the entire
MiniMenu component (functions/symbols: MiniMenu, goToItem, toggleMenuExpanded)
since it has no imports/usages; ensure any exports/defaults referencing MiniMenu
are removed and run a quick project build/search to confirm no remaining
references before committing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3194c5a9-bed4-49d4-9b1e-42f7122f64b1
⛔ Files ignored due to path filters (2)
public/segment.svgis excluded by!**/*.svgand included by nonetypes/fans.tsis excluded by none and included by none
📒 Files selected for processing (49)
app/api/segments/create/route.tsapp/api/segments/route.tsapp/segments/page.tsxcomponents/Segments/FanProfileHover.tsxcomponents/Segments/NoSegmentsFound.tsxcomponents/Segments/SegmentButton.tsxcomponents/Segments/SegmentFanCircles.tsxcomponents/Segments/Segments.tsxcomponents/Segments/SegmentsSkeleton.tsxcomponents/Segments/SegmentsWrapper.tsxcomponents/SideMenu/SideMenu.tsxcomponents/Sidebar/FanGroupNavItem.tsxcomponents/Sidebar/Menu.tsxcomponents/Sidebar/MiniMenu.tsxcomponents/Sidebar/SecondaryNav.tsxcomponents/VercelChat/ToolComponents.tsxcomponents/VercelChat/tools/segment-fans/EmptyState.tsxcomponents/VercelChat/tools/segment-fans/ErrorState.tsxcomponents/VercelChat/tools/segment-fans/FanCard.tsxcomponents/VercelChat/tools/segment-fans/GetSegmentFansResult.tsxcomponents/VercelChat/tools/segment-fans/GetSegmentFansResultSkeleton.tsxcomponents/VercelChat/tools/segment-fans/SegmentHeader.tsxcomponents/VercelChat/tools/segment-fans/animations.tshooks/useArtistSegments.tshooks/useChatSegment.tshooks/useCreateSegments.tshooks/useFansCSVExport.tsxlib/agent/getSegments.tsxlib/chats/getChatSegment.tslib/getFanSegments.tsxlib/getFunnelReport.tsxlib/segments/createSegmentResponses.tslib/segments/createSegments.tslib/segments/generateSegments.tslib/segments/getAnalysisPrompt.tslib/segments/getFanSegmentsToInsert.tslib/supabase/artist_segments/insertArtistSegments.tslib/supabase/fan_segments/insertFanSegments.tslib/supabase/fan_segments/selectFanSegments.tslib/supabase/getArtistSegmentNames.tslib/supabase/getArtistSegments.tslib/supabase/getSegmentCounts.tslib/supabase/segments/deleteSegments.tslib/supabase/segments/insertSegments.tslib/tools/createSegments.tslib/tools/getArtistSegments.tslib/tools/getMcpTools.tslib/tools/getSegmentFans.tslib/utils/getToolsInfo.ts
💤 Files with no reviewable changes (48)
- lib/utils/getToolsInfo.ts
- lib/getFunnelReport.tsx
- components/VercelChat/tools/segment-fans/ErrorState.tsx
- components/SideMenu/SideMenu.tsx
- components/Sidebar/Menu.tsx
- components/Sidebar/SecondaryNav.tsx
- lib/supabase/segments/insertSegments.ts
- lib/supabase/artist_segments/insertArtistSegments.ts
- components/VercelChat/ToolComponents.tsx
- components/VercelChat/tools/segment-fans/SegmentHeader.tsx
- components/Segments/Segments.tsx
- lib/tools/getArtistSegments.ts
- lib/supabase/getArtistSegmentNames.ts
- lib/supabase/fan_segments/insertFanSegments.ts
- lib/supabase/getSegmentCounts.ts
- components/VercelChat/tools/segment-fans/EmptyState.tsx
- hooks/useArtistSegments.ts
- lib/getFanSegments.tsx
- lib/supabase/fan_segments/selectFanSegments.ts
- components/Sidebar/FanGroupNavItem.tsx
- components/Segments/SegmentsSkeleton.tsx
- app/segments/page.tsx
- lib/tools/getMcpTools.ts
- components/Segments/NoSegmentsFound.tsx
- components/VercelChat/tools/segment-fans/animations.ts
- lib/segments/getFanSegmentsToInsert.ts
- lib/agent/getSegments.tsx
- lib/segments/generateSegments.ts
- hooks/useFansCSVExport.tsx
- components/VercelChat/tools/segment-fans/FanCard.tsx
- hooks/useCreateSegments.ts
- lib/chats/getChatSegment.ts
- components/Segments/SegmentButton.tsx
- lib/segments/getAnalysisPrompt.ts
- lib/tools/createSegments.ts
- lib/segments/createSegmentResponses.ts
- lib/supabase/getArtistSegments.ts
- components/VercelChat/tools/segment-fans/GetSegmentFansResult.tsx
- lib/supabase/segments/deleteSegments.ts
- components/Segments/SegmentsWrapper.tsx
- hooks/useChatSegment.ts
- components/Segments/FanProfileHover.tsx
- lib/tools/getSegmentFans.ts
- app/api/segments/route.ts
- components/VercelChat/tools/segment-fans/GetSegmentFansResultSkeleton.tsx
- app/api/segments/create/route.ts
- components/Segments/SegmentFanCircles.tsx
- lib/segments/createSegments.ts
There was a problem hiding this comment.
No issues found across 51 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Large-scale deletion of a feature (51 files, ~1800 lines) including API routes, hooks, and core navigation components. Decommissioning features requires human verification of dependencies.
Note: This PR contains a large number of files. During the trial, cubic reviews up to 50 files per PR. Paid plans get a higher limit.
Promote test → main: segments-surface cleanup (#1685)
Summary
app/api/segments/route.ts,app/api/segments/create/route.ts)app/segments/page.tsx) and thecomponents/Segments/*UI treecomponents/VercelChat/tools/segment-fans/*) and strips theirget_segment_fansbranches fromcomponents/VercelChat/ToolComponents.tsxuseArtistSegments,useCreateSegments,useChatSegment) and their library counterparts (lib/segments/*,lib/chats/getChatSegment.ts,lib/agent/getSegments.tsx,lib/getFanSegments.tsx,lib/getFunnelReport.tsx)create_segments,get_artist_segments,get_segment_fansfromlib/tools/getMcpTools.tsand deletes their wrappers (lib/tools/{createSegments,getArtistSegments,getSegmentFans}.ts)lib/utils/getToolsInfo.tsMenu.tsx,SecondaryNav.tsx,MiniMenu.tsx,SideMenu.tsx) and deletescomponents/Sidebar/FanGroupNavItem.tsx(its only role was rendering the segments nav entry)lib/supabase/getArtistSegments.ts,getArtistSegmentNames.ts,getSegmentCounts.ts, andartist_segments/fan_segments/segmentsdirectories)hooks/useFansCSVExport.tsx(no surviving callers once segments UI is gone) and prunes the now-orphanFan,FanResponse,Pagination,SegmentFansResulttypes fromtypes/fans.ts(keptFAN_TYPE, still used bytypes/Artist.tsx)public/segment.svgContext
The Segments surface is being removed entirely from chat, api, and docs. The earlier migration effort (docs #135, #136, api #443, #444, chat #1679, #1680) was abandoned and those PRs were closed unmerged.
Preceded by:
Related PRs (merge this one first so subsequent steps don't break the UI):
Explicit non-scope:
lib/chat/assistant/messageSegmentation.tsis AI message chunking, unrelated to fan segments; left untouched.lib/chat/generateChatTitle.tshas a prompt mentioning "segment name"; harmless text, left untouched.lib/chat/getFunnelAnalysis.tsxreadsfunnel_analytics_segments— funnel analytics, not fan segments; untouched.types/Agent.tsx/types/Funnel.tsxSEGMENTtypes are funnel-analytics shapes; untouched.types/database.types.tsstill listssegments,artist_segments,fan_segments,segment_rooms,segment_reports, andartist_fan_segment— these get regenerated after the database drop migration.Test plan
app components hooks lib providersfor every segment patternnpx eslint app components hooks lib providers: 8 errors / 11 warnings (down fromtestbaseline of 10 errors / 12 warnings — net improvement, no new errors)npx tsc --noEmit: same pre-existing errors astestbaseline (SpotifyDeepResearchResult PNG import, extractSendEmailResults test fixtures) — no new errorspnpm buildfails only on pre-existing missing Supabase env-var errors (same astestbaseline)Notes
hooks/useFansCSVExport.tsxand the segment-specific types intypes/fans.tsbecame dead once the Segments UI was deleted, so they are removed in this PR rather than left orphan.