Repository navigation
Adds Back through a plain returnable step - #264
Merged
Merged
Conversation
Registers myapp.step, a plain host block type beside the composite myapp.screen, that declares statifier_blocks' returnable?/1, so a Path built from it compiles with a trail and answers the reserved back event. Journey reads Back from Runtime.Back.offered?/3 into riddler's moves, and Journey.back/3 decodes riddler's back request and raises the event. The Journey page draws a Back control from the view and runs a small patron registration Path in three steps under ?path=. The signup Path keeps its composite screens and its authored back edge; its compiled bytes, and patron registration's, are unchanged. Refs: se-6b57
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 this does
Back through the engine, in the reference embedder, through a plain returnable host step type.
myapp.step(StatifierExamples.Signup.ReturnableStep): a plain, non-composite block type registered in the host's palette beside the compositemyapp.screen. It declares statifier_blocks' optionalreturnable?/1callback (alwaystrue), so a document built from it compiles with a trail and answers the reserved back event. Its config names the screen it shows, its buttons' outcomes (each finishes the step) and its questions' keys (each written toresponses.<key>only where the press carried it). It does not read a screens document, so a second document reuses it by naming it.Journey: a view now carriesback, read fromStatifierBlocks.Runtime.Back.offered?/3over the execution's datamodel and active leaf states and passed to riddler as the screen status's"back", so it is riddler's moves' own.Journey.back/3decodes the client's request withRiddler.Journey.decode_submit/1, checks it names the screen the execution is on and that Back is offered, and raisesstatifier_blocks.backon the execution. Nothing typed on the screen left is sent; held responses stay. Amyapp.stepblock parks on its own block id.signup_journey_live.ex) draws a Back control wherever the view'sbackistrueand nowhere else, sends riddler's back request{"screen": key, "back": true}, and starts the re-shown screen's draft from the values riddler presents, so Continue there sends what the reader gave before.?path=patron_registration_stepsruns the proof document; the page's Back handling reads the view, never the Path's name.priv/fixtures/patron_registration_steps.json: the patron's name, the card, the home branch, each amyapp.stepblock, and its screens documentpatron_registration_steps_screens.json), run as a supplied Path throughStatifierExamples.Library.RegistrationSteps. It is not one of the fixturesCharts.fixtures/0lists.The signup Path is unchanged
The signup Path keeps its composite
myapp.screentype and its authored back edge, theon_went_backslot insignup_path.json; neither file changes. A composite cannot be declared a returnable step (statifier_blocks ADR-0002, C12b), so Back through the engine is shown with the plain step type instead: ruled by the operator, 2026-11-22. Its Back reader answersfalseon every screen, so the page draws no engine Back control there and the plan screen's own Back button is still the one shown.The compiled bytes of
signup_pathandpatron_registrationare pinned in the new test at their values on main before this change, and they do not move: neither uses the new type.No statifier_blocks change and no new release; the dependency versions are as on main.
Provenance
donewhichever button was pressed.Journey.back_event/0.charts_test.exs,signup_test.exs), and named the new screens document among the files that are not block documents (block_schema_test.exs). The new type leads its schema with the sharedlabelfield, as every host type does.Tests
test/statifier_examples/signup/returnable_step_test.exs(the type, the Journey walking the steps back and forth, the refusals, the signup Path) and a new describe block insignup_journey_live_test.exs(the page). Every new test carries a sabotage note from a run: each mutation applied, the named test failed on an assertion, and the file was restored byte-equal from a copy before the next.Full
mix qualitygreen on SQLite.