Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 46d5c9a

Browse files
committed
refactor: improve HooksSettings UI layout
- Move description text from SectionHeader to Section body - Remove matcher badges from HookItem display - Adjust action buttons positioning with ml-auto
1 parent bbced2b commit 46d5c9a

2 files changed

Lines changed: 7 additions & 30 deletions

File tree

webview-ui/src/components/settings/HooksSettings.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,13 @@ export const HooksSettings: React.FC = () => {
176176
onDragEnd={handleDragEnd}
177177
onDragCancel={handleDragCancel}>
178178
<div>
179-
<SectionHeader description="Hooks execute custom shell commands automatically when Roo uses specific tools. Use them to integrate with external systems, enforce workflows, or automate repetitive tasks.">
180-
Hooks
181-
</SectionHeader>
179+
<SectionHeader>Hooks</SectionHeader>
182180

183181
<Section>
182+
<p className="text-sm text-vscode-descriptionForeground mb-4">
183+
Hooks execute custom shell commands automatically when Roo uses specific tools. Use them to
184+
integrate with external systems, enforce workflows, or automate repetitive tasks.
185+
</p>
184186
{/* Global Enable Toggle */}
185187
<SearchableSetting settingId="hooks-enable" section="hooks" label="Enable Hooks" className="mb-4">
186188
<div className="flex items-center gap-2">

webview-ui/src/components/settings/HooksSettings/HookItem.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,6 @@ export const HookItem: React.FC<HookItemProps> = ({
5252
transition,
5353
}
5454

55-
// Get matcher badges for display
56-
const getMatcherBadges = (): string[] => {
57-
if (!hook.matchers) return []
58-
59-
if ("tools" in hook.matchers && hook.matchers.tools) {
60-
return hook.matchers.tools
61-
}
62-
63-
if ("sessionType" in hook.matchers && hook.matchers.sessionType) {
64-
return hook.matchers.sessionType
65-
}
66-
67-
return []
68-
}
69-
70-
const matcherBadges = getMatcherBadges()
71-
7255
return (
7356
<div
7457
ref={setNodeRef}
@@ -105,19 +88,11 @@ export const HookItem: React.FC<HookItemProps> = ({
10588
)}
10689
{/* Hook name */}
10790
<span className="font-mono text-sm text-vscode-foreground">{hook.name}</span>
108-
{/* Matcher badges */}
109-
{matcherBadges.length > 0 && (
110-
<div className="flex gap-1">
111-
<span className="text-xs bg-vscode-badge-background text-vscode-badge-foreground px-1.5 py-0.5 rounded">
112-
{matcherBadges.join("|")}
113-
</span>
114-
</div>
115-
)}
11691
{/* Source badge */}
117-
<span className="text-xs bg-vscode-badge-background text-vscode-badge-foreground px-1.5 py-0.5 rounded ml-auto">
92+
<span className="text-xs bg-vscode-badge-background text-vscode-badge-foreground px-1.5 py-0.5 rounded">
11893
{hook.source}
11994
</span>
120-
<div className="flex items-center gap-1" onClick={(e) => e.stopPropagation()}>
95+
<div className="flex items-center gap-1 ml-auto" onClick={(e) => e.stopPropagation()}>
12196
<Button
12297
variant="ghost"
12398
size="icon"

0 commit comments

Comments
 (0)