Skip to content

refactor: extract inline handlers from registerActivityRoutes()#773

Merged
selfcontained merged 1 commit into
mainfrom
agt_b0736368bb02/job-debt-collector-89df3484
Jul 14, 2026
Merged

refactor: extract inline handlers from registerActivityRoutes()#773
selfcontained merged 1 commit into
mainfrom
agt_b0736368bb02/job-debt-collector-89df3484

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Extracted 14 inline route handler closures from the 673-line registerActivityRoutes() function in apps/server/src/routes/activity.ts into standalone named functions
  • registerActivityRoutes() is now ~30 lines — a clean route registration table that delegates to named handlers
  • Each handler (handleHeatmap, handleStats, handleDailyStatus, etc.) is independently readable and navigable
  • No behavior changes — pure structural refactor

Why this is tech debt

The single monolithic function made it hard to navigate to a specific route's implementation, understand its scope, or review changes to one route without scrolling past all the others. Named functions also show up in IDE outlines and stack traces.

What's next

Next debt-collector run will tackle extracting handler functions from createMcpHandlers() in apps/server/src/server/mcp-handlers.ts (same pattern — inline handlers in a single 560-line function).

🤖 Generated with Claude Code

The 673-line registerActivityRoutes() function had all route handlers
defined inline. Each handler is now a standalone named function,
reducing the registration function to ~30 lines and making individual
handlers independently readable and navigable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@selfcontained selfcontained merged commit 62381b6 into main Jul 14, 2026
1 check passed
@selfcontained selfcontained deleted the agt_b0736368bb02/job-debt-collector-89df3484 branch July 14, 2026 09:12
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.

1 participant