Spaces:
Running
Running
Commit ·
8059ea2
1
Parent(s): 10d53a4
fix: restore original theme color as default for goal nodes, keeping comments yellow by default
Browse filesFiles changed (4)
54 unmodified lines5556575859606154 unmodified linesconst remainingCount = assignees.length - visibleAssignees.length;// Background and border style resolution based on selected color or default to yellowconst selectedColor = PASTEL_COLORS[data.color || 'yellow'];const nodeBg = isDarkMode ? selectedColor.dark : selectedColor.light;const nodeBorder = isDarkMode ? selectedColor.borderDark : selectedColor.borderLight;54 unmodified lines555657585960616254 unmodified linesconst remainingCount = assignees.length - visibleAssignees.length;// Background and border style resolution based on selected color or default to yellowconst colorKey = data.color && data.color !== 'default' ? data.color : 'yellow';const selectedColor = PASTEL_COLORS[colorKey];const nodeBg = isDarkMode ? selectedColor.dark : selectedColor.light;const nodeBorder = isDarkMode ? selectedColor.borderDark : selectedColor.borderLight;
141 unmodified lines142143144145146147148141 unmodified linesconst visibleAssignees = shouldTruncate ? assignees.slice(0, 2) : assignees;const remainingCount = assignees.length - visibleAssignees.length;const selectedColor = PASTEL_COLORS[data.color];const nodeBg = selectedColor? (isDarkMode ? selectedColor.dark : selectedColor.light): 'var(--color-surface-container-lowest)';141 unmodified lines142143144145146147148141 unmodified linesconst visibleAssignees = shouldTruncate ? assignees.slice(0, 2) : assignees;const remainingCount = assignees.length - visibleAssignees.length;const selectedColor = data.color && data.color !== 'default' ? PASTEL_COLORS[data.color] : null;const nodeBg = selectedColor? (isDarkMode ? selectedColor.dark : selectedColor.light): 'var(--color-surface-container-lowest)';
594 unmodified lines5955965975985996006011 unmodified line603604605606607608609186 unmodified lines796797798799800801802318 unmodified lines1121112211231124112511261127594 unmodified lines}} else if (n.type === 'sketch') {let assignees = [];let color = 'yellow';if (n.decision && n.decision.startsWith('{')) {try {const parsed = JSON.parse(n.decision);1 unmodified lineprogress = parsed.progress || 0;showProgress = !!parsed.showProgress;decision = parsed.decision || 'bottom';color = parsed.color || 'yellow';if (parsed.assignees && Array.isArray(parsed.assignees)) {assignees = parsed.assignees;} else if (parsed.assignee) {186 unmodified linesshowProgress: !!n.data.showProgress,decision: n.data.decision || 'bottom',assignees: n.data.assignees || [],color: n.data.color || 'yellow'}): n.type === 'comment'? JSON.stringify({318 unmodified linesnodeData.assignees = [];} else if (type === 'sketch') {nodeData.decision = 'bottom';nodeData.color = 'yellow';nodeData.assignees = [];} else {nodeData.decision = 'bottom';594 unmodified lines5955965975985996006011 unmodified line603604605606607608609186 unmodified lines796797798799800801802318 unmodified lines1121112211231124112511261127594 unmodified lines}} else if (n.type === 'sketch') {let assignees = [];let color = undefined;if (n.decision && n.decision.startsWith('{')) {try {const parsed = JSON.parse(n.decision);1 unmodified lineprogress = parsed.progress || 0;showProgress = !!parsed.showProgress;decision = parsed.decision || 'bottom';color = parsed.color || undefined;if (parsed.assignees && Array.isArray(parsed.assignees)) {assignees = parsed.assignees;} else if (parsed.assignee) {186 unmodified linesshowProgress: !!n.data.showProgress,decision: n.data.decision || 'bottom',assignees: n.data.assignees || [],color: n.data.color}): n.type === 'comment'? JSON.stringify({318 unmodified linesnodeData.assignees = [];} else if (type === 'sketch') {nodeData.decision = 'bottom';nodeData.color = undefined;nodeData.assignees = [];} else {nodeData.decision = 'bottom';
476 unmodified lines4774784794804814822 unmodified lines48548648748848949049149249388 unmodified lines582583584585586587588589590591592593594595476 unmodified lines// Premium digital sketchbook style settings modal for goal (sketch) and comment nodesconst SketchSettingsModal = ({ node, onClose, onSave, collaborators = [] }) => {const { t } = useTranslation();const [label, setLabel] = useState(() =>isDefaultLabel(node.data.label) ? '' : node.data.label);2 unmodified linesconst [progress, setProgress] = useState(node.data.progress || 0);const [assignees, setAssignees] = useState(node.data.assignees || []);const [isAssigneesExpanded, setIsAssigneesExpanded] = useState(false);const [color, setColor] = useState(node.data.color || 'yellow');const PASTEL_COLORS = {yellow: { light: '#fef9c3', dark: '#2e2b14', borderLight: '#eab308', borderDark: '#ca8a04' },blue: { light: '#dbeafe', dark: '#111827', borderLight: '#3b82f6', borderDark: '#2563eb' },green: { light: '#dcfce7', dark: '#062f17', borderLight: '#22c55e', borderDark: '#16a34a' },88 unmodified linesonClick={() => setColor(cKey)}className="w-8 h-8 rounded-full border-2 transition-all cursor-pointer relative shadow-[1px_1px_0px_0px_rgba(0,0,0,0.15)] hover:scale-110 flex items-center justify-center"style={{backgroundColor: colors.light,borderColor: isSelected ? colors.borderLight : 'var(--color-primary)',borderWidth: isSelected ? '3px' : '2px'}}title={cKey}>{isSelected && (<Check size={14} className="text-black stroke-[3px]" />)}</button>);476 unmodified lines4774784794804814824832 unmodified lines48648748848949049149249349449588 unmodified lines584585586587588589590591592593594595596597476 unmodified lines// Premium digital sketchbook style settings modal for goal (sketch) and comment nodesconst SketchSettingsModal = ({ node, onClose, onSave, collaborators = [] }) => {const { t } = useTranslation();const { isDarkMode } = useTheme();const [label, setLabel] = useState(() =>isDefaultLabel(node.data.label) ? '' : node.data.label);2 unmodified linesconst [progress, setProgress] = useState(node.data.progress || 0);const [assignees, setAssignees] = useState(node.data.assignees || []);const [isAssigneesExpanded, setIsAssigneesExpanded] = useState(false);const [color, setColor] = useState(node.data.color || (node.type === 'comment' ? 'yellow' : 'default'));const PASTEL_COLORS = {default: { light: '#ffffff', dark: '#1e293b', borderLight: '#cbd5e1', borderDark: '#475569', isDefault: true },yellow: { light: '#fef9c3', dark: '#2e2b14', borderLight: '#eab308', borderDark: '#ca8a04' },blue: { light: '#dbeafe', dark: '#111827', borderLight: '#3b82f6', borderDark: '#2563eb' },green: { light: '#dcfce7', dark: '#062f17', borderLight: '#22c55e', borderDark: '#16a34a' },88 unmodified linesonClick={() => setColor(cKey)}className="w-8 h-8 rounded-full border-2 transition-all cursor-pointer relative shadow-[1px_1px_0px_0px_rgba(0,0,0,0.15)] hover:scale-110 flex items-center justify-center"style={{backgroundColor: colors.isDefault ? (isDarkMode ? '#1e293b' : '#ffffff') : colors.light,borderColor: isSelected ? (colors.isDefault ? '#3b82f6' : colors.borderLight) : 'var(--color-primary)',borderWidth: isSelected ? '3px' : '2px'}}title={cKey === 'default' ? t('canvas.color_default', 'Дефолт') : cKey}>{isSelected && (<Check size={14} className={colors.isDefault && isDarkMode ? "text-white stroke-[3px]" : "text-black stroke-[3px]"} />)}</button>);
src/features/canvas/components/nodes/CommentNode.jsx+2-1
src/features/canvas/components/nodes/SketchNode.jsx+1-1
src/features/canvas/hooks/useCanvasLogic.js+4-4
src/pages/CanvasPage.jsx+7-5