Skip to content

perf: lazy-load commands and show early spinner for instant feedback#65

Merged
scottlovegrove merged 2 commits intomainfrom
scottl/perf-improvements
Feb 13, 2026
Merged

perf: lazy-load commands and show early spinner for instant feedback#65
scottlovegrove merged 2 commits intomainfrom
scottl/perf-improvements

Conversation

@scottlovegrove
Copy link
Collaborator

@scottlovegrove scottlovegrove commented Feb 13, 2026

Summary

  • Lazy-load command modules: Instead of importing all 19 command modules at startup, src/index.ts now registers lightweight placeholders and only import()s the module for the invoked command. Cuts td --version from ~400ms to ~75ms.
  • Early spinner for instant feedback: A "Loading..." spinner starts immediately before the dynamic import, so there's zero visual silence. It seamlessly hands off to each API call's spinner (text updates in-place without flicker), stays running through all API calls via a release-back mechanism, and auto-clears the moment stdout is written to.
  • Add getTasksByFilter to spinner map: Commands using getTasksByFilter (td today, td upcoming, td filter show) previously showed no spinner at all during their API call — now they do.

Test plan

  • npm run build compiles cleanly
  • npm test — all 680 tests pass
  • td today shows spinner immediately, stays running through all API calls, clears cleanly before output
  • td today --json shows no spinner
  • td --version still fast (~75ms, no spinner)
  • td --help lists all commands

🤖 Generated with Claude Code

@scottlovegrove scottlovegrove self-assigned this Feb 13, 2026
@scottlovegrove scottlovegrove force-pushed the scottl/perf-improvements branch from 2c3c6df to 7585d7b Compare February 13, 2026 16:14
Copy link

@doist-bot doist-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request significantly enhances the CLI's performance and user experience by lazy-loading command modules and introducing an early-loading spinner for instant feedback, notably speeding up td --version and ensuring consistent visual cues during API calls. A minor command parsing edge case was noted, where an option's value might be mistaken for a command when using --progress-jsonl with a space-separated argument.

Share FeedbackReview Logs

scottlovegrove and others added 2 commits February 13, 2026 16:20
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…I calls

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@scottlovegrove scottlovegrove force-pushed the scottl/perf-improvements branch from 7585d7b to f5181c0 Compare February 13, 2026 16:21
@scottlovegrove scottlovegrove requested review from a team and pauloslund and removed request for a team February 13, 2026 16:37
@scottlovegrove scottlovegrove added the 👀 Show PR PR must be reviewed before or after merging label Feb 13, 2026
@scottlovegrove scottlovegrove merged commit 9a9b79a into main Feb 13, 2026
3 checks passed
@scottlovegrove scottlovegrove deleted the scottl/perf-improvements branch February 13, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments