Conversation
When checking to see if there was an existing test file for useUpdateFragment, we found that tests exists but were in a spec file whose name had not yet been updated to reflect the recently changed name of the hook.
…ginal state. This simplifies the developer experience in the scenario where an update is dispatched and needs to be rolled back (as in the case of optimistic UI patterns). An object is returned so that it can be expanded later to also include redo and undo functions, as described in issue thoughtbot#214.
jho406
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Contributes to, but does not fully resolve, #214 (split off just the reset behavior, still need redo and undo behavior).
How
AI Disclaimer
I made the change to the hook by hand and chose what kinds of tests to add, but I utilized Claude Code to generate the unit tests themselves (for speed, during the Ruby Conf '26 hack day). I reviewed them in detail and they do what I want them to.