diff --git a/components/icons/ChevronsDownIcon.tsx b/components/icons/ChevronsDownIcon.tsx new file mode 100644 index 0000000..a6939d2 --- /dev/null +++ b/components/icons/ChevronsDownIcon.tsx @@ -0,0 +1,72 @@ +import React, { useContext } from 'react'; +import { IconContext } from '../../contexts/IconContext'; + +const LucideChevronsDownIcon: React.FC> = (props) => ( + + + + +); + +const FeatherChevronsDownIcon: React.FC> = (props) => ( + + + + +); + +const TablerChevronsDownIcon: React.FC> = (props) => ( + + + + + +); + +export const ChevronsDownIcon: React.FC> = (props) => { + const iconSet = useContext(IconContext); + switch (iconSet) { + case 'lucide': + return ; + case 'tabler': + return ; + case 'remix': + return ; + case 'feather': + default: + return ; + } +}; diff --git a/components/icons/ChevronsUpIcon.tsx b/components/icons/ChevronsUpIcon.tsx new file mode 100644 index 0000000..2a9bee5 --- /dev/null +++ b/components/icons/ChevronsUpIcon.tsx @@ -0,0 +1,72 @@ +import React, { useContext } from 'react'; +import { IconContext } from '../../contexts/IconContext'; + +const LucideChevronsUpIcon: React.FC> = (props) => ( + + + + +); + +const FeatherChevronsUpIcon: React.FC> = (props) => ( + + + + +); + +const TablerChevronsUpIcon: React.FC> = (props) => ( + + + + + +); + +export const ChevronsUpIcon: React.FC> = (props) => { + const iconSet = useContext(IconContext); + switch (iconSet) { + case 'lucide': + return ; + case 'tabler': + return ; + case 'remix': + return ; + case 'feather': + default: + return ; + } +}; diff --git a/components/modals/RepoFormModal.tsx b/components/modals/RepoFormModal.tsx index a201cad..9a598cb 100644 --- a/components/modals/RepoFormModal.tsx +++ b/components/modals/RepoFormModal.tsx @@ -30,6 +30,8 @@ import { DocumentDuplicateIcon } from '../icons/DocumentDuplicateIcon'; import { ServerIcon } from '../icons/ServerIcon'; import { TagIcon } from '../icons/TagIcon'; import { CubeIcon } from '../icons/CubeIcon'; +import { ChevronsUpIcon } from '../icons/ChevronsUpIcon'; +import { ChevronsDownIcon } from '../icons/ChevronsDownIcon'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import { PencilIcon } from '../icons/PencilIcon'; @@ -204,7 +206,7 @@ const TaskStepItem: React.FC<{ index: number; totalSteps: number; onStepChange: (id: string, updates: Partial) => void; - onMoveStep: (index: number, direction: 'up' | 'down') => void; + onMoveStep: (index: number, direction: 'up' | 'down' | 'top' | 'bottom') => void; onRemoveStep: (id: string) => void; onDuplicateStep: (index: number) => void; suggestions: ProjectSuggestion[]; @@ -218,6 +220,8 @@ const TaskStepItem: React.FC<{ // --- HOOKS MOVED TO TOP --- const toggleTooltip = useTooltip(isEnabled ? 'Disable Step' : 'Enable Step'); const duplicateTooltip = useTooltip('Duplicate Step'); + const moveToTopTooltip = useTooltip('Move Step to Top'); + const moveToBottomTooltip = useTooltip('Move Step to Bottom'); const selectedDelphiProject = useMemo(() => { return projectInfo?.delphi?.projects.find(p => p.path === step.delphiProjectFile); @@ -311,8 +315,28 @@ const TaskStepItem: React.FC<{ onStepChange(step.id, {enabled: e.target.checked})} className="sr-only peer" />
+ + @@ -1323,11 +1347,21 @@ const TaskStepsEditor: React.FC<{ setTask({ ...task, steps: task.steps.map(s => s.id === id ? { ...s, ...updates } : s) }); }; - const handleMoveStep = (index: number, direction: 'up' | 'down') => { + const handleMoveStep = (index: number, direction: 'up' | 'down' | 'top' | 'bottom') => { const newSteps = [...task.steps]; - const targetIndex = direction === 'up' ? index - 1 : index + 1; - if (targetIndex < 0 || targetIndex >= newSteps.length) return; - [newSteps[index], newSteps[targetIndex]] = [newSteps[targetIndex], newSteps[index]]; + if (direction === 'top') { + if (index === 0) return; + const [stepToMove] = newSteps.splice(index, 1); + newSteps.unshift(stepToMove); + } else if (direction === 'bottom') { + if (index === newSteps.length - 1) return; + const [stepToMove] = newSteps.splice(index, 1); + newSteps.push(stepToMove); + } else { + const targetIndex = direction === 'up' ? index - 1 : index + 1; + if (targetIndex < 0 || targetIndex >= newSteps.length) return; + [newSteps[index], newSteps[targetIndex]] = [newSteps[targetIndex], newSteps[index]]; + } setTask({ ...task, steps: newSteps }); };