From fab49e810b839caa80e63e4afa46e1d14f36bcab Mon Sep 17 00:00:00 2001 From: celestial-vault <58194240+celestial-vault@users.noreply.github.com> Date: Thu, 27 Nov 2025 12:32:17 -0600 Subject: [PATCH] Add fixed header to ClineRulesToggleModal (#7729) - Add flex-shrink-0 to header section containing tabs and description text - Keep tabs and description visible when content area scrolls --- .../cline-rules/ClineRulesToggleModal.tsx | 538 +++++++++--------- 1 file changed, 275 insertions(+), 263 deletions(-) diff --git a/webview-ui/src/components/cline-rules/ClineRulesToggleModal.tsx b/webview-ui/src/components/cline-rules/ClineRulesToggleModal.tsx index d83303e4..fbf47e3f 100644 --- a/webview-ui/src/components/cline-rules/ClineRulesToggleModal.tsx +++ b/webview-ui/src/components/cline-rules/ClineRulesToggleModal.tsx @@ -378,7 +378,7 @@ const ClineRulesToggleModal: React.FC = () => { {isVisible && (
{ }} /> - {/* Tabs container */} -
+ {/* Fixed header section - tabs and description */} +
+ {/* Tabs container */}
- setCurrentView("rules")}> - Rules - - setCurrentView("workflows")}> - Workflows - - {hooksEnabled?.user && ( - setCurrentView("hooks")}> - Hooks +
+ setCurrentView("rules")}> + Rules - )} + setCurrentView("workflows")}> + Workflows + + {hooksEnabled?.user && ( + setCurrentView("hooks")}> + Hooks + + )} +
-
- {/* Remote config banner */} - {(currentView === "rules" && hasRemoteRules) || (currentView === "workflows" && hasRemoteWorkflows) ? ( -
- - - {currentView === "rules" - ? "Your organization manages some rules" - : "Your organization manages some workflows"} - -
- ) : null} - - {/* Description text */} -
- {currentView === "rules" ? ( -

- Rules allow you to provide Cline with system-level guidance. Think of them as a persistent way to - include context and preferences for your projects or globally for every conversation.{" "} - - Docs - -

- ) : currentView === "workflows" ? ( -

- Workflows allow you to define a series of steps to guide Cline through a repetitive set of tasks, - such as deploying a service or submitting a PR. To invoke a workflow, type{" "} - /workflow-name in the chat.{" "} - - Docs - -

- ) : ( -

- Hooks allow you to execute custom scripts at specific points in Cline's execution lifecycle, - enabling automation and integration with external tools. -

- )} -
- - {currentView === "rules" ? ( - <> - {/* Remote Rules Section */} - {hasRemoteRules && ( -
-
Enterprise Rules
-
- {remoteGlobalRules.map((rule) => { - const enabled = rule.alwaysEnabled || remoteRulesToggles[rule.name] === true - return ( - - ) - })} -
-
- )} - - {/* Global Rules Section */} -
-
Global Rules
- - {/* File-based Global Rules */} - toggleRule(true, rulePath, enabled)} - /> + {/* Remote config banner */} + {(currentView === "rules" && hasRemoteRules) || (currentView === "workflows" && hasRemoteWorkflows) ? ( +
+ + + {currentView === "rules" + ? "Your organization manages some rules" + : "Your organization manages some workflows"} +
+ ) : null} - {/* Local Rules Section */} -
-
Workspace Rules
- toggleRule(false, rulePath, enabled)} - /> - - - - -
- - ) : currentView === "workflows" ? ( - <> - {/* Remote Workflows Section */} - {hasRemoteWorkflows && ( -
-
Enterprise Workflows
-
- {remoteGlobalWorkflows.map((workflow) => { - const enabled = - workflow.alwaysEnabled || remoteWorkflowToggles[workflow.name] === true - return ( - - ) - })} -
-
- )} - - {/* Global Workflows Section */} -
-
Global Workflows
- - {/* File-based Global Workflows */} - toggleWorkflow(true, rulePath, enabled)} - /> -
- - {/* Local Workflows Section */} -
-
Workspace Workflows
- toggleWorkflow(false, rulePath, enabled)} - /> -
- - ) : ( - <> -
+ {/* Description text */} +
+ {currentView === "rules" ? (

- Toggle to enable/disable (chmod +x/-x).{" "} + Rules allow you to provide Cline with system-level guidance. Think of them as a persistent way + to include context and preferences for your projects or globally for every conversation.{" "} Docs

-
- {/* Hooks Tab */} - {/* Windows warning banner */} - {isWindows && ( -
- - - Hook toggling is not supported on Windows. Hooks can be created, edited, and deleted, but - cannot be enabled/disabled and will not execute. - -
+ ) : currentView === "workflows" ? ( +

+ Workflows allow you to define a series of steps to guide Cline through a repetitive set of + tasks, such as deploying a service or submitting a PR. To invoke a workflow, type{" "} + /workflow-name in the chat.{" "} + + Docs + +

+ ) : ( +

+ Hooks allow you to execute custom scripts at specific points in Cline's execution lifecycle, + enabling automation and integration with external tools. +

)} +
+
- {/* Global Hooks */} -
-
Global Hooks
-
- {globalHooks - .sort((a, b) => a.name.localeCompare(b.name)) - .map((hook) => ( - { - // Use response data directly, no need to refresh - setGlobalHooks(hooksToggles.globalHooks || []) - setWorkspaceHooks(hooksToggles.workspaceHooks || []) - }} - onToggle={(name: string, newEnabled: boolean) => - toggleHook(true, name, newEnabled) - } - /> - ))} - h.name)} isGlobal={true} ruleType="hook" /> + {/* Scrollable content area */} +
+ {currentView === "rules" ? ( + <> + {/* Remote Rules Section */} + {hasRemoteRules && ( +
+
Enterprise Rules
+
+ {remoteGlobalRules.map((rule) => { + const enabled = rule.alwaysEnabled || remoteRulesToggles[rule.name] === true + return ( + + ) + })} +
+
+ )} + + {/* Global Rules Section */} +
+
Global Rules
+ + {/* File-based Global Rules */} + toggleRule(true, rulePath, enabled)} + />
-
- {/* Workspace Hooks - one section per workspace */} - {workspaceHooks.map((workspace, index) => ( -
-
{workspace.workspaceName}/.clinerules/hooks/
+ {/* Local Rules Section */} +
+
Workspace Rules
+ toggleRule(false, rulePath, enabled)} + /> + + + + +
+ + ) : currentView === "workflows" ? ( + <> + {/* Remote Workflows Section */} + {hasRemoteWorkflows && ( +
+
Enterprise Workflows
+
+ {remoteGlobalWorkflows.map((workflow) => { + const enabled = + workflow.alwaysEnabled || remoteWorkflowToggles[workflow.name] === true + return ( + + ) + })} +
+
+ )} + + {/* Global Workflows Section */} +
+
Global Workflows
+ + {/* File-based Global Workflows */} + toggleWorkflow(true, rulePath, enabled)} + /> +
+ + {/* Local Workflows Section */} +
+
Workspace Workflows
+ toggleWorkflow(false, rulePath, enabled)} + /> +
+ + ) : ( + <> +
+

+ Toggle to enable/disable (chmod +x/-x).{" "} + + Docs + +

+
+ {/* Hooks Tab */} + {/* Windows warning banner */} + {isWindows && ( +
+ + + Hook toggling is not supported on Windows. Hooks can be created, edited, and deleted, + but cannot be enabled/disabled and will not execute. + +
+ )} + + {/* Global Hooks */} +
+
Global Hooks
- {workspace.hooks + {globalHooks .sort((a, b) => a.name.localeCompare(b.name)) .map((hook) => ( { // Use response data directly, no need to refresh setGlobalHooks(hooksToggles.globalHooks || []) setWorkspaceHooks(hooksToggles.workspaceHooks || []) }} onToggle={(name: string, newEnabled: boolean) => - toggleHook(false, name, newEnabled, workspace.workspaceName) + toggleHook(true, name, newEnabled) } - workspaceName={workspace.workspaceName} /> ))} h.name)} - isGlobal={false} + existingHooks={globalHooks.map((h) => h.name)} + isGlobal={true} ruleType="hook" - workspaceName={workspace.workspaceName} />
- ))} - - )} + + {/* Workspace Hooks - one section per workspace */} + {workspaceHooks.map((workspace, index) => ( +
+
+ {workspace.workspaceName}/.clinerules/hooks/ +
+
+ {workspace.hooks + .sort((a, b) => a.name.localeCompare(b.name)) + .map((hook) => ( + { + // Use response data directly, no need to refresh + setGlobalHooks(hooksToggles.globalHooks || []) + setWorkspaceHooks(hooksToggles.workspaceHooks || []) + }} + onToggle={(name: string, newEnabled: boolean) => + toggleHook(false, name, newEnabled, workspace.workspaceName) + } + workspaceName={workspace.workspaceName} + /> + ))} + h.name)} + isGlobal={false} + ruleType="hook" + workspaceName={workspace.workspaceName} + /> +
+
+ ))} + + )} +
)}