From 41af8713741aba4adfe322c0a7aff65b95814b6f Mon Sep 17 00:00:00 2001 From: Trang Doan Date: Tue, 7 Apr 2026 17:51:25 -0400 Subject: [PATCH 1/3] ENG-739 Move color selector from Canvas tab to General tab Co-Authored-By: Claude Sonnet 4.6 --- .../settings/DiscourseNodeCanvasSettings.tsx | 49 ------------- .../src/components/settings/NodeConfig.tsx | 73 ++++++++++++++++++- 2 files changed, 71 insertions(+), 51 deletions(-) diff --git a/apps/roam/src/components/settings/DiscourseNodeCanvasSettings.tsx b/apps/roam/src/components/settings/DiscourseNodeCanvasSettings.tsx index 287f4194b..6718642e8 100644 --- a/apps/roam/src/components/settings/DiscourseNodeCanvasSettings.tsx +++ b/apps/roam/src/components/settings/DiscourseNodeCanvasSettings.tsx @@ -1,11 +1,9 @@ import { InputGroup, - Label, Radio, RadioGroup, Tooltip, Icon, - ControlGroup, } from "@blueprintjs/core"; import React, { useState, useMemo } from "react"; import getBasicTreeByParentUid from "roamjs-components/queries/getBasicTreeByParentUid"; @@ -37,10 +35,6 @@ const DiscourseNodeCanvasSettings = ({ uid: string; }) => { const tree = useMemo(() => getBasicTreeByParentUid(uid), [uid]); - const [color, setColor] = useState(() => { - const color = getSettingValueFromTree({ tree, key: "color" }); - return formatHexColor(color); - }); const alias = getSettingValueFromTree({ tree, key: "alias" }); const [queryBuilderAlias, setQueryBuilderAlias] = useState(() => getSettingValueFromTree({ tree, key: "query-builder-alias" }), @@ -54,49 +48,6 @@ const DiscourseNodeCanvasSettings = ({ return (
-
- - - { - const colorValue = e.target.value.replace("#", ""); // remove hash to not create roam link - setColor(e.target.value); - void setInputSetting({ - blockUid: uid, - key: "color", - value: colorValue, - }); - setDiscourseNodeSetting( - nodeType, - ["canvasSettings", "color"], - colorValue, - ); - }} - /> - - { - setColor(""); - void setInputSetting({ - blockUid: uid, - key: "color", - value: "", - }); - setDiscourseNodeSetting( - nodeType, - ["canvasSettings", "color"], - "", - ); - }} - /> - - -
getBasicTreeByParentUid(canvasUid), + [canvasUid], + ); + const [color, setColor] = useState(() => { + const colorValue = getSettingValueFromTree({ + tree: canvasTree, + key: "color", + }); + return formatHexColor(colorValue); + }); + const [selectedTabId, setSelectedTabId] = useState("general"); const [tagError, setTagError] = useState(""); const [formatError, setFormatError] = useState(""); @@ -181,6 +207,49 @@ const NodeConfig = ({ parentUid={node.type} uid={tagUid} /> +
+ + + { + const colorValue = e.target.value.replace("#", ""); // remove hash to not create roam link + setColor(e.target.value); + void setInputSetting({ + blockUid: canvasUid, + key: "color", + value: colorValue, + }); + setDiscourseNodeSetting( + node.type, + ["canvasSettings", "color"], + colorValue, + ); + }} + /> + + { + setColor(""); + void setInputSetting({ + blockUid: canvasUid, + key: "color", + value: "", + }); + setDiscourseNodeSetting( + node.type, + ["canvasSettings", "color"], + "", + ); + }} + /> + + +
} /> From 71989efb1a2e6f861782150cbc619edd2c682d50 Mon Sep 17 00:00:00 2001 From: Trang Doan Date: Tue, 7 Apr 2026 18:19:37 -0400 Subject: [PATCH 2/3] some small fix --- apps/roam/src/components/settings/NodeConfig.tsx | 2 ++ .../components/settings/components/BlockPropSettingPanels.tsx | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/apps/roam/src/components/settings/NodeConfig.tsx b/apps/roam/src/components/settings/NodeConfig.tsx index f6154fc0a..77f09205c 100644 --- a/apps/roam/src/components/settings/NodeConfig.tsx +++ b/apps/roam/src/components/settings/NodeConfig.tsx @@ -12,6 +12,7 @@ import { ControlGroup, Tooltip, Icon, + Tag, } from "@blueprintjs/core"; import DiscourseNodeSpecification from "./DiscourseNodeSpecification"; import DiscourseNodeAttributes from "./DiscourseNodeAttributes"; @@ -206,6 +207,7 @@ const NodeConfig = ({ order={2} parentUid={node.type} uid={tagUid} + inputStyle={color ? { color } : undefined} />
diff --git a/apps/roam/src/components/settings/components/BlockPropSettingPanels.tsx b/apps/roam/src/components/settings/components/BlockPropSettingPanels.tsx index eeed53191..d31972d97 100644 --- a/apps/roam/src/components/settings/components/BlockPropSettingPanels.tsx +++ b/apps/roam/src/components/settings/components/BlockPropSettingPanels.tsx @@ -50,6 +50,7 @@ type BaseTextPanelProps = { multiline?: boolean; error?: string; onChange?: (value: string) => void; + inputStyle?: React.CSSProperties; } & RoamBlockSyncProps; type BaseFlagPanelProps = { @@ -105,6 +106,7 @@ const BaseTextPanel = ({ multiline, error, onChange, + inputStyle, parentUid, uid, order, @@ -162,6 +164,7 @@ const BaseTextPanel = ({ value={value} onChange={handleChange} placeholder={placeholder || initialValue} + style={inputStyle} /> )} @@ -612,6 +615,7 @@ export const DiscourseNodeTextPanel = ({ multiline?: boolean; error?: string; onChange?: (value: string) => void; + inputStyle?: React.CSSProperties; }) => ( ); From a02b9a86e70a1568ea59f86852a847db0ff9909e Mon Sep 17 00:00:00 2001 From: Trang Doan Date: Wed, 8 Apr 2026 15:23:44 -0400 Subject: [PATCH 3/3] little lint --- apps/roam/src/components/settings/NodeConfig.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/roam/src/components/settings/NodeConfig.tsx b/apps/roam/src/components/settings/NodeConfig.tsx index 77f09205c..d15b967cf 100644 --- a/apps/roam/src/components/settings/NodeConfig.tsx +++ b/apps/roam/src/components/settings/NodeConfig.tsx @@ -12,7 +12,6 @@ import { ControlGroup, Tooltip, Icon, - Tag, } from "@blueprintjs/core"; import DiscourseNodeSpecification from "./DiscourseNodeSpecification"; import DiscourseNodeAttributes from "./DiscourseNodeAttributes";