fix restore node size, and add feeback
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -13,4 +13,5 @@ frontend/node_modules/
|
|||||||
frontend/dist/
|
frontend/dist/
|
||||||
.venv/
|
.venv/
|
||||||
sessions/
|
sessions/
|
||||||
frontend/coverage/
|
frontend/coverage/
|
||||||
|
usage_stats.json
|
||||||
@@ -2492,6 +2492,9 @@ function Flow() {
|
|||||||
<button className="btn" onClick={() => { openDocByFilename('getting-started.md'); closeMenu(); }} title="Getting started guide">
|
<button className="btn" onClick={() => { openDocByFilename('getting-started.md'); closeMenu(); }} title="Getting started guide">
|
||||||
? Help
|
? Help
|
||||||
</button>
|
</button>
|
||||||
|
<a className="btn" href="https://github.com/VIPQualityPost/tono/issues" target="_blank" rel="noopener noreferrer" onClick={closeMenu} title="Report a bug or request a feature">
|
||||||
|
↗ Feedback
|
||||||
|
</a>
|
||||||
{updateInfo && (
|
{updateInfo && (
|
||||||
<>
|
<>
|
||||||
<hr className="floating-menu-divider" />
|
<hr className="floating-menu-divider" />
|
||||||
|
|||||||
@@ -999,6 +999,12 @@ function CustomNode({ id, data }: { id: string; data: NodeData }) {
|
|||||||
const def = data.definition;
|
const def = data.definition;
|
||||||
const scalarDisplay = formatScalarDisplay(data.scalarValue);
|
const scalarDisplay = formatScalarDisplay(data.scalarValue);
|
||||||
const processingTimeText = formatProcessingTime(data.processingTimeMs);
|
const processingTimeText = formatProcessingTime(data.processingTimeMs);
|
||||||
|
const nodeWidth = useStore(
|
||||||
|
useCallback((s: any) => {
|
||||||
|
const node = s.nodeLookup.get(id);
|
||||||
|
return node?.width ?? undefined;
|
||||||
|
}, [id]),
|
||||||
|
);
|
||||||
const connectedPathInfo = useStore(
|
const connectedPathInfo = useStore(
|
||||||
useCallback((s: any) => getConnectedOutputInfo(s, id, 'path'), [id]),
|
useCallback((s: any) => getConnectedOutputInfo(s, id, 'path'), [id]),
|
||||||
);
|
);
|
||||||
@@ -1206,7 +1212,7 @@ function CustomNode({ id, data }: { id: string; data: NodeData }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{ctx?.executingNodeId === id && <div className="node-executing-glow" aria-hidden="true" />}
|
{ctx?.executingNodeId === id && <div className="node-executing-glow" aria-hidden="true" />}
|
||||||
<div className={`custom-node${data.error ? ' node-error' : ''}`}>
|
<div className={`custom-node${data.error ? ' node-error' : ''}`} style={nodeWidth ? { width: nodeWidth } : undefined}>
|
||||||
{/* Title */}
|
{/* Title */}
|
||||||
<div className="node-title drag-handle" style={{ background: catColor }}>
|
<div className="node-title drag-handle" style={{ background: catColor }}>
|
||||||
<div className="node-title-left">
|
<div className="node-title-left">
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ export function hydrateWorkflowState(data: SerializedWorkflow | null | undefined
|
|||||||
const nodes = sortNodesForParentOrder(loadedNodes.map((node) => {
|
const nodes = sortNodesForParentOrder(loadedNodes.map((node) => {
|
||||||
const definition = mergeDefinition(node.data, defs);
|
const definition = mergeDefinition(node.data, defs);
|
||||||
|
|
||||||
|
const restoredStyle = { ...(node.style || {}) };
|
||||||
|
if (node.width && !restoredStyle.width) restoredStyle.width = node.width;
|
||||||
|
if (node.height && !restoredStyle.height) restoredStyle.height = node.height;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...node,
|
...node,
|
||||||
type: node.type || 'custom',
|
type: node.type || 'custom',
|
||||||
@@ -49,7 +53,7 @@ export function hydrateWorkflowState(data: SerializedWorkflow | null | undefined
|
|||||||
parentId: node.parentId,
|
parentId: node.parentId,
|
||||||
extent: node.extent,
|
extent: node.extent,
|
||||||
hidden: !!node.hidden,
|
hidden: !!node.hidden,
|
||||||
style: node.style,
|
style: restoredStyle,
|
||||||
dragHandle: node.dragHandle || '.drag-handle',
|
dragHandle: node.dragHandle || '.drag-handle',
|
||||||
data: {
|
data: {
|
||||||
...node.data,
|
...node.data,
|
||||||
|
|||||||
Reference in New Issue
Block a user