Skip to content

refactor: simplify agent status code from /polish review - #60

Merged
aterrylu merged 1 commit into
mainfrom
terry/simplify-pr54-58
Mar 24, 2026
Merged

refactor: simplify agent status code from /polish review#60
aterrylu merged 1 commit into
mainfrom
terry/simplify-pr54-58

Conversation

@aterrylu

Copy link
Copy Markdown
Owner

Summary

Code simplifications from the /polish review of PRs #54-58. All functionality preserved.

  • hooks.ts: Extract constants, merge identical switch cases, simplify helpers
  • sessions.ts: Hoist hook config to module-level constants (no per-call recreation)
  • agent-status-icon.tsx: Pre-compute spinner geometry, extract StatusSvg component
  • Sidebar.tsx: Extract agentState local (eliminates 4 repeated map lookups)

🤖 Generated with Claude Code

- hooks.ts: extract DEFAULT_AGENT_STATE, CLEAR_TOOL constants;
  merge identical switch cases; simplify extractToolDetail
- sessions.ts: hoist HOOK_CMD/HOOK_ENTRY/HOOK_EVENTS to module-level
  constants (no per-call recreation)
- agent-status-icon.tsx: pre-compute spinner geometry at module level;
  extract StatusSvg component; remove double statusCategory() call
- Sidebar.tsx: extract agentState local (eliminates 4 repeated lookups)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aterrylu
aterrylu merged commit fb13cb7 into main Mar 24, 2026
1 check passed
@aterrylu
aterrylu deleted the terry/simplify-pr54-58 branch March 24, 2026 09:36
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