fix restore node size, and add feeback
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -14,3 +14,4 @@ frontend/dist/
|
||||
.venv/
|
||||
sessions/
|
||||
frontend/coverage/
|
||||
usage_stats.json
|
||||
@@ -2492,6 +2492,9 @@ function Flow() {
|
||||
<button className="btn" onClick={() => { openDocByFilename('getting-started.md'); closeMenu(); }} title="Getting started guide">
|
||||
? Help
|
||||
</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 && (
|
||||
<>
|
||||
<hr className="floating-menu-divider" />
|
||||
|
||||
@@ -999,6 +999,12 @@ function CustomNode({ id, data }: { id: string; data: NodeData }) {
|
||||
const def = data.definition;
|
||||
const scalarDisplay = formatScalarDisplay(data.scalarValue);
|
||||
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(
|
||||
useCallback((s: any) => getConnectedOutputInfo(s, id, 'path'), [id]),
|
||||
);
|
||||
@@ -1206,7 +1212,7 @@ function CustomNode({ id, data }: { id: string; data: NodeData }) {
|
||||
return (
|
||||
<>
|
||||
{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 */}
|
||||
<div className="node-title drag-handle" style={{ background: catColor }}>
|
||||
<div className="node-title-left">
|
||||
|
||||
@@ -42,6 +42,10 @@ export function hydrateWorkflowState(data: SerializedWorkflow | null | undefined
|
||||
const nodes = sortNodesForParentOrder(loadedNodes.map((node) => {
|
||||
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 {
|
||||
...node,
|
||||
type: node.type || 'custom',
|
||||
@@ -49,7 +53,7 @@ export function hydrateWorkflowState(data: SerializedWorkflow | null | undefined
|
||||
parentId: node.parentId,
|
||||
extent: node.extent,
|
||||
hidden: !!node.hidden,
|
||||
style: node.style,
|
||||
style: restoredStyle,
|
||||
dragHandle: node.dragHandle || '.drag-handle',
|
||||
data: {
|
||||
...node.data,
|
||||
|
||||
Reference in New Issue
Block a user