Skip to content

Conversation

@seer-by-sentry
Copy link
Contributor

Fixes BUILDER-5C1. The issue was that: Dialog's ResizeObserver triggers state update, changing marginRight, causing layout shift, re-triggering observer infinitely.

Changes 🏗️

  • Introduced debounce from lodash to optimize performance.
  • Applied a 100ms debounce to the scrollbar detection logic (update function) triggered by ResizeObserver and window resize events in DialogWrap.
  • Added cleanup for the debounced function to prevent memory leaks.

This fix was generated by Seer in Sentry, triggered by Bently. 👁️ Run ID: 7764080

Not quite right? Click here to continue debugging with Seer.

Checklist 📃

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Open various dialogs/modals in the application (e.g., Settings, Agent details).
    • Verify that opening the dialog does not cause infinite layout shifts or performance degradation.
    • Resize the browser window while a dialog is open and confirm stability and correct scrollbar handling.
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.default is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

0ubbe and others added 2 commits December 18, 2025 19:04
### Changes 🏗️

Chat should be disabled by default; otherwise, it flashes, and if Launch
Darkly fails to fail, it is dangerous.

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  - [x] Run locally with Launch Darkly disabled and test the above
@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

This PR targets the master branch but does not come from dev or a hotfix/* branch.

Automatically setting the base branch to dev.

@github-actions github-actions bot added the platform/frontend AutoGPT Platform - Front end label Dec 19, 2025
@github-actions github-actions bot changed the base branch from master to dev December 19, 2025 16:47
@AutoGPT-Agent
Copy link

Thank you for this performance improvement PR! The debounce implementation looks good and should effectively address the infinite layout shifting issue.

However, there are a couple of things that need to be addressed before this can be merged:

  1. Incomplete checklist: You've written a test plan but haven't checked off that you've actually executed it. Please complete the testing and check off the corresponding boxes in the checklist.

  2. Out-of-scope change: There's a change to the CHAT feature flag (changing it from true to false in use-get-flag.ts) that isn't mentioned in your PR description and seems unrelated to the scrollbar detection fix. This change should either:

    • Be removed if unintentional
    • Be explained in the PR description if it's necessary
    • Be submitted in a separate PR if it's addressing a different issue

Once these items are addressed, the PR will be ready for re-review.

@AutoGPT-Agent
Copy link

Thank you for this performance improvement to fix the infinite layout shift issue in DialogWrap!

Before we can merge this PR, there are a few things that need to be addressed:

  1. The checklist is incomplete - you've added test steps but haven't checked off the 'I have made a test plan' box or any of the test steps to indicate you've verified the fix works.

  2. There appears to be an unrelated change to the CHAT feature flag (changing it from true to false in use-get-flag.ts). This doesn't seem to be mentioned in the PR description and appears to be out of scope for a performance fix to DialogWrap.

Please:

  • Complete the checklist by checking off items you've tested
  • Either remove the unrelated feature flag change or explain its relation to this performance fix

The technical approach to debouncing the scrollbar detection looks solid and should fix the issue effectively. The cleanup for the debounced function to prevent memory leaks is a good practice.

@Bentlybro
Copy link
Member

This was made as a test to see if we could fix the "Maximum update depth exceeded." error but not 100% sure, need to test so keeping as draft for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/frontend AutoGPT Platform - Front end size/m

Projects

Status: 🆕 Needs initial review
Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants