ccstatusline icon indicating copy to clipboard operation
ccstatusline copied to clipboard

feat: add Tasks and Tools session widgets

Open cnscud opened this issue 7 months ago • 0 comments

Summary

  • add a cached transcript activity parser for main-session task and tool state
  • add Tasks and Tools widgets and register them in the widget picker
  • add test coverage for transcript parsing and widget rendering

What this adds

Tasks widget

  • reads TodoWrite, TaskCreate, and TaskUpdate from the main session transcript
  • shows the current in-progress task with (completed/total) progress
  • shows done (x/x) when all tasks are completed
  • hides itself when there are no tasks

Tools widget

  • reads tool activity from the main session transcript only
  • shows currently running tools first
  • shows a compact summary of completed/error tool usage counts

Implementation notes

  • transcript parsing lives in src/utils/transcript-activity.ts
  • parsing results are cached to avoid repeated transcript work on statusline renders
  • both widgets are registered through the existing widget manifest and picker flow
  • existing Current Working Dir behavior is unchanged

Reference

This implementation was informed by the claude-hud project, especially its transcript-driven handling of task and tool activity. The implementation here adapts those ideas to ccstatusline's existing widget and manifest architecture rather than copying the original rendering structure directly.

Files

  • src/utils/transcript-activity.ts
  • src/utils/__tests__/transcript-activity.test.ts
  • src/widgets/Tasks.ts
  • src/widgets/Tools.ts
  • src/widgets/__tests__/Tasks.test.ts
  • src/widgets/__tests__/Tools.test.ts
  • src/utils/widget-manifest.ts
  • src/widgets/index.ts

Test plan

  • [x] run bun run lint
  • [x] run bun test

cnscud avatar Apr 16 '26 13:04 cnscud