improvement(router): add resizable textareas for router conditions#2888
improvement(router): add resizable textareas for router conditions#2888waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds resizable textareas to router condition blocks with custom drag handles, improving content visibility by increasing the default height from 60px to 100px. The implementation follows the existing resize pattern from Key changes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ResizeHandle
participant startRouterResize
participant Document
participant Textarea
participant State
User->>ResizeHandle: mouseDown on drag handle
ResizeHandle->>startRouterResize: call with event & blockId
startRouterResize->>startRouterResize: capture startY & startHeight
startRouterResize->>Document: addEventListener('mousemove', handleMouseMove)
startRouterResize->>Document: addEventListener('mouseup', handleMouseUp)
loop While dragging
User->>Document: mousemove
Document->>handleMouseMove: trigger
handleMouseMove->>handleMouseMove: calculate newHeight from deltaY
handleMouseMove->>Textarea: update style.height directly
handleMouseMove->>State: setRouterHeights(newHeight)
end
User->>Document: mouseup
Document->>handleMouseUp: trigger
handleMouseUp->>Document: removeEventListener('mousemove')
handleMouseUp->>Document: removeEventListener('mouseup')
|
There was a problem hiding this comment.
Additional Comments (1)
-
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx, line 742-754 (link)logic: the
inputRefsmap is not populated for router mode textareas at this point because this effect only runs for condition mode (!isRouterMode). the resize handler at line 792 tries to accessinputRefs.current.get(blockId)which will be undefined for router textareas.move the ref assignment to happen directly in the
Textareacomponent (line 925) whereref={(el) => { if (el) inputRefs.current.set(block.id, el) }}is already present - that should work correctly
2 files reviewed, 1 comment
Summary
Type of Change
Testing
Tested manually
Checklist