Draft
Conversation
Add comprehensive hooks system with: - HooksService for managing hook configurations - hooks-file-parser for parsing hook definition files - Complete HooksSettings UI components including: - CreateHookDialog, DeleteHookDialog - HookActionEditor, HookCommandTab, HookConfigTab - HookEventGroup, HookItem, HookLogsTab - HookSessionMatchers, HookToolMatchers - Custom hooks (useDebouncedCallback, useHookDragDrop, etc.) - TypeScript types for hooks in packages/types - Integration with ClineProvider and webviewMessageHandler - Updated settings.json translations
Add runtime guards in 5 hooks message handlers to reject 'built-in' source before calling HooksService methods. This fixes TypeScript error where message.source has type 'global | project | built-in' but HooksService methods only accept 'global | project'. Built-in hooks are read-only and cannot be modified, deleted, reordered, moved, or have their folder opened. Handlers updated: - hooks/save - hooks/delete - hooks/reorder - hooks/move - hooks/openFolder
Contributor
Review of latest changes complete. No new issues found. 1 previously flagged issue remains unresolved.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Comment on lines
+108
to
+111
| const stripMetadata = useCallback((hook: HookWithMetadata): HookConfig => { | ||
| const { source: _source, filePath: _filePath, ...config } = hook | ||
| return config as HookConfig | ||
| }, []) |
Contributor
There was a problem hiding this comment.
The stripMetadata function strips source and filePath but leaves eventType in the resulting object. Since HookWithMetadata extends HookConfig with three metadata fields (eventType, source, filePath), all three should be stripped to return a valid HookConfig. The server-side version in hooks-file-parser.ts correctly strips all three fields, creating an inconsistency.
Suggested change
| const stripMetadata = useCallback((hook: HookWithMetadata): HookConfig => { | |
| const { source: _source, filePath: _filePath, ...config } = hook | |
| return config as HookConfig | |
| }, []) | |
| const stripMetadata = useCallback((hook: HookWithMetadata): HookConfig => { | |
| const { eventType: _eventType, source: _source, filePath: _filePath, ...config } = hook | |
| return config as HookConfig | |
| }, []) |
Fix it with Roo Code or mention @roomote and request a fix.
- Remove link icon from hook item header - Style source tag (project/global) as grey badge matching matchers - Change copy button to duplicate hook with unique ID suffix - Add open-in-editor functionality to navigate directly to hook in YAML - Change folder icon to file icon for the open button - Add HookItem component tests Changes: - packages/types: Add hooks/openFile message type - webviewMessageHandler: Handle hooks/openFile message - HooksService: Add openHookInEditor method - HooksSettings: Update copy and open handlers - HookItem: UI improvements and icon changes
- Move description text from SectionHeader to Section body - Remove matcher badges from HookItem display - Adjust action buttons positioning with ml-auto
- Style 'Add' button on each event to look like a proper button with variant='secondary' and hover:brightness-75 for darker hover effect - Remove redundant 'Create New Hook' button from footer toolbar - Clean up unused handleCreateNewHook callback and Plus import
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.
WIP - Ignore for now
Refines this PR
Related GitHub Issue
Closes: #
Roo Code Task Context (Optional)
Description
Test Procedure
Pre-Submission Checklist
Screenshots / Videos
Documentation Updates
Additional Notes
Get in Touch
Important
This pull request adds a comprehensive hooks management system to the webview UI, enabling users to create, edit, delete, and reorder hooks with drag-and-drop functionality and support for global and project-specific configurations.
HooksSettings.tsxwith support for creating, editing, deleting, and reordering hooks.@dnd-kitfor reordering hooks within and across event types.HookActionEditor,HookCommandTab,HookConfigTab,HookEventGroup,HookItem,HookLogsTab,HookSessionMatchers, andHookToolMatcherscomponents for detailed hook configuration.useHooks,useHookDragDrop,useHookValidation, anduseDebouncedCallbackhooks for managing hooks state and interactions.SettingsView.tsxto include a new "Hooks" section with a corresponding icon.settings.json.This description was created by
for a96c460. You can customize this summary. It will automatically update as commits are pushed.