feat: add hooks configuration section to TUI settings#3
Merged
Conversation
Add a user-friendly hooks configuration section to the Settings dialog that allows users to view and edit hook commands for all 4 lifecycle events: post-create, post-select, post-delete, and post-rename. Features: - Display single commands inline (e.g., "npm install") - Display multi-command hooks as numbered list with "[N commands]" - Edit hooks with Tab to add lines, j/k to navigate, d to delete - Support for both global hooks and per-repo hook overrides - Show "(not set)" for undefined hooks Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove flaky tests that depended on writing/reading config files. The tests now verify the UI structure (hooks section, all 4 hook types, help text) without relying on specific config values. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add HookType, HookCommand, and HooksSchema types to config.ts to support hooks configuration in the TUI settings dialog. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add complete hooks system that executes shell commands on worktree lifecycle events (post-create, post-select, post-delete, post-rename). - Add hooks.ts with hook execution logic, environment variables, timeout support - Integrate hooks into commands (new, rm, mv) and TUI (App, CreateDialog, DeleteConfirm) - Add execShellCommand utility to compat.ts for cross-platform shell execution - Add comprehensive tests for hooks functionality Environment variables available to hooks: - WT_NAME, WT_PATH, WT_BRANCH, WT_REPO_ID, WT_HOOK - WT_OLD_NAME, WT_OLD_PATH (for post-rename) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete hooks system for worktree lifecycle events:
Files changed
src/lib/config.tssrc/lib/hooks.tssrc/utils/compat.tssrc/commands/new.tssrc/commands/rm.tssrc/commands/mv.tssrc/tui/App.tsxsrc/tui/components/SettingsDialog.tsxsrc/tui/components/CreateDialog.tsxsrc/tui/components/DeleteConfirm.tsxTest plan
bun test- all 134 tests passbun run typecheck- passesbun run lint- passes🤖 Generated with Claude Code