Spaces:
Running
Running
Commit ·
433b3b5
1
Parent(s): 208a8d6
feat: redesign visual branches connections in TaskListView to match custom tree layout
Browse files1821 unmodified lines18221823182418251826182718286 unmodified lines183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721821 unmodified lines</div>{hasSubtasks && isExpanded && (<div className="pl-4 ml-2 space-y-6 pt-2 pb-2">{(() => {const directSubgoals = subgoalEdges.filter(e => e.source === node.id)6 unmodified linesif (branchNodes.length === 0) return null;const isBranchCollapsed = collapsedBranches.has(subgoal.id);return (<div key={subgoal.id} className="space-y-4">{/* Branch divider */}<div className="flex items-center gap-2 py-1 select-none"><div className="flex-1 h-0.5 border-t-2 border-dashed border-primary/20" /><buttononClick={() => {const newSet = new Set(collapsedBranches);if (newSet.has(subgoal.id)) {newSet.delete(subgoal.id);} else {newSet.add(subgoal.id);}setCollapsedBranches(newSet);}}className="px-4 py-1 border-2 border-primary rounded-full bg-surface-container-lowest text-primary text-[10px] font-extrabold flex items-center gap-2 shadow-[2px_2px_0px_0px_var(--color-primary)] active:translate-y-0.5 active:shadow-[1px_1px_0px_0px_var(--color-primary)] cursor-pointer hover:bg-secondary/10"><span className="font-mono text-xs font-extrabold tracking-tighter">{isBranchCollapsed ? '----(+)' : '----(-)'}</span></button><div className="flex-1 h-0.5 border-t-2 border-dashed border-primary/20" /></div>{/* Branch contents */}{!isBranchCollapsed && (<div className="pl-6 border-l-2 border-dashed border-primary/20 ml-4 space-y-4">{branchNodes.map((bNode) => {const isHead = bNode.id === subgoal.id;return renderTaskCard(bNode, depth + 1, isHead, !isHead);})}</div>)}</div>1821 unmodified lines18221823182418251826182718286 unmodified lines183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781821 unmodified lines</div>{hasSubtasks && isExpanded && (<div className="relative ml-8 pl-6 border-l-2 border-dashed border-yellow-500/50 dark:border-yellow-500/30 space-y-6 pt-2 pb-2">{(() => {const directSubgoals = subgoalEdges.filter(e => e.source === node.id)6 unmodified linesif (branchNodes.length === 0) return null;const isBranchCollapsed = collapsedBranches.has(subgoal.id);const headNode = branchNodes[0];const continuationNodes = branchNodes.slice(1);return (<div key={subgoal.id} className="relative space-y-4">{/* Collapse button centered on the yellow dashed line */}<buttononClick={() => {const newSet = new Set(collapsedBranches);if (newSet.has(subgoal.id)) {newSet.delete(subgoal.id);} else {newSet.add(subgoal.id);}setCollapsedBranches(newSet);}}className={`absolute -left-[36px] top-3.5 w-6 h-6 rounded-full border-2 border-primary flex items-center justify-center cursor-pointer shadow-[2px_2px_0px_0px_var(--color-primary)] hover:scale-105 active:translate-y-0.5 transition-all font-mono text-sm font-extrabold z-10 ${isBranchCollapsed? 'bg-amber-400 text-black border-primary': 'bg-surface-container-lowest text-primary border-primary'}`}title={isBranchCollapsed ? 'Розгорнути гілку' : 'Згорнути гілку'}>{isBranchCollapsed ? '+' : '−'}</button>{/* Branch contents */}{!isBranchCollapsed && (<div className="space-y-4">{/* Branch Head (Yellow dashed left border) */}{renderTaskCard(headNode, depth + 1, true, false)}{/* Continuations (Green solid vertical connecting line) */}{continuationNodes.length > 0 && (<div className="pl-6 border-l-2 border-solid border-emerald-500 dark:border-emerald-600/60 ml-8 space-y-4 pt-1 pb-1">{continuationNodes.map((cNode) => renderTaskCard(cNode, depth + 1, false, true))}</div>)}</div>)}</div>
src/pages/CanvasPage.jsx+34-28