diff --git a/src/ui/locales/en.json b/src/ui/locales/en.json index 3f729f75..64d3017c 100644 --- a/src/ui/locales/en.json +++ b/src/ui/locales/en.json @@ -4286,6 +4286,8 @@ "expandAppRailOnHoverDesc": "Allow the left sidebar app rail to expand when the pointer moves over it", "settingsNavigation": "Navigation", "navigationTabsDesc": "Choose which tabs appear in the app rail", + "showSnippetCommands": "Show Commands", + "showSnippetCommandsDesc": "Show each snippet's command under its name. Turn off for a compact list.", "foldersCollapsed": "Folders Collapsed", "foldersCollapsedDesc": "Collapse folders by default", "confirmExecution": "Confirm Execution", diff --git a/src/ui/sidebar/SnippetsPanel.tsx b/src/ui/sidebar/SnippetsPanel.tsx index 50bc8ebd..f2c7ff62 100644 --- a/src/ui/sidebar/SnippetsPanel.tsx +++ b/src/ui/sidebar/SnippetsPanel.tsx @@ -862,6 +862,7 @@ function ShareSnippetDialog({ function SnippetCard({ snippet, + showCommands, selectedTabIds, terminalTabs, activeTabId, @@ -879,6 +880,7 @@ function SnippetCard({ t, }: { snippet: Snippet; + showCommands: boolean; selectedTabIds: Set; terminalTabs: Tab[]; activeTabId: string; @@ -966,9 +968,11 @@ function SnippetCard({ /> )} - - {snippet.content} - + {showCommands && ( + + {snippet.content} + + )} {targetHosts.length > 0 && (
{targetHosts.map((host) => ( @@ -1246,6 +1250,7 @@ function ExecutionResultDialog({ function VirtualFolderGroup({ folderName, + showCommands, snippets: folderSnippets, selectedTabIds, terminalTabs, @@ -1266,6 +1271,7 @@ function VirtualFolderGroup({ open, onToggleOpen, }: { + showCommands: boolean; folderName: string; snippets: Snippet[]; selectedTabIds: Set; @@ -1312,6 +1318,7 @@ function VirtualFolderGroup({ > {folderSnippets.map((snippet) => ( localStorage.getItem("defaultSnippetFoldersCollapsed") !== "false", ); + // Compact list: names only, the command stays in the tooltip/editor. + const [showCommands, setShowCommands] = useState( + () => localStorage.getItem("snippetShowCommands") !== "false", + ); const [confirmExecution, setConfirmExecution] = useState( () => localStorage.getItem("confirmSnippetExecution") === "true", ); @@ -1961,6 +1972,20 @@ export function SnippetsPanel({ + + { + setShowCommands(v); + localStorage.setItem("snippetShowCommands", v.toString()); + }} + /> + {uncategorizedSnippets.map((snippet) => ( {folderSnippets.map((snippet) => (