Skip to content

fix(custom-tool): restore modal body scroll so Save stays reachable#5321

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix-custom-tool-editor-scroll-save
Jul 1, 2026
Merged

fix(custom-tool): restore modal body scroll so Save stays reachable#5321
waleedlatif1 merged 2 commits into
stagingfrom
fix-custom-tool-editor-scroll-save

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The Edit/Create Agent Tool modal clipped its footer (Save/Update) and could not scroll when a tool had long code or a long schema.
  • Root cause: improvement(platform): remove tour, simplify sidebar/header, drop loading skeletons #4354 migrated this modal to ChipModal and changed the body from a scroll region (flex-1 overflow-y-auto) to flex-none overflow-visible so the hand-positioned EnvVar/Tag autocompletes could spill past it. That removed the scroll region, so tall content grew the body past the modal's max-h-[84vh] cap and the overflow-hidden surface clipped the footer.
  • Restore ChipModalBody as the scroll region (its documented behavior — header/footer stay pinned), and switch the EnvVar/Tag dropdowns to portaled inputRef caret-anchoring, matching the canonical Function-block editor (code.tsx), so they anchor to the caret in a portal and are never clipped by the scroll boundary.
  • No editor height caps, no magic numbers — removes the workaround rather than layering another on top. Net −1 line, one file.

Type of Change

  • Bug fix

Testing

Tested manually; tsc, biome, and the tool-input test suite (47 tests) pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

The Edit/Create Agent Tool modal clipped its footer (Save/Update) and could not scroll with long code or schema content.

Root cause: #4354 migrated the modal to ChipModal and changed the body from a scroll region (flex-1 overflow-y-auto) to flex-none overflow-visible so the hand-positioned EnvVar/Tag autocompletes could spill past it. That removed the scroll region, so tall content grew the body past the modal's max-h-[84vh] cap and the overflow-hidden surface clipped the footer.

Restore ChipModalBody as the scroll region (its documented behavior) and switch the EnvVar/Tag dropdowns to portaled inputRef caret-anchoring, matching the canonical Function-block editor, so they anchor to the caret in a portal and are never clipped by the scroll boundary.
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 1, 2026 5:38pm

Request Review

@cursor

cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Single-file modal layout change; restores documented ChipModalBody scrolling with no auth, data, or API impact.

Overview
Fixes the Edit/Create Agent Tool modal so long schema/code no longer pushes the Next/Save footer out of view.

ChipModalBody no longer uses flex-none overflow-visible (which had opted the body out of scrolling). It now relies on the default body layout (flex-1 + overflow-y-auto), so tall content scrolls inside the modal while the header and footer stay pinned. The inline comment is updated to describe that scroll behavior and that EnvVar/Tag/schema-param menus are expected to use portaled popovers so they are not clipped by the scroll region.

Reviewed by Cursor Bugbot for commit d90dde9. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the custom tool modal so long content can scroll without hiding the footer. The main changes are:

  • Restores the modal body as the scroll region.
  • Keeps the header and footer outside the scrolling content.
  • Documents that autocomplete menus use portaled caret anchoring.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx Restores the custom tool modal body to its default scrollable layout so long schema or code content stays within the modal.

Reviews (3): Last reviewed commit: "fix(custom-tool): keep dropdown anchors ..." | Re-trigger Greptile

Review follow-up. The autocomplete popovers already portal their menus (never clipped by the body's scroll boundary), so the fix is only to restore the body as the scroll region. Reverting the dropdowns to their content-relative absolute anchors keeps them glued to the caret while the body scrolls; the caret-viewport inputRef anchoring used fixed viewport coordinates that only refreshed on edits, detaching the menu on scroll.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d90dde9. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile the schema-param menu anchors to a position:absolute element inside codeEditorRef, which scrolls with the body — the portaled popover tracks it via Floating UI ancestor-scroll autoUpdate. It is not viewport-pinned, so it doesn't drift. Please re-review.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d90dde9. Configure here.

@waleedlatif1 waleedlatif1 merged commit 0575875 into staging Jul 1, 2026
17 checks passed
@waleedlatif1 waleedlatif1 deleted the fix-custom-tool-editor-scroll-save branch July 1, 2026 17:59
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