Skip to content

Conversation

@aadamgough
Copy link
Contributor

Reverts #1168

@vercel
Copy link

vercel bot commented Aug 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim Building Building Preview Comment Aug 29, 2025 4:05am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Aug 29, 2025 4:05am

@aadamgough aadamgough merged commit 6ac59a3 into staging Aug 29, 2025
3 of 4 checks passed
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR reverts the complex cursor alignment and canvas error fixes that were implemented in PR #1168. The revert removes three interconnected components of a sophisticated viewport management system:

  1. Workflow-level viewport management - Removes auto-panning logic in workflow.tsx that tracked content height and automatically adjusted the viewport when content overflowed. This included event listeners for layout changes, cursor position tracking, and an onMoveEnd handler for viewport epsilon adjustments.

  2. Input component scroll synchronization - Reverts the long-input.tsx component back to basic scroll handling, removing the sophisticated transform-based scroll synchronization between textarea and overlay elements, ResizeObserver for width matching, and explicit font styling that ensured perfect alignment.

  3. Block-level event coordination - Removes custom event dispatchers (workflow-node-resized and workflow-layout-change) from workflow-block.tsx that were used to coordinate between workflow blocks and input components during resize and layout changes.

The original fix was designed to address cursor misalignment issues and gray canvas errors when pasting long text into workflow input fields. The system worked by maintaining perfect synchronization between a textarea input and its visual overlay, while automatically managing viewport positioning to keep content visible. However, this complex solution likely introduced side effects such as unwanted viewport movements, interference with user interactions, or performance issues, prompting this revert to simpler, more predictable behavior.

The revert also includes some code duplication (a useEffect hook appears twice now) and simplifies several type annotations, indicating the complexity of the interdependencies that were removed.

Confidence score: 2/5

  • This revert carries significant risk as it likely reintroduces the original cursor alignment and canvas error issues that users were experiencing
  • Score reflects high probability that the original problems will resurface, potentially affecting user experience in workflow text inputs
  • Pay close attention to the long-input.tsx component as it's the most likely to exhibit the reverted cursor alignment issues

3 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

Comment on lines +1101 to +1104
// Validate nested subflows whenever blocks change
useEffect(() => {
validateNestedSubflows()
}, [blocks, validateNestedSubflows])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Duplicate useEffect hook for nested subflow validation. This exact same effect is already defined at lines 1097-1099.

@waleedlatif1 waleedlatif1 deleted the revert-1168-fix/cursor-and-input branch August 30, 2025 18:49
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant