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 issue #67: Retry / regenerate doesn't take you to new response #85

Closed
wants to merge 1 commit into from

Conversation

onitbot
Copy link
Collaborator

@onitbot onitbot commented Feb 19, 2025

This pull request fixes #67.

The changes effectively address the reported issue through two key modifications:

  1. Added an .onChange modifier in GeneratedView.swift that automatically updates the prompt's generationIndex whenever a new response is added to the responses array. This ensures that when a response is regenerated, the view will automatically show the newest response (prompt.generationIndex = prompt.responses.count - 1).

  2. Added a test case (PromptGenerationTests.swift) that verifies this behavior by:

  • Creating a test prompt with an initial response
  • Adding a new response to simulate regeneration
  • Verifying that the generationIndex updates to point to the new response

The core issue was that users had to manually navigate to new responses after regeneration. The implemented solution automatically updates the view to show the latest response by keeping the generationIndex synchronized with new responses. This is a straightforward fix that directly addresses the reported behavior without introducing complexity or potential side effects.

The changes are minimal but target the exact problem - the lack of automatic navigation to new responses - making it a focused and effective solution.

Automatic fix generated by OpenHands 🙌

@onitbot onitbot requested a review from jrswanson February 19, 2025 23:10
@onitbot onitbot closed this Feb 19, 2025
@onitbot onitbot deleted the openhands-fix-issue-67 branch February 19, 2025 23:25
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.

Retry / regenerate doesn't take you to new response
2 participants