Skip to content

Remove unused market features and clean up dead code#7

Merged
chloeilabs merged 1 commit into
mainfrom
claude/audit-finance-dead-code-9INLI
Apr 17, 2026
Merged

Remove unused market features and clean up dead code#7
chloeilabs merged 1 commit into
mainfrom
claude/audit-finance-dead-code-9INLI

Conversation

@chloeilabs
Copy link
Copy Markdown
Owner

@chloeilabs chloeilabs commented Apr 17, 2026

Summary

This PR removes several unused market features and cleans up dead code across the codebase. The changes focus on eliminating API routes, UI components, and utility functions that are no longer actively used or referenced.

Key Changes

Removed Features

  • Market API Routes: Removed /api/market/screener and /api/market/dossier/[symbol] endpoints that were not being utilized
  • Stock Detail Sections: Removed StockPeersSection, StockCatalystsSection, and StockPlanLimitsSection components from stock detail pages
  • Stock Headline Component: Removed StockHeadline component from market primitives
  • Navigation Components: Removed StockSectionNav and SectionLoadingState from stock detail common utilities

Service Layer Cleanup

  • Market Service Data: Removed getStarterDatasetExplorerPageData function and related dataset query/result processing utilities from service-data.ts
  • Removed helper functions: buildSelectedQuery, coerceQueryFieldValue, normalizeDatasetRows, getDatasetColumns, fetchStarterDatasetResult, and related query string utilities

Thread Storage Cleanup

  • Removed legacy thread storage migration logic (loadMigratedLocalThreads, selectThreadsToPersist) from threads-storage.ts
  • Removed corresponding migration effect from threads-persistence.ts
  • Removed storage key constants from threads.ts

UI Component Cleanup

  • Removed unused popover sub-components (PopoverAnchor, PopoverHeader, PopoverTitle, PopoverDescription) from popover.tsx
  • Removed StockHeadline export from market primitives

Documentation & Configuration

  • Updated README.md to reflect removed market routes (/markets, /calendar, /screeners)
  • Removed next-themes dependency from package.json
  • Removed unused SVG asset type declaration
  • Removed unused CORE_INDEX_SYMBOLS constant
  • Removed unused market index barrel export file

Test Updates

  • Updated smoke tests to remove references to deleted components

Implementation Details

  • All removals are clean with no orphaned imports or references
  • The changes maintain backward compatibility for remaining features
  • Removed code was not actively used in the current codebase based on import analysis

https://claude.ai/code/session_01XFyaSgEtG2Wwxb1B5ZCgjC

Summary by CodeRabbit

  • New Features

    • Added routes for /history, /portfolio, and /settings.
    • Added ETF dossier route pattern.
  • Removed Features

    • Removed routes /markets, /calendar, and /screeners.
    • Removed stock peers, catalysts, and plan limits detail sections.
    • Removed stock section navigation and headline components.
    • Removed market screener API functionality.
  • Chores

    • Cleaned up theme and popover component dependencies.
    • Removed unused internal exports and module re-exports.

Drops orphaned routes (/api/market/dossier, /api/market/screener), the
unused next-themes dep, a catch-all lib/shared/markets barrel, a
*.svg type declaration with no importers, and several unused
exports/helpers across the stock-detail, markets service, popover, and
agent modules. Also retires the yurie_threads → finance_threads
localStorage migration shim since it no longer has a consumer, and
refreshes the README product routes to match the actual App Router
layout.

Verified with pnpm typecheck, lint, test, and build.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
finance Ready Ready Preview, Comment Apr 17, 2026 4:49am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c09080b6-b8e9-4be8-bed5-a0d34fa7fd50

📥 Commits

Reviewing files that changed from the base of the PR and between 5ad1cb5 and 4f5bd7c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • README.md
  • package.json
  • src/app/(home)/__tests__/pages.smoke.test.tsx
  • src/app/api/market/dossier/[symbol]/route.ts
  • src/app/api/market/screener/route.ts
  • src/components/agent/home/agent-session-helpers.ts
  • src/components/agent/home/home-agent-utils.ts
  • src/components/agent/home/threads-persistence.ts
  • src/components/agent/home/threads-storage.ts
  • src/components/markets/stocks/stock-detail-common.tsx
  • src/components/markets/stocks/stock-detail-dossier-sections.tsx
  • src/components/markets/stocks/stock-detail-sections.tsx
  • src/components/markets/ui/market-primitives.tsx
  • src/components/markets/ui/market-stock-primitives.tsx
  • src/components/ui/popover.tsx
  • src/lib/server/markets/service-data.ts
  • src/lib/server/markets/service-dossier.ts
  • src/lib/server/markets/service-support.ts
  • src/lib/shared/markets/index.ts
  • src/lib/shared/threads.ts
  • src/types/assets.d.ts
💤 Files with no reviewable changes (14)
  • package.json
  • src/types/assets.d.ts
  • src/app/(home)/tests/pages.smoke.test.tsx
  • src/lib/shared/markets/index.ts
  • src/components/agent/home/threads-storage.ts
  • src/lib/shared/threads.ts
  • src/lib/server/markets/service-support.ts
  • src/lib/server/markets/service-data.ts
  • src/components/markets/ui/market-stock-primitives.tsx
  • src/app/api/market/dossier/[symbol]/route.ts
  • src/components/markets/stocks/stock-detail-sections.tsx
  • src/app/api/market/screener/route.ts
  • src/components/agent/home/home-agent-utils.ts
  • src/components/markets/stocks/stock-detail-dossier-sections.tsx

📝 Walkthrough

Walkthrough

This PR removes deprecated market features and APIs (/markets, /calendar, /screeners routes), eliminates stock detail components (peers, catalysts, plan limits navigation), removes thread migration logic, consolidates shared constants, and cleans up unused dependencies and type exports.

Changes

Cohort / File(s) Summary
Route and API Cleanup
README.md, src/app/api/market/dossier/[symbol]/route.ts, src/app/api/market/screener/route.ts
Updated documented product routes; removed market dossier and screener API endpoints entirely.
Stock Detail Component Removals
src/components/markets/stocks/stock-detail-common.tsx, src/components/markets/stocks/stock-detail-dossier-sections.tsx, src/components/markets/stocks/stock-detail-sections.tsx
Deleted exports for StockSectionNav, SectionLoadingState, StockPeersSection, StockCatalystsSection, and StockPlanLimitsSection. Trimmed re-export index.
Market Primitives and UI
src/components/markets/ui/market-primitives.tsx, src/components/markets/ui/market-stock-primitives.tsx, src/components/ui/popover.tsx
Removed StockHeadline component and popover wrapper exports (PopoverAnchor, PopoverHeader, PopoverTitle, PopoverDescription).
Market Services Cleanup
src/lib/server/markets/service-data.ts, src/lib/server/markets/service-dossier.ts, src/lib/server/markets/service-support.ts
Removed starter dataset explorer functionality, getStockOverviewCore re-export, and core index/sector constants.
Shared Constants and Exports
src/lib/shared/markets/index.ts, src/lib/shared/threads.ts, src/types/assets.d.ts
Removed wildcard market module re-exports, thread storage keys, and SVG asset type declaration.
Thread Persistence Simplification
src/components/agent/home/threads-persistence.ts, src/components/agent/home/threads-storage.ts
Removed thread migration and local persistence logic; deleted loadMigratedLocalThreads and selectThreadsToPersist functions.
Agent Utilities Refactoring
src/components/agent/home/agent-session-helpers.ts, src/components/agent/home/home-agent-utils.ts
Moved ASSISTANT_EMPTY_RESPONSE_FALLBACK constant to shared lib; removed local export.
Dependencies and Tests
package.json, src/app/(home)/__tests__/pages.smoke.test.tsx
Removed next-themes dependency; updated test mocks to reflect removed stock components.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hop, hop—the old paths fade away,
No more screeners clouding the day,
We trim the branches, streamline the code,
A lighter road for each new episode!
Thread by thread, we thread it right,
Building cleaner futures tonight. 🌙

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main objective of the PR: removing unused market features and dead code, which is the core purpose of all changes across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/audit-finance-dead-code-9INLI

Comment @coderabbitai help to get the list of available commands and usage tips.

Repository owner deleted a comment from chatgpt-codex-connector Bot Apr 17, 2026
@chloeilabs chloeilabs merged commit ecd3120 into main Apr 17, 2026
6 checks passed
@chloeilabs chloeilabs deleted the claude/audit-finance-dead-code-9INLI branch April 17, 2026 05:00
chloeilabs added a commit that referenced this pull request Apr 17, 2026
…9INLI

Remove unused market features and clean up dead code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants