From 338f7e01f4625dce62c7783e6a0eccf94de675d8 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 28 Mar 2026 17:32:57 +0100 Subject: [PATCH] scaffolder: use sidebar layout for actions page detail view Replace accordion groups with plain titled sections for action input/output/examples, and switch to a sidebar layout where the action list remains visible when viewing action details. Signed-off-by: Patrik Oldsberg Made-with: Cursor --- .../components/ActionsPage/ActionsPage.tsx | 196 +++++++++--------- 1 file changed, 102 insertions(+), 94 deletions(-) diff --git a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx index 98beeaa997..df8ca2d760 100644 --- a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx +++ b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx @@ -25,17 +25,7 @@ import { Header, Page, } from '@backstage/core-components'; -import { - Accordion, - AccordionGroup, - AccordionPanel, - AccordionTrigger, - Flex, - List, - ListRow, - SearchField, - Text, -} from '@backstage/ui'; +import { Box, Flex, List, ListRow, SearchField, Text } from '@backstage/ui'; import { ScaffolderPageContextMenu } from '@backstage/plugin-scaffolder-react/alpha'; import { useNavigate } from 'react-router-dom'; import { @@ -66,46 +56,46 @@ function ActionDetail({ action }: { action: Action }) { } return ( - + {hasInput && ( - - - - - - + + + {t('actionsPage.action.input')} + + + )} {hasOutput && ( - - - - - - + + + {t('actionsPage.action.output')} + + + )} {hasExamples && ( - - - - - - + + + {t('actionsPage.action.examples')} + + + )} - + ); } @@ -176,57 +166,75 @@ export const ActionPageContent = () => { ); } - return ( - - - { - if (selection === 'all') { - return; + const listElement = ( + { + if (selection === 'all') { + return; + } + const selected = [...selection][0] as string | undefined; + setSelectedActionId(prev => (prev === selected ? undefined : selected)); + }} + > + {filteredActions.map(action => ( + - prev === selected ? undefined : selected, - ); - }} - > - {filteredActions.map(action => ( - - {action.id} - - ))} - - {selectedAction && ( - - - - {selectedAction.id} - - {selectedAction.description && ( - - {selectedAction.description} - - )} - - + > + {action.id} + + ))} + + ); + + if (!selectedAction) { + return ( + + + {listElement} + + ); + } + + return ( + + + + + {listElement} - )} + + + + + {selectedAction.id} + + {selectedAction.description && ( + + {selectedAction.description} + + )} + + + ); };