Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): Typing in the NodeKeyValueInput field causes the field to un-focus #8680

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented Nov 18, 2024

#8657 introduces state change on each input onChange event. This causes the NodeKeyValueInput to get re-rendered on each value change making the input unfocussed.

Changes 🏗️

Use a numbered index as the DOM key instead of an actual input key to avoid React's dirty check and re-render the component as a different DOM, which causes the input to un-focus.

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:
    • ...
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.example 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

@majdyz majdyz requested a review from a team as a code owner November 18, 2024 02:57
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

React Key Pattern
Using array index as React key could lead to incorrect component updates if items are reordered or deleted. Consider using a more stable unique identifier if items can be reordered.

@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end size/s labels Nov 18, 2024
Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit fc4b2d4
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/673b0e681d7a720008e82068

@majdyz majdyz requested a review from aarushik93 November 18, 2024 09:52
@Torantulino Torantulino merged commit cd7dfbb into dev Nov 18, 2024
15 checks passed
@Torantulino Torantulino deleted the zamilmajdy/open-2050-typing-in-the-prompt-values-input-field-causes-the-field-to branch November 18, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end Review effort [1-5]: 1 size/s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants