Add ReviewPresenter and improve wizard internals (state store and steps methods)#11
Merged
tomas-stefano merged 7 commits intomainfrom Feb 5, 2026
Merged
Conversation
1. Add ReviewPresenter module for building Check Your Answers pages - Row objects with label, value, formatted_value, and change_path - format_value override for custom value formatting - Automatic I18n label lookup 2. Replace StateStore method_missing with explicit attribute accessors - Generate reader methods dynamically after wizard initialisation - Clearer error messages for undefined attributes 3. Fix Graph max_depth to use actual step count instead of hardcoded 20 - Prevents infinite loops on circular graphs - Uses @registry.nodes.size for accurate depth limit 4. Add predicate_caller option to Graph.draw - Allows predicates to be called on state_store instead of wizard - Cleaner separation of concerns 5. Add cycle detection tests for circular wizard graphs
- Rename module to align with GOV.UK Design System terminology - Add reviewable_steps method (defaults to flow_steps, overridable) - Add find_reviewable_step to find step by ID from reviewable steps - row_for now returns nil if step not in reviewable_steps or attribute does not exist (enables .compact pattern) - rows_for returns empty array if step not in reviewable_steps - Update example presenter and view to use new pattern - Remove manual in_flow? checks since row_for handles it now
It is not needed anymore after defining the step attributes as accessors on state store
avinhurry
reviewed
Feb 5, 2026
Contributor
avinhurry
left a comment
There was a problem hiding this comment.
Left a few thoughts/comments in line.
Nice improvement overall. Moving predicates to state_store is a good step forward.
avinhurry
approved these changes
Feb 5, 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.
Add ReviewPresenter module for building Check Your Answers pages
Replace StateStore method_missing with explicit attribute accessors
Fix Graph max_depth to use actual step count instead of hardcoded 20
Add predicate_caller option to Graph.draw
Add cycle detection tests for circular wizard graphs